Talk:BotTxt
From WikiManual
Cachebot?
How would you create a bot that creates caches and stores them in epigenetic memory? I tried, but it failed:
'Nomad 'Shotbot designed for huge sims with little food 'Saves 3 "caches" or food sights in epigenetic memory
'When each cache is depleted (bots have less than 100 nrg), move on to the next one. 'Follow conspecs to get at their caches
'Share caches on i/o
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 'defs def cachex1 971 def cachey1 972 def cachex2 973 def cachey2 974 def cachex3 975 def cachey3 976
'Temps def tempcache 21 def tcx 22 def tcy 23
'Nrg-saving mode (hibernate) def code9 24
'Am I moving? def mov 25
'As many genes as possible will be sg-ified
'Oculus start -4 *.eye1 *.eye9 sub sgn 0 floor mult *.eye1 *.eye8 sub sgn 0 floor mult *.eye1 *.eye7 sub sgn 0 floor mult *.eye1 *.eye6 sub sgn 0 floor mult *.eye1 *.eye5 sub sgn 0 floor mult *.eye1 *.eye4 sub sgn 0 floor mult *.eye1 *.eye3 sub sgn 0 floor mult *.eye1 *.eye2 sub sgn 0 floor mult 4 *.eye9 *.eye8 sub sgn 0 floor mult *.eye9 *.eye7 sub sgn 0 floor mult *.eye9 *.eye6 sub sgn 0 floor mult *.eye9 *.eye5 sub sgn 0 floor mult *.eye9 *.eye4 sub sgn 0 floor mult *.eye9 *.eye3 sub sgn 0 floor mult *.eye9 *.eye2 sub sgn 0 floor mult *.eye9 *.eye1 sub sgn ++ sgn mult add -3 *.eye2 *.eye9 sub sgn ++ sgn mult *.eye2 *.eye8 sub sgn 0 floor mult *.eye2 *.eye7 sub sgn 0 floor mult *.eye2 *.eye6 sub sgn 0 floor mult *.eye2 *.eye5 sub sgn 0 floor mult *.eye2 *.eye4 sub sgn 0 floor mult *.eye2 *.eye3 sub sgn 0 floor mult *.eye2 *.eye1 sub sgn ++ sgn mult add 3 *.eye8 *.eye9 sub sgn ++ sgn mult *.eye8 *.eye7 sub sgn 0 floor mult *.eye8 *.eye6 sub sgn 0 floor mult *.eye8 *.eye5 sub sgn 0 floor mult *.eye8 *.eye4 sub sgn 0 floor mult *.eye8 *.eye3 sub sgn 0 floor mult *.eye8 *.eye2 sub sgn ++ sgn mult *.eye8 *.eye1 sub sgn ++ sgn mult add -2 *.eye3 *.eye9 sub sgn ++ sgn mult *.eye3 *.eye8 sub sgn ++ sgn mult *.eye3 *.eye7 sub sgn 0 floor mult *.eye3 *.eye6 sub sgn 0 floor mult *.eye3 *.eye5 sub sgn 0 floor mult *.eye3 *.eye4 sub sgn 0 floor mult *.eye3 *.eye2 sub sgn ++ sgn mult *.eye3 *.eye1 sub sgn ++ sgn mult add 2 *.eye7 *.eye9 sub sgn ++ sgn mult *.eye7 *.eye8 sub sgn ++ sgn mult *.eye7 *.eye7 sub sgn 0 floor mult *.eye7 *.eye6 sub sgn 0 floor mult *.eye7 *.eye5 sub sgn 0 floor mult *.eye7 *.eye4 sub sgn ++ sgn mult *.eye7 *.eye2 sub sgn ++ sgn mult *.eye7 *.eye1 sub sgn ++ sgn mult add -1 *.eye4 *.eye9 sub sgn ++ sgn mult *.eye4 *.eye8 sub sgn ++ sgn mult *.eye4 *.eye7 sub sgn ++ sgn mult *.eye4 *.eye6 sub sgn 0 floor mult *.eye4 *.eye5 sub sgn 0 floor mult *.eye4 *.eye3 sub sgn ++ sgn mult *.eye4 *.eye2 sub sgn ++ sgn mult *.eye4 *.eye1 sub sgn ++ sgn mult add 1 *.eye6 *.eye9 sub sgn ++ sgn mult *.eye6 *.eye8 sub sgn ++ sgn mult *.eye6 *.eye7 sub sgn ++ sgn mult *.eye6 *.eye6 sub sgn ++ sgn mult *.eye6 *.eye5 sub sgn 0 floor mult *.eye6 *.eye3 sub sgn ++ sgn mult *.eye6 *.eye2 sub sgn ++ sgn mult *.eye6 *.eye1 sub sgn ++ sgn mult add 4 add *.focuseye 4 add sub dup sgn -- sgn ++ .focuseye mult inc -- dup sgn -- sgn ++ .focuseye mult inc -- dup sgn -- sgn ++ .focuseye mult inc -- dup sgn -- sgn ++ .focuseye mult inc -- dup sgn -- sgn ++ .focuseye mult inc -- dup sgn -- sgn ++ .focuseye mult inc -- dup sgn -- sgn ++ .focuseye mult inc -- dup sgn -- sgn ++ .focuseye mult inc -- dup sgn -- sgn ++ .focuseye mult inc -- 9 add - dup sgn -- sgn ++ .focuseye mult dec -- dup sgn -- sgn ++ .focuseye mult dec -- dup sgn -- sgn ++ .focuseye mult dec -- dup sgn -- sgn ++ .focuseye mult dec -- dup sgn -- sgn ++ .focuseye mult dec -- dup sgn -- sgn ++ .focuseye mult dec -- dup sgn -- sgn ++ .focuseye mult dec -- dup sgn -- sgn ++ .focuseye mult dec -- dup sgn -- sgn ++ .focuseye mult dec -- stop
'Actions 'Find and save caches 'Follow cons as well as just going one way 'Go between caches 'Reproduce 'Feed on caches (-6 shots) without killing it 'Save as much nrg as possible b/w caches (code9)
'On birth, set dir start *.robage 0 = 0 618 rnd .setaim store stop
'Turn away from cons cond *.code9 0 = start *.eye5 0 = 10 .up store *.myeye *.refeye = 618 .aimsx store stop
'Save cache locs once I come across them cond *.myeye *.refeye != *.cachex1 *.cachey1 mult *.cachex2 mult *.cachey2 mult *.cachex3 mult *.cachey3 mult 0 != start *.cachex1 *.cachey1 mult 0 = *.refxpos *.cachex2 != *.refypos *.cachey2 != *.refxpos *.cachex3 != *.refypos *.cachey3 != *.refxpos .cachex1 store *.refypos .cachey1 store *.cachex2 *.cachey2 mult 0 = *.refxpos *.cachex1 != *.refypos *.cachey1 != *.refxpos *.cachex3 != *.refypos *.cachey3 != *.refxpos .cachex2 store *.refypos .cachey2 store *.cachex3 *.cachey3 mult 0 = *.refxpos *.cachex1 != *.refypos *.cachey1 != *.refxpos *.cachex2 != *.refypos *.cachey2 != *.refxpos .cachex3 store *.refypos .cachey3 store stop
'If I see food, eat it (almost) cond *.eyef 0 > *.refeye *.myeye != start *.refveldx .dx store *.refvelup 30 add .up store stop
cond *.myeye *.refeye != *.eyef 40 > *.refbody 10 > *.refnrg 1000 > start -6 .shoot store stop
'Share cache locs/save shared locs cond *.code9 0 = start *.cachex1 *.cachey1 mult 0 != *.cachex1 .out1 store *.cachey1 .out2 store *.cachex2 *.cachey2 mult 0 != *.cachex2 .out3 store *.cachey2 .out4 store *.cachex3 *.cachey3 mult 0 != *.cachex3 .out5 store *.cachey3 .out6 store clearbool *.cachex1 *.cachey1 mult 0 = *.in1 .cachex1 store *.in2 .cachey1 store *.cachex2 *.cachey2 mult 0 = *.in3 .cachex2 store *.in4 .cachey2 store *.cachex3 *.cachey3 mult 0 = *.in5 .cachex3 store *.in6 .cachey3 store stop
'Clear cache locs if there is nothing there cond *.eyef 0 = *.xpos *.tcx 10 %= *.ypos *.tcy 10 %= start 25 .dn store *.tempcache 1 = 0 .cachex1 store 0 .cachey1 store *.tempcache 2 = 0 .cachex2 store 0 .cachey2 store *.tempcache 3 = 0 .cachex3 store 0 .cachey3 store stop
'Set Code 9 when nrg gets too low cond *.nrg 100 < start .code9 inc stop else 0 .code9 store stop
'Choose a cache start *.cachex1 0 != *.cachey1 0 != *.cachex2 0 != *.cachey2 0 != *.cachex3 0 != *.cachey3 0 != 1 3 rnd .tempcache store *.tempcache 0 = *.tempcache inc *.tempcache 4 = 1 *.tempcache store stop
'Head towards the chosen cache cond *.tempcache 0 != start *.tempcache 1 = *.cachex1 .tcx store *.cachey1 .tcy store *.tempcache 2 = *.cachex2 .tcx store *.cachey2 .tcy store *.tempcache 3 = *.cachex3 .tcx store *.cachey3 .tcy store clearbool *.tcx *.tcy angle .setaim store *.tcx *.tcy dist .up store stop
'Turn towards everything start *.eyef 0 != *.myeye *.refeye != *.eyef 39 > *.refxpos *.refypos angle .setaim store stop
'Repro start *.code9 0 != *.nrg 2300 >= *.body 100 >= 15 .repro store stop