Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - goffrie

Pages: 1 2 [3] 4 5
31
Interesting behaviour bots / Hive 0.4
« on: May 26, 2008, 05:07:35 PM »
I fixed a rather stupid bug in this version - the conspec was not working correctly for the scouts. Post edited.

32
Interesting behaviour bots / Hive 0.4
« on: May 25, 2008, 10:15:21 PM »
In this version, I implemented a simple scout which finds veggies and drags them within 3200 units of the hive, then fixes them there. I also have various improvements such as a dynamically scaling queen probability (about body/32000 chance) as well as scout probability. I did not manage to implement the "look around" feature I was talking about, but it isn't the most important thing.

DB code:
Code: [Select]
'PyHive0.4.txt compiled by PyBot V2 from PyHive0.4.pyr.
def hivexpos 971
def hiveypos 972
def status 973
def queen 974
def conspec 975
def look 51
def counter 52
def return 53
def cc 54
def seen 55
def v1 57
def v2 58
def v3 59
def v4 60
def v5 61
def v6 62
def v7 63
def v8 64
def v9 65
def x1 66
def x2 67
def x3 68
def x4 69
def x5 70
def x6 71
def x7 72
def x8 73
def x9 74
def y1 75
def y2 76
def y3 77
def y4 78
def y5 79
def y6 80
def y7 81
def y8 82
def y9 83
def c1 84
def c2 85
def c3 86
def c4 87
def c5 88
def c6 89
def c7 90
def c8 91
def c9 92
cond
*.status 0 =
start
*.refveldx dup *.dx != .dx store
*.refvelup 30 add dup *.up != .up store
*.robage 0 =
1 dupbool dup *.timer != and .timer store dropbool
dropbool *.eye5 45 >
-1 dupbool dup *.shoot != and .shoot store dropbool
8 dupbool dup *.shootval != and .shootval store dropbool
*.refvelup dupbool dup *.up != and .up store dropbool
dropbool *.eye5 0 >
1 dupbool dup *.timer != and .timer store dropbool
*.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
dupbool not dupbool *.eye6 0 > and
34 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye4 0 > and
-34 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye7 0 > and
69 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye3 0 > and
-69 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye8 0 > and
104 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye2 0 > and
-104 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye9 0 > and
139 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye1 0 > and
-139 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.timer 10 < and
314 dupbool dup *.aimdx != and .aimdx store dropbool
not and not or not  
628 *.timer div dupbool dup *.aimdx != and .aimdx store dropbool
dropbool *.waste 1000 >
-4 dupbool dup *.shoot != and .shoot store dropbool
*.waste dupbool dup *.shootval != and .shootval store dropbool
dropbool *.nrg 25000 > *.body 6000 > and
32000 rnd dupbool dup *.conspec != and .conspec store dropbool
*.conspec dupbool dup *.out5 != and .out5 store dropbool
*.conspec dupbool dup *.tout5 != and .tout5 store dropbool
*.xpos dupbool dup *.hivexpos != and .hivexpos store dropbool
*.ypos dupbool dup *.hiveypos != and .hiveypos store dropbool
.status inc
.fixpos inc
dropbool
stop
 
cond
false
start
*.eye5 *.eye6 =
*.eye7 dupbool dup *.up != and .up store dropbool
dropbool
stop
 
cond
*.robage 0 = *.status 1 = and
start
*.queen rnd 0 = *.hivexpos 0 = or *.hiveypos 0 = or
0 dupbool dup *.queen != and .queen store dropbool
dupbool not dupbool *.queen 2 div rnd 0 = and
3 dupbool dup *.status != and .status store dropbool
not and not or not  
2 dupbool dup *.status != and .status store dropbool
dropbool
*.conspec dup *.out5 != .out5 store
*.conspec dup *.tout5 != .tout5 store
stop
 
cond
*.status 1 =
start
*.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.seen 0 = and *.refeye *.myeye = and
*.refkills 1 add dupbool dup *.seen != and .seen store dropbool
dupbool not dupbool *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.seen *.refkills 1 add = and *.refeye *.myeye = and and
0 dupbool dup *.seen != and .seen store dropbool
.tie inc
not and not or not  
0 dupbool dup *.seen != and .seen store dropbool
dropbool
-34 dup *.eye5width != .eye5width store
50 dup *.sharenrg != .sharenrg store
.tieang1 dec
.tieang2 dec
.tieang3 dec
.tieang4 dec
1 dup *.fixpos != .fixpos store
*.waste 500 >
-4 dupbool dup *.shoot != and .shoot store dropbool
*.waste dupbool dup *.shootval != and .shootval store dropbool
1256 rnd dupbool dup *.aimshot != and .aimshot store dropbool
dropbool *.body 2000 > *.nrg 31000 < and
1000 dupbool dup *.fdbody != and .fdbody store dropbool
dropbool *.body 2000 < *.nrg 10000 > and
1000 dupbool dup *.strbody != and .strbody store dropbool
dropbool *.nrg 25000 >
dupbool dupbool *.shell 30000 < and
300 dupbool dup *.mkshell != and .mkshell store dropbool
dropbool dropbool dupbool dupbool *.poison 30000 < and
300 dupbool dup *.strpoison != and .strpoison store dropbool
dropbool dropbool
dropbool
*.shoot dup *.ploc != .ploc store
*.robage 5 > *.hivexpos *.xpos = and *.hiveypos *.ypos = and
50 dupbool dup *.aimdx != and .aimdx store dropbool
dupbool dupbool *.nrg 10000 > *.body 1000 > and *.eye5 35 < and and
32000 *.body div dupbool dup *.queen != and .queen store dropbool
10 *.body 1000 div add dupbool dup *.repro != and .repro store dropbool
dropbool dropbool
dropbool
*.xpos dup *.hivexpos != .hivexpos store
*.ypos dup *.hiveypos != .hiveypos store
stop
 
cond
*.status 2 = *.return 0 = and
start
*.robage 0 =
.tie inc
.mkshell dupbool dup *.vloc != and .vloc store dropbool
.shoot dupbool dup *.ploc != and .ploc store dropbool
2 dupbool dup *.delgene != and .delgene store dropbool
1 rnd 2 mult 1 sub 2 mult dupbool dup *.cc != and .cc store dropbool
420 dupbool dup *.eye1dir != and .eye1dir store dropbool
315 dupbool dup *.eye2dir != and .eye2dir store dropbool
210 dupbool dup *.eye3dir != and .eye3dir store dropbool
105 dupbool dup *.eye4dir != and .eye4dir store dropbool
-105 dupbool dup *.eye6dir != and .eye6dir store dropbool
-210 dupbool dup *.eye7dir != and .eye7dir store dropbool
-315 dupbool dup *.eye8dir != and .eye8dir store dropbool
-420 dupbool dup *.eye9dir != and .eye9dir store dropbool
105 dupbool dup *.eye1width != and .eye1width store dropbool
105 dupbool dup *.eye2width != and .eye2width store dropbool
105 dupbool dup *.eye3width != and .eye3width store dropbool
105 dupbool dup *.eye4width != and .eye4width store dropbool
105 dupbool dup *.eye5width != and .eye5width store dropbool
105 dupbool dup *.eye6width != and .eye6width store dropbool
105 dupbool dup *.eye7width != and .eye7width store dropbool
105 dupbool dup *.eye8width != and .eye8width store dropbool
105 dupbool dup *.eye9width != and .eye9width store dropbool
dropbool *.numties 0 >
*.tiepres dupbool dup *.deltie != and .deltie store dropbool
dropbool *.v1 *.timer >
-1 dupbool dup *.v1 != and .v1 store dropbool
0 dupbool dup *.c1 != and .c1 store dropbool
dropbool *.v2 *.timer >
-1 dupbool dup *.v2 != and .v2 store dropbool
0 dupbool dup *.c2 != and .c2 store dropbool
dropbool *.v3 *.timer >
-1 dupbool dup *.v3 != and .v3 store dropbool
0 dupbool dup *.c3 != and .c3 store dropbool
dropbool *.v4 *.timer >
-1 dupbool dup *.v4 != and .v4 store dropbool
0 dupbool dup *.c4 != and .c4 store dropbool
dropbool *.v5 *.timer >
-1 dupbool dup *.v5 != and .v5 store dropbool
0 dupbool dup *.c5 != and .c5 store dropbool
dropbool *.v6 *.timer >
-1 dupbool dup *.v6 != and .v6 store dropbool
0 dupbool dup *.c6 != and .c6 store dropbool
dropbool *.v7 *.timer >
-1 dupbool dup *.v7 != and .v7 store dropbool
0 dupbool dup *.c7 != and .c7 store dropbool
dropbool *.v8 *.timer >
-1 dupbool dup *.v8 != and .v8 store dropbool
0 dupbool dup *.c8 != and .c8 store dropbool
dropbool *.v9 *.timer >
-1 dupbool dup *.v9 != and .v9 store dropbool
0 dupbool dup *.c9 != and .c9 store dropbool
dropbool *.focuseye 0 = *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or not and *.eyef 0 > and
*.refveldx dupbool dup *.dx != and .dx store dropbool
*.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
dupbool dupbool *.eyef 40 > and
8 dupbool dup *.shootval != and .shootval store dropbool
dupbool dupbool *.refeye 0 = and
-1 dupbool dup *.shoot != and .shoot store dropbool
not and not dupbool not dupbool *.venom 30 >= *.refshell 100 > and and
-3 dupbool dup *.shoot != and .shoot store dropbool
30 dupbool dup *.shootval != and .shootval store dropbool
not and not or not  
-6 dupbool dup *.shoot != and .shoot store dropbool
dropbool
*.refvelup dupbool dup *.up != and .up store dropbool
not and  
*.refvelup 40 add dupbool dup *.up != and .up store dropbool
dropbool
not  
dupbool dupbool *.hivexpos *.hiveypos dist 1600 < and
*.hivexpos *.hiveypos angle 628 add dupbool dup *.setaim != and .setaim store dropbool
not and  
*.cc dupbool dup *.aimdx != and .aimdx store dropbool
dropbool
10 dupbool dup *.up != and .up store dropbool
dupbool dupbool *.eyef 0 > and
dupbool dupbool *.v1 *.v2 <= *.v1 *.v3 <= and *.v1 *.v4 <= and *.v1 *.v5 <= and *.v1 *.v6 <= and *.v1 *.v7 <= and *.v1 *.v8 <= and *.v1 *.v9 <= and and
*.timer dupbool dup *.v1 != and .v1 store dropbool
*.refxpos dupbool dup *.x1 != and .x1 store dropbool
*.refypos dupbool dup *.y1 != and .y1 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c1 != and .c1 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c1 != and .c1 store dropbool
not and not or not  
3 dupbool dup *.c1 != and .c1 store dropbool
dropbool
not and not dupbool not dupbool *.v2 *.v1 <= *.v2 *.v3 <= and *.v2 *.v4 <= and *.v2 *.v5 <= and *.v2 *.v6 <= and *.v2 *.v7 <= and *.v2 *.v8 <= and *.v2 *.v9 <= and and
*.timer dupbool dup *.v2 != and .v2 store dropbool
*.refxpos dupbool dup *.x2 != and .x2 store dropbool
*.refypos dupbool dup *.y2 != and .y2 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c2 != and .c2 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c2 != and .c2 store dropbool
not and not or not  
3 dupbool dup *.c2 != and .c2 store dropbool
dropbool
not and dupbool *.v3 *.v1 <= *.v3 *.v2 <= and *.v3 *.v4 <= and *.v3 *.v5 <= and *.v3 *.v6 <= and *.v3 *.v7 <= and *.v3 *.v8 <= and *.v3 *.v9 <= and and
*.timer dupbool dup *.v3 != and .v3 store dropbool
*.refxpos dupbool dup *.x3 != and .x3 store dropbool
*.refypos dupbool dup *.y3 != and .y3 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c3 != and .c3 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c3 != and .c3 store dropbool
not and not or not  
3 dupbool dup *.c3 != and .c3 store dropbool
dropbool
not and dupbool *.v4 *.v1 <= *.v4 *.v2 <= and *.v4 *.v3 <= and *.v4 *.v5 <= and *.v4 *.v6 <= and *.v4 *.v7 <= and *.v4 *.v8 <= and *.v4 *.v9 <= and and
*.timer dupbool dup *.v4 != and .v4 store dropbool
*.refxpos dupbool dup *.x4 != and .x4 store dropbool
*.refypos dupbool dup *.y4 != and .y4 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c4 != and .c4 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c4 != and .c4 store dropbool
not and not or not  
3 dupbool dup *.c4 != and .c4 store dropbool
dropbool
not and dupbool *.v5 *.v1 <= *.v5 *.v2 <= and *.v5 *.v3 <= and *.v5 *.v4 <= and *.v5 *.v6 <= and *.v5 *.v7 <= and *.v5 *.v8 <= and *.v5 *.v9 <= and and
*.timer dupbool dup *.v5 != and .v5 store dropbool
*.refxpos dupbool dup *.x5 != and .x5 store dropbool
*.refypos dupbool dup *.y5 != and .y5 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c5 != and .c5 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c5 != and .c5 store dropbool
not and not or not  
3 dupbool dup *.c5 != and .c5 store dropbool
dropbool
not and dupbool *.v6 *.v1 <= *.v6 *.v2 <= and *.v6 *.v3 <= and *.v6 *.v4 <= and *.v6 *.v5 <= and *.v6 *.v7 <= and *.v6 *.v8 <= and *.v6 *.v9 <= and and
*.timer dupbool dup *.v6 != and .v6 store dropbool
*.refxpos dupbool dup *.x6 != and .x6 store dropbool
*.refypos dupbool dup *.y6 != and .y6 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c6 != and .c6 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c6 != and .c6 store dropbool
not and not or not  
3 dupbool dup *.c6 != and .c6 store dropbool
dropbool
not and dupbool *.v7 *.v1 <= *.v7 *.v2 <= and *.v7 *.v3 <= and *.v7 *.v4 <= and *.v7 *.v5 <= and *.v7 *.v6 <= and *.v7 *.v8 <= and *.v7 *.v9 <= and and
*.timer dupbool dup *.v7 != and .v7 store dropbool
*.refxpos dupbool dup *.x7 != and .x7 store dropbool
*.refypos dupbool dup *.y7 != and .y7 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c7 != and .c7 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c7 != and .c7 store dropbool
not and not or not  
3 dupbool dup *.c7 != and .c7 store dropbool
dropbool
not and dupbool *.v8 *.v1 <= *.v8 *.v2 <= and *.v8 *.v3 <= and *.v8 *.v4 <= and *.v8 *.v5 <= and *.v8 *.v6 <= and *.v8 *.v7 <= and *.v8 *.v9 <= and and
*.timer dupbool dup *.v8 != and .v8 store dropbool
*.refxpos dupbool dup *.x8 != and .x8 store dropbool
*.refypos dupbool dup *.y8 != and .y8 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c8 != and .c8 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c8 != and .c8 store dropbool
not and not or not  
3 dupbool dup *.c8 != and .c8 store dropbool
dropbool
not and dupbool *.v9 *.v1 <= *.v9 *.v2 <= and *.v9 *.v3 <= and *.v9 *.v4 <= and *.v9 *.v5 <= and *.v9 *.v6 <= and *.v9 *.v7 <= and *.v9 *.v8 <= and and
*.timer dupbool dup *.v9 != and .v9 store dropbool
*.refxpos dupbool dup *.x9 != and .x9 store dropbool
*.refypos dupbool dup *.y9 != and .y9 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c9 != and .c9 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c9 != and .c9 store dropbool
not and not or not  
3 dupbool dup *.c9 != and .c9 store dropbool
dropbool
dropbool dropbool dropbool
dropbool dropbool dupbool dupbool *.x1 *.y1 dist 1200 < *.c1 3 = and *.timer *.v1 sub *.timer *.v2 sub <= and *.timer *.v1 sub *.timer *.v3 sub <= and *.timer *.v1 sub *.timer *.v4 sub <= and *.timer *.v1 sub *.timer *.v5 sub <= and *.timer *.v1 sub *.timer *.v6 sub <= and *.timer *.v1 sub *.timer *.v7 sub <= and *.timer *.v1 sub *.timer *.v8 sub <= and *.timer *.v1 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x1 *.y1 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c1 != and .c1 store dropbool
not and not dupbool not dupbool *.x2 *.y2 dist 1200 < *.c2 3 = and *.timer *.v2 sub *.timer *.v1 sub <= and *.timer *.v2 sub *.timer *.v3 sub <= and *.timer *.v2 sub *.timer *.v4 sub <= and *.timer *.v2 sub *.timer *.v5 sub <= and *.timer *.v2 sub *.timer *.v6 sub <= and *.timer *.v2 sub *.timer *.v7 sub <= and *.timer *.v2 sub *.timer *.v8 sub <= and *.timer *.v2 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x2 *.y2 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c2 != and .c2 store dropbool
not and dupbool *.x3 *.y3 dist 1200 < *.c3 3 = and *.timer *.v3 sub *.timer *.v1 sub <= and *.timer *.v3 sub *.timer *.v2 sub <= and *.timer *.v3 sub *.timer *.v4 sub <= and *.timer *.v3 sub *.timer *.v5 sub <= and *.timer *.v3 sub *.timer *.v6 sub <= and *.timer *.v3 sub *.timer *.v7 sub <= and *.timer *.v3 sub *.timer *.v8 sub <= and *.timer *.v3 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x3 *.y3 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c3 != and .c3 store dropbool
not and dupbool *.x4 *.y4 dist 1200 < *.c4 3 = and *.timer *.v4 sub *.timer *.v1 sub <= and *.timer *.v4 sub *.timer *.v2 sub <= and *.timer *.v4 sub *.timer *.v3 sub <= and *.timer *.v4 sub *.timer *.v5 sub <= and *.timer *.v4 sub *.timer *.v6 sub <= and *.timer *.v4 sub *.timer *.v7 sub <= and *.timer *.v4 sub *.timer *.v8 sub <= and *.timer *.v4 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x4 *.y4 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c4 != and .c4 store dropbool
not and dupbool *.x5 *.y5 dist 1200 < *.c5 3 = and *.timer *.v5 sub *.timer *.v1 sub <= and *.timer *.v5 sub *.timer *.v2 sub <= and *.timer *.v5 sub *.timer *.v3 sub <= and *.timer *.v5 sub *.timer *.v4 sub <= and *.timer *.v5 sub *.timer *.v6 sub <= and *.timer *.v5 sub *.timer *.v7 sub <= and *.timer *.v5 sub *.timer *.v8 sub <= and *.timer *.v5 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x5 *.y5 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c5 != and .c5 store dropbool
not and dupbool *.x6 *.y6 dist 1200 < *.c6 3 = and *.timer *.v6 sub *.timer *.v1 sub <= and *.timer *.v6 sub *.timer *.v2 sub <= and *.timer *.v6 sub *.timer *.v3 sub <= and *.timer *.v6 sub *.timer *.v4 sub <= and *.timer *.v6 sub *.timer *.v5 sub <= and *.timer *.v6 sub *.timer *.v7 sub <= and *.timer *.v6 sub *.timer *.v8 sub <= and *.timer *.v6 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x6 *.y6 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c6 != and .c6 store dropbool
not and dupbool *.x7 *.y7 dist 1200 < *.c7 3 = and *.timer *.v7 sub *.timer *.v1 sub <= and *.timer *.v7 sub *.timer *.v2 sub <= and *.timer *.v7 sub *.timer *.v3 sub <= and *.timer *.v7 sub *.timer *.v4 sub <= and *.timer *.v7 sub *.timer *.v5 sub <= and *.timer *.v7 sub *.timer *.v6 sub <= and *.timer *.v7 sub *.timer *.v8 sub <= and *.timer *.v7 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x7 *.y7 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c7 != and .c7 store dropbool
not and dupbool *.x8 *.y8 dist 1200 < *.c8 3 = and *.timer *.v8 sub *.timer *.v1 sub <= and *.timer *.v8 sub *.timer *.v2 sub <= and *.timer *.v8 sub *.timer *.v3 sub <= and *.timer *.v8 sub *.timer *.v4 sub <= and *.timer *.v8 sub *.timer *.v5 sub <= and *.timer *.v8 sub *.timer *.v6 sub <= and *.timer *.v8 sub *.timer *.v7 sub <= and *.timer *.v8 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x8 *.y8 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c8 != and .c8 store dropbool
not and dupbool *.x9 *.y9 dist 1200 < *.c9 3 = and *.timer *.v9 sub *.timer *.v1 sub <= and *.timer *.v9 sub *.timer *.v2 sub <= and *.timer *.v9 sub *.timer *.v3 sub <= and *.timer *.v9 sub *.timer *.v4 sub <= and *.timer *.v9 sub *.timer *.v5 sub <= and *.timer *.v9 sub *.timer *.v6 sub <= and *.timer *.v9 sub *.timer *.v7 sub <= and *.timer *.v9 sub *.timer *.v8 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x9 *.y9 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c9 != and .c9 store dropbool
not and dupbool *.x1 *.y1 dist 1200 < *.c1 1 = and *.timer *.v1 sub *.timer *.v2 sub <= and *.timer *.v1 sub *.timer *.v3 sub <= and *.timer *.v1 sub *.timer *.v4 sub <= and *.timer *.v1 sub *.timer *.v5 sub <= and *.timer *.v1 sub *.timer *.v6 sub <= and *.timer *.v1 sub *.timer *.v7 sub <= and *.timer *.v1 sub *.timer *.v8 sub <= and *.timer *.v1 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x1 *.y1 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c1 != and .c1 store dropbool
not and dupbool *.x2 *.y2 dist 1200 < *.c2 1 = and *.timer *.v2 sub *.timer *.v1 sub <= and *.timer *.v2 sub *.timer *.v3 sub <= and *.timer *.v2 sub *.timer *.v4 sub <= and *.timer *.v2 sub *.timer *.v5 sub <= and *.timer *.v2 sub *.timer *.v6 sub <= and *.timer *.v2 sub *.timer *.v7 sub <= and *.timer *.v2 sub *.timer *.v8 sub <= and *.timer *.v2 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x2 *.y2 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c2 != and .c2 store dropbool
not and dupbool *.x3 *.y3 dist 1200 < *.c3 1 = and *.timer *.v3 sub *.timer *.v1 sub <= and *.timer *.v3 sub *.timer *.v2 sub <= and *.timer *.v3 sub *.timer *.v4 sub <= and *.timer *.v3 sub *.timer *.v5 sub <= and *.timer *.v3 sub *.timer *.v6 sub <= and *.timer *.v3 sub *.timer *.v7 sub <= and *.timer *.v3 sub *.timer *.v8 sub <= and *.timer *.v3 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x3 *.y3 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c3 != and .c3 store dropbool
not and dupbool *.x4 *.y4 dist 1200 < *.c4 1 = and *.timer *.v4 sub *.timer *.v1 sub <= and *.timer *.v4 sub *.timer *.v2 sub <= and *.timer *.v4 sub *.timer *.v3 sub <= and *.timer *.v4 sub *.timer *.v5 sub <= and *.timer *.v4 sub *.timer *.v6 sub <= and *.timer *.v4 sub *.timer *.v7 sub <= and *.timer *.v4 sub *.timer *.v8 sub <= and *.timer *.v4 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x4 *.y4 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c4 != and .c4 store dropbool
not and dupbool *.x5 *.y5 dist 1200 < *.c5 1 = and *.timer *.v5 sub *.timer *.v1 sub <= and *.timer *.v5 sub *.timer *.v2 sub <= and *.timer *.v5 sub *.timer *.v3 sub <= and *.timer *.v5 sub *.timer *.v4 sub <= and *.timer *.v5 sub *.timer *.v6 sub <= and *.timer *.v5 sub *.timer *.v7 sub <= and *.timer *.v5 sub *.timer *.v8 sub <= and *.timer *.v5 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x5 *.y5 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c5 != and .c5 store dropbool
not and dupbool *.x6 *.y6 dist 1200 < *.c6 1 = and *.timer *.v6 sub *.timer *.v1 sub <= and *.timer *.v6 sub *.timer *.v2 sub <= and *.timer *.v6 sub *.timer *.v3 sub <= and *.timer *.v6 sub *.timer *.v4 sub <= and *.timer *.v6 sub *.timer *.v5 sub <= and *.timer *.v6 sub *.timer *.v7 sub <= and *.timer *.v6 sub *.timer *.v8 sub <= and *.timer *.v6 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x6 *.y6 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c6 != and .c6 store dropbool
not and dupbool *.x7 *.y7 dist 1200 < *.c7 1 = and *.timer *.v7 sub *.timer *.v1 sub <= and *.timer *.v7 sub *.timer *.v2 sub <= and *.timer *.v7 sub *.timer *.v3 sub <= and *.timer *.v7 sub *.timer *.v4 sub <= and *.timer *.v7 sub *.timer *.v5 sub <= and *.timer *.v7 sub *.timer *.v6 sub <= and *.timer *.v7 sub *.timer *.v8 sub <= and *.timer *.v7 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x7 *.y7 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c7 != and .c7 store dropbool
not and dupbool *.x8 *.y8 dist 1200 < *.c8 1 = and *.timer *.v8 sub *.timer *.v1 sub <= and *.timer *.v8 sub *.timer *.v2 sub <= and *.timer *.v8 sub *.timer *.v3 sub <= and *.timer *.v8 sub *.timer *.v4 sub <= and *.timer *.v8 sub *.timer *.v5 sub <= and *.timer *.v8 sub *.timer *.v6 sub <= and *.timer *.v8 sub *.timer *.v7 sub <= and *.timer *.v8 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x8 *.y8 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c8 != and .c8 store dropbool
not and dupbool *.x9 *.y9 dist 1200 < *.c9 1 = and *.timer *.v9 sub *.timer *.v1 sub <= and *.timer *.v9 sub *.timer *.v2 sub <= and *.timer *.v9 sub *.timer *.v3 sub <= and *.timer *.v9 sub *.timer *.v4 sub <= and *.timer *.v9 sub *.timer *.v5 sub <= and *.timer *.v9 sub *.timer *.v6 sub <= and *.timer *.v9 sub *.timer *.v7 sub <= and *.timer *.v9 sub *.timer *.v8 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x9 *.y9 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c9 != and .c9 store dropbool
not and dupbool *.eye2 0 > *.focuseye -3 < and and
-3 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye3 0 > *.focuseye -2 < and and
-2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye4 0 > *.focuseye -1 < and and
-1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye5 0 > *.focuseye 0 < and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye6 0 > *.focuseye 1 < and and
1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye7 0 > *.focuseye 2 < and and
2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye8 0 > *.focuseye 3 < and and
3 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye9 0 > *.focuseye 4 < and and
4 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye1 0 > and
-4 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye2 0 > and
-3 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye3 0 > and
-2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye4 0 > and
-1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye5 0 > and
0 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye6 0 > and
1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye7 0 > and
2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye8 0 > and
3 dupbool dup *.focuseye != and .focuseye store dropbool
not and not or not  
8 rnd 4 sub dupbool dup *.focuseye != and .focuseye store dropbool
dropbool
dropbool *.body 800 < *.nrg 15000 > and
500 dupbool dup *.strbody != and .strbody store dropbool
dropbool *.body 800 > *.nrg 30000 < and
500 dupbool dup *.fdbody != and .fdbody store dropbool
dropbool *.nrg 10000 > *.venom 1000 < and
200 dupbool dup *.strvenom != and .strvenom store dropbool
dropbool *.fixed 0 !=
.fixpos dec
dropbool *.shflav -1 = *.refeye 0 = *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or or and *.poison 500 < and
500 *.poison sub dupbool dup *.strpoison != and .strpoison store dropbool
dropbool *.shflav -6 = *.refeye 0 = *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or or and *.shell 500 < and
500 *.shell sub dupbool dup *.mkshell != and .mkshell store dropbool
dropbool
0 dup *.shflav != .shflav store
*.waste 1000 > *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or not and
-4 dupbool dup *.shoot != and .shoot store dropbool
*.waste dupbool dup *.shootval != and .shootval store dropbool
dropbool *.nrg 30000 >= *.body 800 >= and
.return inc
dropbool
stop
 
cond
*.status 2 = *.shflav 0 != and *.shflav -2 != and *.return 0 != and
start
0 dup *.return != .return store
*.shell 500 <
500 *.shell sub dupbool dup *.mkshell != and .mkshell store dropbool
dropbool
500 dup *.strpoison != .strpoison store
stop
 
cond
*.status 2 = *.return 0 != and
start
*.nrg 10000 <
0 dupbool dup *.return != and .return store dropbool
dropbool *.eye5 0 = *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and not or
*.hivexpos *.hiveypos angle dupbool dup *.setaim != and .setaim store dropbool
30 *.velup sub 0 ceil 30 floor dupbool dup *.up != and .up store dropbool
dropbool *.eye5 35 < *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and and
*.refvelup 40 add dupbool dup *.up != and .up store dropbool
*.refveldx dupbool dup *.dx != and .dx store dropbool
dropbool *.eye5 35 >= *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and and
-2 dupbool dup *.shoot != and .shoot store dropbool
1000 dupbool dup *.shootval != and .shootval store dropbool
dupbool dupbool *.refxpos 0 != *.refypos 0 != and and
*.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
*.refxpos dupbool dup *.hivexpos != and .hivexpos store dropbool
*.refypos dupbool dup *.hiveypos != and .hiveypos store dropbool
dropbool dropbool
*.refvelup dupbool dup *.up != and .up store dropbool
*.refveldx dupbool dup *.dx != and .dx store dropbool
dropbool *.numties 0 >
*.tiepres dupbool dup *.deltie != and .deltie store dropbool
dropbool *.hivexpos *.hiveypos dist 200 <
.counter inc
not  
0 dupbool dup *.counter != and .counter store dropbool
dropbool *.counter 600 >
1 dupbool dup *.status != and .status store dropbool
dropbool
0 dup *.focuseye != .focuseye store
stop
 
cond
*.status 3 =
start
*.robage 0 =
2 dupbool dup *.delgene != and .delgene store dropbool
1 rnd 2 mult 1 sub 2 mult dupbool dup *.cc != and .cc store dropbool
420 dupbool dup *.eye1dir != and .eye1dir store dropbool
315 dupbool dup *.eye2dir != and .eye2dir store dropbool
210 dupbool dup *.eye3dir != and .eye3dir store dropbool
105 dupbool dup *.eye4dir != and .eye4dir store dropbool
-105 dupbool dup *.eye6dir != and .eye6dir store dropbool
-210 dupbool dup *.eye7dir != and .eye7dir store dropbool
-315 dupbool dup *.eye8dir != and .eye8dir store dropbool
-420 dupbool dup *.eye9dir != and .eye9dir store dropbool
105 dupbool dup *.eye1width != and .eye1width store dropbool
105 dupbool dup *.eye2width != and .eye2width store dropbool
105 dupbool dup *.eye3width != and .eye3width store dropbool
105 dupbool dup *.eye4width != and .eye4width store dropbool
105 dupbool dup *.eye5width != and .eye5width store dropbool
105 dupbool dup *.eye6width != and .eye6width store dropbool
105 dupbool dup *.eye7width != and .eye7width store dropbool
105 dupbool dup *.eye8width != and .eye8width store dropbool
105 dupbool dup *.eye9width != and .eye9width store dropbool
31998 rnd 2 add dupbool dup *.seen != and .seen store dropbool
.tie inc
.numties dupbool dup *.memloc != and .memloc store dropbool
dropbool
0 dup *.fixpos != .fixpos store
*.numties 0 =
dupbool dupbool *.eyef 0 > *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or not and *.refxpos *.hivexpos sub *.refypos *.hiveypos sub pyth 3200 >= and *.memval 0 = and and
dupbool dupbool *.refkills 0 = *.refshoot 0 = and *.reftie 0 = and and
*.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.seen dupbool dup *.tie != and .tie store dropbool
*.seen dupbool dup *.tienum != and .tienum store dropbool
*.seen dupbool dup *.readtie != and .readtie store dropbool
.fixed dupbool dup *.tmemloc != and .tmemloc store dropbool
not and  
*.hivexpos *.hiveypos angle dupbool dup *.setaim != and .setaim store dropbool
30 dupbool dup *.up != and .up store dropbool
dropbool
not and not dupbool not dupbool *.eyef 0 > *.refeye *.status 1 sub sgn 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.in5 *.conspec = and or not and *.refkills 0 != *.refshoot 0 != or *.reftie 0 != or and and
*.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
-6 dupbool dup *.shoot != and .shoot store dropbool
8 dupbool dup *.shootval != and .shootval store dropbool
not and not or not  
dupbool dupbool *.hivexpos *.hiveypos dist 1600 < and
*.hivexpos *.hiveypos angle 628 add dupbool dup *.setaim != and .setaim store dropbool
not and  
*.cc dupbool dup *.aimdx != and .aimdx store dropbool
dropbool
10 dupbool dup *.up != and .up store dropbool
dupbool dupbool *.eye2 0 > *.focuseye -3 < and and
-3 dupbool dup *.focuseye != and .focuseye store dropbool
not and not dupbool not dupbool *.eye3 0 > *.focuseye -2 < and and
-2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye4 0 > *.focuseye -1 < and and
-1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye5 0 > *.focuseye 0 < and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye6 0 > *.focuseye 1 < and and
1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye7 0 > *.focuseye 2 < and and
2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye8 0 > *.focuseye 3 < and and
3 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye9 0 > *.focuseye 4 < and and
4 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye1 0 > and
-4 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye2 0 > and
-3 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye3 0 > and
-2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye4 0 > and
-1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye5 0 > and
0 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye6 0 > and
1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye7 0 > and
2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye8 0 > and
3 dupbool dup *.focuseye != and .focuseye store dropbool
not and not or not  
8 rnd 4 sub dupbool dup *.focuseye != and .focuseye store dropbool
dropbool
dropbool
dupbool not dupbool *.numties 1 = *.tiepres *.seen = and *.trefeye *.status 1 sub sgn 3 mult *.myeye add = *.tin5 *.conspec = and *.trefeye *.myeye 3 add *.status 1 sub sgn 3 mult sub = *.tin5 *.conspec = and or not and and
*.seen dupbool dup *.tienum != and .tienum store dropbool
*.seen dupbool dup *.readtie != and .readtie store dropbool
.fixed dupbool dup *.tmemloc != and .tmemloc store dropbool
dupbool dupbool *.nrg 4000 < *.nrg *.trefnrg add 2000 >= and *.multi 1 = and and
4000 100 mult *.nrg *.trefnrg add div 1 add dupbool dup *.sharenrg != and .sharenrg store dropbool
dropbool dropbool dupbool dupbool *.waste *.waste *.trefwaste add 100 div > and
1 dupbool dup *.sharewaste != and .sharewaste store dropbool
dropbool dropbool dupbool dupbool *.trefxpos *.hivexpos sub *.trefypos *.hiveypos sub pyth 3200 >= and
*.hivexpos *.hiveypos angle dupbool dup *.setaim != and .setaim store dropbool
dupbool dupbool *.multi 1 = and
*.velsx dupbool dup *.dx != and .dx store dropbool
*.veldn 45 add dupbool dup *.up != and .up store dropbool
not and  
1 dupbool dup *.fixpos != and .fixpos store dropbool
dropbool dupbool dupbool *.tmemval 0 != and
.fixpos dupbool dup *.tieloc != and .tieloc store dropbool
0 dupbool dup *.tieval != and .tieval store dropbool
dropbool dropbool
-10 dupbool dup *.fixang != and .fixang store dropbool
1 dupbool dup *.fixlen != and .fixlen store dropbool
not and  
dupbool dupbool *.tmemval 0 = and
.fixpos dupbool dup *.tieloc != and .tieloc store dropbool
1 dupbool dup *.tieval != and .tieval store dropbool
not and  
*.seen dupbool dup *.deltie != and .deltie store dropbool
dropbool
dropbool
not and not or not  
*.tiepres dupbool dup *.deltie != and .deltie store dropbool
dropbool *.body 300 >
500 dupbool dup *.fdbody != and .fdbody store dropbool
dup ^ inc
stop

PyBot code:
[code] #omit-original-code
  
  def hivexpos at 971
  def hiveypos at 972
  def status at 973 # 0 = initial, 1 = "queen", 2 = worker, 3 = scout
  def queen at 974 # 0 = normal, 1 = forced queen
  def conspec at 975 # conspec number
  def look at 51 # currently unused
  def counter at 52
  def return at 53
  def cc at 54
  def seen at 55
  
  # v(x) means cycle (timer) in which something was seen (not necessarily in eye (x))
  def v1 at 57
  def v2 at 58
  def v3 at 59
  def v4 at 60
  def v5 at 61
  def v6 at 62
  def v7 at 63
  def v8 at 64
  def v9 at 65
  
  # x(x) and y(x) mean the x and y positions of the "somethings" seen
  def x1 at 66
  def x2 at 67
  def x3 at 68
  def x4 at 69
  def x5 at 70
  def x6 at 71
  def x7 at 72
  def x8 at 73
  def x9 at 74
  
  def y1 at 75
  def y2 at 76
  def y3 at 77
  def y4 at 78
  def y5 at 79
  def y6 at 80
  def y7 at 81
  def y8 at 82
  def y9 at 83
  
  # c(x) means whether the seen bot was 0=nothing 1=veggy 2=conspec 3=enemy
  def c1 at 84
  def c2 at 85
  def c3 at 86
  def c4 at 87
  def c5 at 88
  def c6 at 89
  def c7 at 90
  def c8 at 91
  def c9 at 92
  
  define t1: (timer - v1)
  define t2: (timer - v2)
  define t3: (timer - v3)
  define t4: (timer - v4)
  define t5: (timer - v5)
  define t6: (timer - v6)
  define t7: (timer - v7)
  define t8: (timer - v8)
  define t9: (timer - v9)
  
  # define isqueen: (in5 == (timer - 1)
  # define isconspec: (in6 == (timer - 1))
  define isqueen: ((refeye == (sgn(status - 1) * 3 + myeye)) and (in5 == conspec))
  define isworker: ((refeye == (myeye + 3 - (sgn(status - 1) * 3))) and (in5 == conspec))
  define isconspec: (isqueen or isworker)
  
  define istqueen: ((trefeye == (sgn(status - 1) * 3 + myeye)) and (tin5 == conspec))
  define istworker: ((trefeye == (myeye + 3 - (sgn(status - 1) * 3))) and (tin5 == conspec))
  define istconspec: (istqueen or istworker)
  
  if (status == 0): # initial stage
      dx = refveldx # match velocity
      up = refvelup + 30 # catch up
      if (robage == 0):
          timer = 1
      if (eye5 > 45):
          shoot = -1
          shootval = 8
          up = refvelup # follow
      if (eye5 > 0):
          timer = 1
          setaim = angle(refxpos, refypos) # aim
      # rotation
      elif (eye6 > 0):
          aimdx = 34
      elif (eye4 > 0):
          aimdx = -34
      elif (eye7 > 0):
          aimdx = 69
      elif (eye3 > 0):
          aimdx = -69
      elif (eye8 > 0):
          aimdx = 104
      elif (eye2 > 0):
          aimdx = -104
      elif (eye9 > 0):
          aimdx = 139
      elif (eye1 > 0):
          aimdx = -139
      elif (timer < 10):
          # fast turning (to find enemies in range)
          aimdx = 314
      else:
          # slow turning (slows down)
          aimdx = 628 / timer
      if (waste > 1000):
          # eject waste
          shoot = -4
          shootval = waste
      if ((nrg > 25000) and (body > 6000)):
          # become a queen
          conspec = rnd 32000 # per-hive conspec
          out5 = conspec
          tout5 = conspec
          hivexpos = xpos
          hiveypos = ypos
          status++
          fixpos++
  
  if (false):
      # use a bunch of eye statements
      if (eye5 == eye6):
          up = eye7
  
  if ((robage == 0) and (status == 1)):
      if (((rnd queen) == 0) or (hivexpos == 0) or (hiveypos == 0)):
          # become a queen
          queen = 0
      elif (rnd(queen / 2) == 0):
          # become a scout
          status = 3
      else:
          # become a worker
          status = 2
      out5 = conspec
      tout5 = conspec
  
  if (status == 1):
      # queen actions
      if (isqueen and (seen == 0) and (refeye == myeye)):
          # queen conspec?
          seen = (refkills + 1)
      elif (isqueen and (seen == (refkills + 1)) and (refeye == myeye)):
          # queen conspec, tie
          seen = 0
          tie++
      else
          seen = 0
      # share energy around
      eye5width = -34
      sharenrg = 50
      # free rotation
      tieang1--
      tieang2--
      tieang3--
      tieang4--
      # stay fixed
      fixpos = 1
      if (waste > 500):
          # shoot waste
          shoot = -4
          shootval = waste
          aimshot = (rnd 1256) # random direction
      if ((body > 2000) and (nrg < 31000)):
          fdbody = 1000
      if ((body < 2000) and (nrg > 10000)):
          strbody = 1000
      if (nrg > 25000):
          # protection and energy "sink"
          # slowly create defences
          if (shell < 30000):
              mkshell = 300
          if (poison < 30000):
              strpoison = 300
      # poison inhibits shooting
      ploc = shoot
      if ((robage > 5) and (hivexpos == xpos) and (hiveypos == ypos)):
          aimdx = 50
          if ((nrg > 10000) and (body > 1000) and (eye5 < 35)):
              # reproduce normally
              # scale probability of becoming a queen or scout with amount of body
              queen = (32000 / body)
              # same with the size of the offspring
              repro = (10 + (body / 1000))
      # tell children where parent is
      hivexpos = xpos
      hiveypos = ypos
  
  if ((status == 2) and (return == 0)):
      # worker actions
      if (robage == 0):
          # initialization
          tie++ # replace birth tie
          vloc = &mkshell # venom removes shell
          ploc = &shoot # poison inhibits shooting
          delgene = 2 # delete some random eye statements to reduce myeye
          cc = ((rnd 1) * 2 - 1) * 2
          # 360 degree vision from Welwordion
          eye1dir = 420
          eye2dir = 315
          eye3dir = 210
          eye4dir = 105
          eye6dir = -105
          eye7dir = -210
          eye8dir = -315
          eye9dir = -420
          eye1width = 105
          eye2width = 105
          eye3width = 105
          eye4width = 105
          eye5width = 105
          eye6width = 105
          eye7width = 105
          eye8width = 105
          eye9width = 105
      
      if (numties > 0):
          # delete all ties
          deltie = tiepres
  
      # eye-based commands
      # remove eye values when timer overflows
      if (v1 > timer):
          v1 = -1
          c1 = 0
      if (v2 > timer):
          v2 = -1
          c2 = 0
      if (v3 > timer):
          v3 = -1
          c3 = 0
      if (v4 > timer):
          v4 = -1
          c4 = 0
      if (v5 > timer):
          v5 = -1
          c5 = 0
      if (v6 > timer):
          v6 = -1
          c6 = 0
      if (v7 > timer):
          v7 = -1
          c7 = 0
      if (v8 > timer):
          v8 = -1
          c8 = 0
      if (v9 > timer):
          v9 = -1
          c9 = 0
      if ((focuseye == 0) and !isconspec and (eyef > 0)):
          # follow
          dx = refveldx
          setaim = angle(refxpos, refypos)
          if (eyef > 40):
              shootval = 8
              if (refeye == 0):
                  shoot = -1
  #                if (look == 1):
  #                    look = 0 # looking is over
  #                    # don't move!
  #                    dx = 0
  #                    up = 0
  #                    aimdx = 0
  #                    setaim = aim
  #                else:
  #                    look = 1 # just looking around
  #                    focuseye = ((rnd 3) + 1) * ((rnd 1) * 2 - 1) # anything except 0
              elif ((venom >= 30) and (refshell > 100)):
                  shoot = -3
                  shootval = 30
              else
                  shoot = -6
              up = refvelup
          else:
              up = refvelup + 40
      else:
          if (dist(hivexpos, hiveypos) < 1600):
              setaim = angle(hivexpos, hiveypos) + 628
          else:
              aimdx = cc
          # drift
          up = 10
          if (eyef > 0):
              # fancy eye stuff - remember where things are
              if ((v1 <= v2) and (v1 <= v3) and (v1 <= v4) and (v1 <= v5) and (v1 <= v6) and (v1 <= v7) and (v1 <= v8) and (v1 <= v9)):
                  v1 = timer
                  x1 = refxpos
                  y1 = refypos
                  if (refeye == 0):

33
I would make an installer for the 2.4 series (with some simple example bots which actually work ) with NSIS but I don't know what goes on in the installer. Does anyone have any clue what things it sets up?

34
Interesting behaviour bots / Hive 0.3
« on: May 23, 2008, 07:22:22 PM »
Quote from: bacillus
A big improvement over your last version, well done. One of the key problems still seems to be that it creates a circle around the hive where absolutely no food is present; try put in some scouts to pull in and cultivate veggies.
Hmm, I hadn't thought of that. Thanks for the idea, an implementation is coming up
I might also want to scale the chance of being worker dynamically, as in sims with lots of veggies the hive quickly gets overloaded and energy starts being wasted.

35
Interesting behaviour bots / Hive 0.3
« on: May 23, 2008, 07:44:56 AM »
This is my new version of Hive, (yay generic names) which has new 360 degree vision in the workers and uses all 9 eyes in the initial queen. I added some complex (read: repetitive) code handling eye memory which is currently pretty much useless until I get around to the "look around code" (there is some commented out in the shoot gene which doesn't quite work) or if EricL adds in-cycle focuseye switching.

Also, bots now "drift" either clockwise or counterclockwise (determined at birth), to scour the whole map (hopefully). The code which changes workers to queens should also function properly now.

I have changed the conspec to a refeye based conspec plus a static out5/in5 mechanism but the queens STILL tie to workers and everything else. Changing the eye5width to -34 didn't help either but I left it in the code.

Same recommendations as before except that any size of grid larger than 32000x24000 is almost certain to screw up the worker code.
 
DB code:
Code: [Select]
'PyHive0.3.txt compiled by PyBot V2 from PyHive0.3.pyr.
def hivexpos 971
def hiveypos 972
def status 973
def queen 974
def conspec 975
def look 51
def counter 52
def return 53
def cc 54
def seen 55
def v1 57
def v2 58
def v3 59
def v4 60
def v5 61
def v6 62
def v7 63
def v8 64
def v9 65
def x1 66
def x2 67
def x3 68
def x4 69
def x5 70
def x6 71
def x7 72
def x8 73
def x9 74
def y1 75
def y2 76
def y3 77
def y4 78
def y5 79
def y6 80
def y7 81
def y8 82
def y9 83
def c1 84
def c2 85
def c3 86
def c4 87
def c5 88
def c6 89
def c7 90
def c8 91
def c9 92
cond
*.status 0 =
start
*.refveldx dup *.dx != .dx store
*.refvelup 30 add dup *.up != .up store
*.robage 0 =
1 dupbool dup *.timer != and .timer store dropbool
dropbool *.eye5 45 >
-1 dupbool dup *.shoot != and .shoot store dropbool
8 dupbool dup *.shootval != and .shootval store dropbool
*.refvelup dupbool dup *.up != and .up store dropbool
dropbool *.eye5 0 >
1 dupbool dup *.timer != and .timer store dropbool
*.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
dupbool not dupbool *.eye6 0 > and
34 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye4 0 > and
-34 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye7 0 > and
69 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye3 0 > and
-69 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye8 0 > and
104 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye2 0 > and
-104 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye9 0 > and
139 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.eye1 0 > and
-139 dupbool dup *.aimdx != and .aimdx store dropbool
not and dupbool *.timer 10 < and
314 dupbool dup *.aimdx != and .aimdx store dropbool
not and not or not
628 *.timer div dupbool dup *.aimdx != and .aimdx store dropbool
dropbool *.waste 1000 >
-4 dupbool dup *.shoot != and .shoot store dropbool
*.waste dupbool dup *.shootval != and .shootval store dropbool
dropbool *.nrg 25000 > *.body 6000 > and
32000 rnd dupbool dup *.conspec != and .conspec store dropbool
*.conspec dupbool dup *.out5 != and .out5 store dropbool
*.xpos dupbool dup *.hivexpos != and .hivexpos store dropbool
*.ypos dupbool dup *.hiveypos != and .hiveypos store dropbool
.status inc
.fixpos inc
dropbool
stop

cond
false
start
*.eye5 *.eye6 =
*.eye7 dupbool dup *.up != and .up store dropbool
dropbool
stop

cond
*.robage 0 = *.status 1 = and
start
20 rnd 0 = *.queen 1 = or *.hivexpos 0 = or *.hiveypos 0 = or
0 dupbool dup *.queen != and .queen store dropbool
not
2 dupbool dup *.status != and .status store dropbool
dropbool
*.conspec dup *.out5 != .out5 store
stop

cond
*.robage 0 > *.status 1 = and
start
*.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.seen 0 = and *.refeye *.myeye = and
*.refkills 1 add dupbool dup *.seen != and .seen store dropbool
dupbool not dupbool *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.seen *.refkills 1 add = and *.refeye *.myeye = and and
0 dupbool dup *.seen != and .seen store dropbool
.tie inc
not and not or not
0 dupbool dup *.seen != and .seen store dropbool
dropbool
-34 dup *.eye5width != .eye5width store
50 dup *.sharenrg != .sharenrg store
.tieang1 dec
.tieang2 dec
.tieang3 dec
.tieang4 dec
1 dup *.fixpos != .fixpos store
*.waste 50 >
-4 dupbool dup *.shoot != and .shoot store dropbool
*.waste dupbool dup *.shootval != and .shootval store dropbool
1256 rnd dupbool dup *.aimshot != and .aimshot store dropbool
dropbool *.body 2000 > *.nrg 31000 < and
1000 dupbool dup *.fdbody != and .fdbody store dropbool
dropbool *.body 2000 < *.nrg 10000 > and
1000 dupbool dup *.strbody != and .strbody store dropbool
dropbool *.nrg 25000 >
dupbool dupbool *.shell 30000 < and
300 dupbool dup *.mkshell != and .mkshell store dropbool
dropbool dropbool dupbool dupbool *.poison 30000 < and
300 dupbool dup *.strpoison != and .strpoison store dropbool
dropbool dropbool
dropbool
*.shoot dup *.ploc != .ploc store
*.robage 5 > *.hivexpos *.xpos = and *.hiveypos *.ypos = and
60 dupbool dup *.aimdx != and .aimdx store dropbool
dupbool dupbool *.body 20000 > *.nrg 20000 > and and
1 dupbool dup *.queen != and .queen store dropbool
50 dupbool dup *.repro != and .repro store dropbool
not and not dupbool not dupbool *.nrg 10000 > *.body 1000 > and *.eye5 35 < and and
0 dupbool dup *.queen != and .queen store dropbool
10 *.body 1000 div add dupbool dup *.repro != and .repro store dropbool
dropbool dropbool dropbool
dropbool
*.xpos dup *.hivexpos != .hivexpos store
*.ypos dup *.hiveypos != .hiveypos store
stop

cond
*.robage 0 > *.status 2 = and *.return 0 = and
start
*.robage 1 =
.tie inc
.mkshell dupbool dup *.vloc != and .vloc store dropbool
.shoot dupbool dup *.ploc != and .ploc store dropbool
2 dupbool dup *.delgene != and .delgene store dropbool
1 rnd 2 mult 1 sub 2 mult dupbool dup *.cc != and .cc store dropbool
420 dupbool dup *.eye1dir != and .eye1dir store dropbool
315 dupbool dup *.eye2dir != and .eye2dir store dropbool
210 dupbool dup *.eye3dir != and .eye3dir store dropbool
105 dupbool dup *.eye4dir != and .eye4dir store dropbool
-105 dupbool dup *.eye6dir != and .eye6dir store dropbool
-210 dupbool dup *.eye7dir != and .eye7dir store dropbool
-315 dupbool dup *.eye8dir != and .eye8dir store dropbool
-420 dupbool dup *.eye9dir != and .eye9dir store dropbool
105 dupbool dup *.eye1width != and .eye1width store dropbool
105 dupbool dup *.eye2width != and .eye2width store dropbool
105 dupbool dup *.eye3width != and .eye3width store dropbool
105 dupbool dup *.eye4width != and .eye4width store dropbool
105 dupbool dup *.eye5width != and .eye5width store dropbool
105 dupbool dup *.eye6width != and .eye6width store dropbool
105 dupbool dup *.eye7width != and .eye7width store dropbool
105 dupbool dup *.eye8width != and .eye8width store dropbool
105 dupbool dup *.eye9width != and .eye9width store dropbool
dropbool *.numties 0 >
*.tiepres dupbool dup *.deltie != and .deltie store dropbool
dropbool *.v1 *.timer >
-1 dupbool dup *.v1 != and .v1 store dropbool
0 dupbool dup *.c1 != and .c1 store dropbool
dropbool *.v2 *.timer >
-1 dupbool dup *.v2 != and .v2 store dropbool
0 dupbool dup *.c2 != and .c2 store dropbool
dropbool *.v3 *.timer >
-1 dupbool dup *.v3 != and .v3 store dropbool
0 dupbool dup *.c3 != and .c3 store dropbool
dropbool *.v4 *.timer >
-1 dupbool dup *.v4 != and .v4 store dropbool
0 dupbool dup *.c4 != and .c4 store dropbool
dropbool *.v5 *.timer >
-1 dupbool dup *.v5 != and .v5 store dropbool
0 dupbool dup *.c5 != and .c5 store dropbool
dropbool *.v6 *.timer >
-1 dupbool dup *.v6 != and .v6 store dropbool
0 dupbool dup *.c6 != and .c6 store dropbool
dropbool *.v7 *.timer >
-1 dupbool dup *.v7 != and .v7 store dropbool
0 dupbool dup *.c7 != and .c7 store dropbool
dropbool *.v8 *.timer >
-1 dupbool dup *.v8 != and .v8 store dropbool
0 dupbool dup *.c8 != and .c8 store dropbool
dropbool *.v9 *.timer >
-1 dupbool dup *.v9 != and .v9 store dropbool
0 dupbool dup *.c9 != and .c9 store dropbool
dropbool *.focuseye 0 = *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or not and *.eyef 0 > and
*.refveldx dupbool dup *.dx != and .dx store dropbool
*.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
dupbool dupbool *.eyef 40 > and
8 dupbool dup *.shootval != and .shootval store dropbool
dupbool dupbool *.refeye 0 = and
-1 dupbool dup *.shoot != and .shoot store dropbool
not and not dupbool not dupbool *.venom 30 >= *.refshell 100 > and and
-3 dupbool dup *.shoot != and .shoot store dropbool
30 dupbool dup *.shootval != and .shootval store dropbool
not and not or not
-6 dupbool dup *.shoot != and .shoot store dropbool
dropbool
*.refvelup dupbool dup *.up != and .up store dropbool
not and
*.refvelup 40 add dupbool dup *.up != and .up store dropbool
dropbool
not
dupbool dupbool *.hivexpos *.hiveypos dist 3200 < and
*.hivexpos *.hiveypos angle 628 add dupbool dup *.setaim != and .setaim store dropbool
not and
*.cc dupbool dup *.aimdx != and .aimdx store dropbool
dropbool
10 dupbool dup *.up != and .up store dropbool
dupbool dupbool *.eyef 0 > and
dupbool dupbool *.v1 *.v2 <= *.v1 *.v3 <= and *.v1 *.v4 <= and *.v1 *.v5 <= and *.v1 *.v6 <= and *.v1 *.v7 <= and *.v1 *.v8 <= and *.v1 *.v9 <= and and
*.timer dupbool dup *.v1 != and .v1 store dropbool
*.refxpos dupbool dup *.x1 != and .x1 store dropbool
*.refypos dupbool dup *.y1 != and .y1 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c1 != and .c1 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c1 != and .c1 store dropbool
not and not or not
3 dupbool dup *.c1 != and .c1 store dropbool
dropbool
not and not dupbool not dupbool *.v2 *.v1 <= *.v2 *.v3 <= and *.v2 *.v4 <= and *.v2 *.v5 <= and *.v2 *.v6 <= and *.v2 *.v7 <= and *.v2 *.v8 <= and *.v2 *.v9 <= and and
*.timer dupbool dup *.v2 != and .v2 store dropbool
*.refxpos dupbool dup *.x2 != and .x2 store dropbool
*.refypos dupbool dup *.y2 != and .y2 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c2 != and .c2 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c2 != and .c2 store dropbool
not and not or not
3 dupbool dup *.c2 != and .c2 store dropbool
dropbool
not and dupbool *.v3 *.v1 <= *.v3 *.v2 <= and *.v3 *.v4 <= and *.v3 *.v5 <= and *.v3 *.v6 <= and *.v3 *.v7 <= and *.v3 *.v8 <= and *.v3 *.v9 <= and and
*.timer dupbool dup *.v3 != and .v3 store dropbool
*.refxpos dupbool dup *.x3 != and .x3 store dropbool
*.refypos dupbool dup *.y3 != and .y3 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c3 != and .c3 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c3 != and .c3 store dropbool
not and not or not
3 dupbool dup *.c3 != and .c3 store dropbool
dropbool
not and dupbool *.v4 *.v1 <= *.v4 *.v2 <= and *.v4 *.v3 <= and *.v4 *.v5 <= and *.v4 *.v6 <= and *.v4 *.v7 <= and *.v4 *.v8 <= and *.v4 *.v9 <= and and
*.timer dupbool dup *.v4 != and .v4 store dropbool
*.refxpos dupbool dup *.x4 != and .x4 store dropbool
*.refypos dupbool dup *.y4 != and .y4 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c4 != and .c4 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c4 != and .c4 store dropbool
not and not or not
3 dupbool dup *.c4 != and .c4 store dropbool
dropbool
not and dupbool *.v5 *.v1 <= *.v5 *.v2 <= and *.v5 *.v3 <= and *.v5 *.v4 <= and *.v5 *.v6 <= and *.v5 *.v7 <= and *.v5 *.v8 <= and *.v5 *.v9 <= and and
*.timer dupbool dup *.v5 != and .v5 store dropbool
*.refxpos dupbool dup *.x5 != and .x5 store dropbool
*.refypos dupbool dup *.y5 != and .y5 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c5 != and .c5 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c5 != and .c5 store dropbool
not and not or not
3 dupbool dup *.c5 != and .c5 store dropbool
dropbool
not and dupbool *.v6 *.v1 <= *.v6 *.v2 <= and *.v6 *.v3 <= and *.v6 *.v4 <= and *.v6 *.v5 <= and *.v6 *.v7 <= and *.v6 *.v8 <= and *.v6 *.v9 <= and and
*.timer dupbool dup *.v6 != and .v6 store dropbool
*.refxpos dupbool dup *.x6 != and .x6 store dropbool
*.refypos dupbool dup *.y6 != and .y6 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c6 != and .c6 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c6 != and .c6 store dropbool
not and not or not
3 dupbool dup *.c6 != and .c6 store dropbool
dropbool
not and dupbool *.v7 *.v1 <= *.v7 *.v2 <= and *.v7 *.v3 <= and *.v7 *.v4 <= and *.v7 *.v5 <= and *.v7 *.v6 <= and *.v7 *.v8 <= and *.v7 *.v9 <= and and
*.timer dupbool dup *.v7 != and .v7 store dropbool
*.refxpos dupbool dup *.x7 != and .x7 store dropbool
*.refypos dupbool dup *.y7 != and .y7 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c7 != and .c7 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c7 != and .c7 store dropbool
not and not or not
3 dupbool dup *.c7 != and .c7 store dropbool
dropbool
not and dupbool *.v8 *.v1 <= *.v8 *.v2 <= and *.v8 *.v3 <= and *.v8 *.v4 <= and *.v8 *.v5 <= and *.v8 *.v6 <= and *.v8 *.v7 <= and *.v8 *.v9 <= and and
*.timer dupbool dup *.v8 != and .v8 store dropbool
*.refxpos dupbool dup *.x8 != and .x8 store dropbool
*.refypos dupbool dup *.y8 != and .y8 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c8 != and .c8 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c8 != and .c8 store dropbool
not and not or not
3 dupbool dup *.c8 != and .c8 store dropbool
dropbool
not and dupbool *.v9 *.v1 <= *.v9 *.v2 <= and *.v9 *.v3 <= and *.v9 *.v4 <= and *.v9 *.v5 <= and *.v9 *.v6 <= and *.v9 *.v7 <= and *.v9 *.v8 <= and and
*.timer dupbool dup *.v9 != and .v9 store dropbool
*.refxpos dupbool dup *.x9 != and .x9 store dropbool
*.refypos dupbool dup *.y9 != and .y9 store dropbool
dupbool dupbool *.refeye 0 = and
1 dupbool dup *.c9 != and .c9 store dropbool
not and not dupbool not dupbool *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or and
2 dupbool dup *.c9 != and .c9 store dropbool
not and not or not
3 dupbool dup *.c9 != and .c9 store dropbool
dropbool
dropbool dropbool dropbool
dropbool dropbool dupbool dupbool *.x1 *.y1 dist 1200 < *.c1 3 = and *.timer *.v1 sub *.timer *.v2 sub <= and *.timer *.v1 sub *.timer *.v3 sub <= and *.timer *.v1 sub *.timer *.v4 sub <= and *.timer *.v1 sub *.timer *.v5 sub <= and *.timer *.v1 sub *.timer *.v6 sub <= and *.timer *.v1 sub *.timer *.v7 sub <= and *.timer *.v1 sub *.timer *.v8 sub <= and *.timer *.v1 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x1 *.y1 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c1 != and .c1 store dropbool
not and not dupbool not dupbool *.x2 *.y2 dist 1200 < *.c2 3 = and *.timer *.v2 sub *.timer *.v1 sub <= and *.timer *.v2 sub *.timer *.v3 sub <= and *.timer *.v2 sub *.timer *.v4 sub <= and *.timer *.v2 sub *.timer *.v5 sub <= and *.timer *.v2 sub *.timer *.v6 sub <= and *.timer *.v2 sub *.timer *.v7 sub <= and *.timer *.v2 sub *.timer *.v8 sub <= and *.timer *.v2 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x2 *.y2 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c2 != and .c2 store dropbool
not and dupbool *.x3 *.y3 dist 1200 < *.c3 3 = and *.timer *.v3 sub *.timer *.v1 sub <= and *.timer *.v3 sub *.timer *.v2 sub <= and *.timer *.v3 sub *.timer *.v4 sub <= and *.timer *.v3 sub *.timer *.v5 sub <= and *.timer *.v3 sub *.timer *.v6 sub <= and *.timer *.v3 sub *.timer *.v7 sub <= and *.timer *.v3 sub *.timer *.v8 sub <= and *.timer *.v3 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x3 *.y3 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c3 != and .c3 store dropbool
not and dupbool *.x4 *.y4 dist 1200 < *.c4 3 = and *.timer *.v4 sub *.timer *.v1 sub <= and *.timer *.v4 sub *.timer *.v2 sub <= and *.timer *.v4 sub *.timer *.v3 sub <= and *.timer *.v4 sub *.timer *.v5 sub <= and *.timer *.v4 sub *.timer *.v6 sub <= and *.timer *.v4 sub *.timer *.v7 sub <= and *.timer *.v4 sub *.timer *.v8 sub <= and *.timer *.v4 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x4 *.y4 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c4 != and .c4 store dropbool
not and dupbool *.x5 *.y5 dist 1200 < *.c5 3 = and *.timer *.v5 sub *.timer *.v1 sub <= and *.timer *.v5 sub *.timer *.v2 sub <= and *.timer *.v5 sub *.timer *.v3 sub <= and *.timer *.v5 sub *.timer *.v4 sub <= and *.timer *.v5 sub *.timer *.v6 sub <= and *.timer *.v5 sub *.timer *.v7 sub <= and *.timer *.v5 sub *.timer *.v8 sub <= and *.timer *.v5 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x5 *.y5 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c5 != and .c5 store dropbool
not and dupbool *.x6 *.y6 dist 1200 < *.c6 3 = and *.timer *.v6 sub *.timer *.v1 sub <= and *.timer *.v6 sub *.timer *.v2 sub <= and *.timer *.v6 sub *.timer *.v3 sub <= and *.timer *.v6 sub *.timer *.v4 sub <= and *.timer *.v6 sub *.timer *.v5 sub <= and *.timer *.v6 sub *.timer *.v7 sub <= and *.timer *.v6 sub *.timer *.v8 sub <= and *.timer *.v6 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x6 *.y6 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c6 != and .c6 store dropbool
not and dupbool *.x7 *.y7 dist 1200 < *.c7 3 = and *.timer *.v7 sub *.timer *.v1 sub <= and *.timer *.v7 sub *.timer *.v2 sub <= and *.timer *.v7 sub *.timer *.v3 sub <= and *.timer *.v7 sub *.timer *.v4 sub <= and *.timer *.v7 sub *.timer *.v5 sub <= and *.timer *.v7 sub *.timer *.v6 sub <= and *.timer *.v7 sub *.timer *.v8 sub <= and *.timer *.v7 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x7 *.y7 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c7 != and .c7 store dropbool
not and dupbool *.x8 *.y8 dist 1200 < *.c8 3 = and *.timer *.v8 sub *.timer *.v1 sub <= and *.timer *.v8 sub *.timer *.v2 sub <= and *.timer *.v8 sub *.timer *.v3 sub <= and *.timer *.v8 sub *.timer *.v4 sub <= and *.timer *.v8 sub *.timer *.v5 sub <= and *.timer *.v8 sub *.timer *.v6 sub <= and *.timer *.v8 sub *.timer *.v7 sub <= and *.timer *.v8 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x8 *.y8 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c8 != and .c8 store dropbool
not and dupbool *.x9 *.y9 dist 1200 < *.c9 3 = and *.timer *.v9 sub *.timer *.v1 sub <= and *.timer *.v9 sub *.timer *.v2 sub <= and *.timer *.v9 sub *.timer *.v3 sub <= and *.timer *.v9 sub *.timer *.v4 sub <= and *.timer *.v9 sub *.timer *.v5 sub <= and *.timer *.v9 sub *.timer *.v6 sub <= and *.timer *.v9 sub *.timer *.v7 sub <= and *.timer *.v9 sub *.timer *.v8 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x9 *.y9 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c9 != and .c9 store dropbool
not and dupbool *.x1 *.y1 dist 1200 < *.c1 1 = and *.timer *.v1 sub *.timer *.v2 sub <= and *.timer *.v1 sub *.timer *.v3 sub <= and *.timer *.v1 sub *.timer *.v4 sub <= and *.timer *.v1 sub *.timer *.v5 sub <= and *.timer *.v1 sub *.timer *.v6 sub <= and *.timer *.v1 sub *.timer *.v7 sub <= and *.timer *.v1 sub *.timer *.v8 sub <= and *.timer *.v1 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x1 *.y1 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c1 != and .c1 store dropbool
not and dupbool *.x2 *.y2 dist 1200 < *.c2 1 = and *.timer *.v2 sub *.timer *.v1 sub <= and *.timer *.v2 sub *.timer *.v3 sub <= and *.timer *.v2 sub *.timer *.v4 sub <= and *.timer *.v2 sub *.timer *.v5 sub <= and *.timer *.v2 sub *.timer *.v6 sub <= and *.timer *.v2 sub *.timer *.v7 sub <= and *.timer *.v2 sub *.timer *.v8 sub <= and *.timer *.v2 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x2 *.y2 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c2 != and .c2 store dropbool
not and dupbool *.x3 *.y3 dist 1200 < *.c3 1 = and *.timer *.v3 sub *.timer *.v1 sub <= and *.timer *.v3 sub *.timer *.v2 sub <= and *.timer *.v3 sub *.timer *.v4 sub <= and *.timer *.v3 sub *.timer *.v5 sub <= and *.timer *.v3 sub *.timer *.v6 sub <= and *.timer *.v3 sub *.timer *.v7 sub <= and *.timer *.v3 sub *.timer *.v8 sub <= and *.timer *.v3 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x3 *.y3 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c3 != and .c3 store dropbool
not and dupbool *.x4 *.y4 dist 1200 < *.c4 1 = and *.timer *.v4 sub *.timer *.v1 sub <= and *.timer *.v4 sub *.timer *.v2 sub <= and *.timer *.v4 sub *.timer *.v3 sub <= and *.timer *.v4 sub *.timer *.v5 sub <= and *.timer *.v4 sub *.timer *.v6 sub <= and *.timer *.v4 sub *.timer *.v7 sub <= and *.timer *.v4 sub *.timer *.v8 sub <= and *.timer *.v4 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x4 *.y4 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c4 != and .c4 store dropbool
not and dupbool *.x5 *.y5 dist 1200 < *.c5 1 = and *.timer *.v5 sub *.timer *.v1 sub <= and *.timer *.v5 sub *.timer *.v2 sub <= and *.timer *.v5 sub *.timer *.v3 sub <= and *.timer *.v5 sub *.timer *.v4 sub <= and *.timer *.v5 sub *.timer *.v6 sub <= and *.timer *.v5 sub *.timer *.v7 sub <= and *.timer *.v5 sub *.timer *.v8 sub <= and *.timer *.v5 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x5 *.y5 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c5 != and .c5 store dropbool
not and dupbool *.x6 *.y6 dist 1200 < *.c6 1 = and *.timer *.v6 sub *.timer *.v1 sub <= and *.timer *.v6 sub *.timer *.v2 sub <= and *.timer *.v6 sub *.timer *.v3 sub <= and *.timer *.v6 sub *.timer *.v4 sub <= and *.timer *.v6 sub *.timer *.v5 sub <= and *.timer *.v6 sub *.timer *.v7 sub <= and *.timer *.v6 sub *.timer *.v8 sub <= and *.timer *.v6 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x6 *.y6 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c6 != and .c6 store dropbool
not and dupbool *.x7 *.y7 dist 1200 < *.c7 1 = and *.timer *.v7 sub *.timer *.v1 sub <= and *.timer *.v7 sub *.timer *.v2 sub <= and *.timer *.v7 sub *.timer *.v3 sub <= and *.timer *.v7 sub *.timer *.v4 sub <= and *.timer *.v7 sub *.timer *.v5 sub <= and *.timer *.v7 sub *.timer *.v6 sub <= and *.timer *.v7 sub *.timer *.v8 sub <= and *.timer *.v7 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x7 *.y7 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c7 != and .c7 store dropbool
not and dupbool *.x8 *.y8 dist 1200 < *.c8 1 = and *.timer *.v8 sub *.timer *.v1 sub <= and *.timer *.v8 sub *.timer *.v2 sub <= and *.timer *.v8 sub *.timer *.v3 sub <= and *.timer *.v8 sub *.timer *.v4 sub <= and *.timer *.v8 sub *.timer *.v5 sub <= and *.timer *.v8 sub *.timer *.v6 sub <= and *.timer *.v8 sub *.timer *.v7 sub <= and *.timer *.v8 sub *.timer *.v9 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x8 *.y8 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c8 != and .c8 store dropbool
not and dupbool *.x9 *.y9 dist 1200 < *.c9 1 = and *.timer *.v9 sub *.timer *.v1 sub <= and *.timer *.v9 sub *.timer *.v2 sub <= and *.timer *.v9 sub *.timer *.v3 sub <= and *.timer *.v9 sub *.timer *.v4 sub <= and *.timer *.v9 sub *.timer *.v5 sub <= and *.timer *.v9 sub *.timer *.v6 sub <= and *.timer *.v9 sub *.timer *.v7 sub <= and *.timer *.v9 sub *.timer *.v8 sub <= and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
*.x9 *.y9 angle dupbool dup *.setaim != and .setaim store dropbool
0 dupbool dup *.c9 != and .c9 store dropbool
not and dupbool *.eye2 0 > *.focuseye -3 < and and
-3 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye3 0 > *.focuseye -2 < and and
-2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye4 0 > *.focuseye -1 < and and
-1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye5 0 > *.focuseye 0 < and and
0 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye6 0 > *.focuseye 1 < and and
1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye7 0 > *.focuseye 2 < and and
2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye8 0 > *.focuseye 3 < and and
3 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye9 0 > *.focuseye 4 < and and
4 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye1 0 > and
-4 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye2 0 > and
-3 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye3 0 > and
-2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye4 0 > and
-1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye5 0 > and
0 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye6 0 > and
1 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye7 0 > and
2 dupbool dup *.focuseye != and .focuseye store dropbool
not and dupbool *.eye8 0 > and
3 dupbool dup *.focuseye != and .focuseye store dropbool
not and not or not
8 rnd 4 sub dupbool dup *.focuseye != and .focuseye store dropbool
dropbool
dropbool *.body 800 < *.nrg 15000 > and
500 dupbool dup *.strbody != and .strbody store dropbool
dropbool *.body 800 > *.nrg 30000 < and
500 dupbool dup *.fdbody != and .fdbody store dropbool
dropbool *.nrg 10000 > *.venom 1000 < and
200 dupbool dup *.strvenom != and .strvenom store dropbool
dropbool *.fixed 0 !=
.fixpos dec
dropbool *.shflav -1 = *.refeye 0 = *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or or and *.poison 500 < and
500 *.poison sub dupbool dup *.strpoison != and .strpoison store dropbool
dropbool *.shflav -6 = *.refeye 0 = *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or or and *.shell 500 < and
500 *.shell sub dupbool dup *.mkshell != and .mkshell store dropbool
dropbool
0 dup *.shflav != .shflav store
*.waste 1000 > *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and *.refeye *.myeye 3 add *.status 1 sub 3 mult sub = *.in5 *.conspec = and or not and
-4 dupbool dup *.shoot != and .shoot store dropbool
*.waste dupbool dup *.shootval != and .shootval store dropbool
dropbool *.nrg 30000 >= *.body 800 >= and
.return inc
dropbool
stop

cond
*.robage 0 > *.status 2 = and *.shflav 0 != and *.shflav -2 != and *.return 0 != and
start
0 dup *.return != .return store
*.shell 500 <
500 *.shell sub dupbool dup *.mkshell != and .mkshell store dropbool
dropbool
500 dup *.strpoison != .strpoison store
stop

cond
*.robage 0 > *.status 2 = and *.return 0 != and
start
*.nrg 10000 <
0 dupbool dup *.return != and .return store dropbool
dropbool *.eye5 0 = *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and not or
*.hivexpos *.hiveypos angle dupbool dup *.setaim != and .setaim store dropbool
30 *.velup sub 0 ceil 30 floor dupbool dup *.up != and .up store dropbool
dropbool *.eye5 35 < *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and and
*.refvelup 40 add dupbool dup *.up != and .up store dropbool
*.refveldx dupbool dup *.dx != and .dx store dropbool
dropbool *.eye5 35 >= *.refeye *.status 1 sub 3 mult *.myeye add = *.in5 *.conspec = and and
-2 dupbool dup *.shoot != and .shoot store dropbool
1000 dupbool dup *.shootval != and .shootval store dropbool
dupbool dupbool *.refxpos 0 != *.refypos 0 != and and
*.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
*.refxpos dupbool dup *.hivexpos != and .hivexpos store dropbool
*.refypos dupbool dup *.hiveypos != and .hiveypos store dropbool
dropbool dropbool
*.refvelup dupbool dup *.up != and .up store dropbool
*.refveldx dupbool dup *.dx != and .dx store dropbool
dropbool *.numties 0 >
*.tiepres dupbool dup *.deltie != and .deltie store dropbool
dropbool *.hivexpos *.hiveypos dist 200 <
.counter inc
not
0 dupbool dup *.counter != and .counter store dropbool
dropbool *.counter 600 >
1 dupbool dup *.status != and .status store dropbool
dup ^ inc
stop

PyBot code:
[code]#omit-original-code

def hivexpos at 971
def hiveypos at 972
def status at 973 # 0 = initial, 1 = "queen", 2 = worker
def queen at 974 # 0 = normal, 1 = forced queen
def conspec at 975 # conspec number
def look at 51 # currently unused
def counter at 52
def return at 53
def cc at 54
def seen at 55

# v(x) means cycle (timer) in which something was seen (not necessarily in eye (x))
def v1 at 57
def v2 at 58
def v3 at 59
def v4 at 60
def v5 at 61
def v6 at 62
def v7 at 63
def v8 at 64
def v9 at 65

# x(x) and y(x) mean the x and y positions of the "somethings" seen
def x1 at 66
def x2 at 67
def x3 at 68
def x4 at 69
def x5 at 70
def x6 at 71
def x7 at 72
def x8 at 73
def x9 at 74

def y1 at 75
def y2 at 76
def y3 at 77
def y4 at 78
def y5 at 79
def y6 at 80
def y7 at 81
def y8 at 82
def y9 at 83

# c(x) means whether the seen bot was 0=nothing 1=veggy 2=conspec 3=enemy
def c1 at 84
def c2 at 85
def c3 at 86
def c4 at 87
def c5 at 88
def c6 at 89
def c7 at 90
def c8 at 91
def c9 at 92

define t1: (timer - v1)
define t2: (timer - v2)
define t3: (timer - v3)
define t4: (timer - v4)
define t5: (timer - v5)
define t6: (timer - v6)
define t7: (timer - v7)
define t8: (timer - v8)
define t9: (timer - v9)

# define isqueen: (in5 == (timer - 1)
# define isconspec: (in6 == (timer - 1))
define isqueen: ((refeye == (status - 1 * 3 + myeye)) and (in5 == conspec))
define isworker: ((refeye == (myeye + 3 - (status - 1 * 3))) and (in5 == conspec))
define isconspec: (isqueen or isworker)

if (status == 0): # initial stage
    dx = refveldx # match velocity
    up = refvelup + 30 # catch up
    if (robage == 0):
        timer = 1
    if (eye5 > 45):
        shoot = -1
        shootval = 8
        up = refvelup # follow
    if (eye5 > 0):
        timer = 1
        setaim = angle(refxpos, refypos) # aim
    # rotation
    elif (eye6 > 0):
        aimdx = 34
    elif (eye4 > 0):
        aimdx = -34
    elif (eye7 > 0):
        aimdx = 69
    elif (eye3 > 0):
        aimdx = -69
    elif (eye8 > 0):
        aimdx = 104
    elif (eye2 > 0):
        aimdx = -104
    elif (eye9 > 0):
        aimdx = 139
    elif (eye1 > 0):
        aimdx = -139
    elif (timer < 10):
        # fast turning (to find enemies in range)
        aimdx = 314
    else:
        # slow turning (slows down)
        aimdx = 628 / timer
    if (waste > 1000):
        # eject waste
        shoot = -4
        shootval = waste
    if ((nrg > 25000) and (body > 6000)):
        # become a queen
        conspec = rnd 32000 # per-hive conspec
        out5 = conspec
        hivexpos = xpos
        hiveypos = ypos
        status++
        fixpos++

if (false):
    # use a bunch of eye statements
    if (eye5 == eye6):
        up = eye7

if ((robage == 0) and (status == 1)):
    if (((rnd 20) == 0) or (queen == 1) or (hivexpos == 0) or (hiveypos == 0)):
        # become a queen: 1/21 chance, unless forced
        queen = 0
    else:
        # become a worker
        status = 2
    out5 = conspec

if ((robage > 0) and (status == 1)):
    # queen actions
    if (isqueen and (seen == 0) and (refeye == myeye)):
        # queen conspec?
        seen = (refkills + 1)
    elif (isqueen and (seen == (refkills + 1)) and (refeye == myeye)):
        # queen conspec, tie
        seen = 0
        tie++
    else
        seen = 0
    # share energy around
    eye5width = -34
    sharenrg = 50
    # free rotation
    tieang1--
    tieang2--
    tieang3--
    tieang4--
    # stay fixed
    fixpos = 1
    if (waste > 50):
        # shoot waste
        shoot = -4
        shootval = waste
        aimshot = (rnd 1256) # random direction
    if ((body > 2000) and (nrg < 31000)):
        fdbody = 1000
    if ((body < 2000) and (nrg > 10000)):
        strbody = 1000
    if (nrg > 25000):
        # protection and energy "sink"
        # slowly create defences
        if (shell < 30000):
            mkshell = 300
        if (poison < 30000):
            strpoison = 300
    # poison inhibits shooting
    ploc = shoot
    if ((robage > 5) and (hivexpos == xpos) and (hiveypos == ypos)):
        aimdx = 60
        if ((body > 20000) and (nrg > 20000)):
            # probably too large, try to split
            queen = 1
            repro = 50
        elif ((nrg > 10000) and (body > 1000) and (eye5 < 35)):
            # reproduce normally
            queen = 0
            repro = (10 + (body / 1000))
    # tell children where parent is
    hivexpos = xpos
    hiveypos = ypos

if ((robage > 0) and (status == 2) and (return == 0)):
    # worker actions
    if (robage == 1):
        # initialization
        tie++ # replace birth tie
        vloc = &mkshell # venom removes shell
        ploc = &shoot # poison inhibits shooting
        delgene = 2 # delete some random eye statements to reduce myeye
        cc = ((rnd 1) * 2 - 1) * 2
        # 360 degree vision from Welwordion
        eye1dir = 420
        eye2dir = 315
        eye3dir = 210
        eye4dir = 105
        eye6dir = -105
        eye7dir = -210
        eye8dir = -315
        eye9dir = -420
        eye1width = 105
        eye2width = 105
        eye3width = 105
        eye4width = 105
        eye5width = 105
        eye6width = 105
        eye7width = 105
        eye8width = 105
        eye9width = 105
    
    if (numties > 0):
        # delete all ties
        deltie = tiepres

    # eye-based commands
    # remove eye values when timer overflows
    if (v1 > timer):
        v1 = -1
        c1 = 0
    if (v2 > timer):
        v2 = -1
        c2 = 0
    if (v3 > timer):
        v3 = -1
        c3 = 0
    if (v4 > timer):
        v4 = -1
        c4 = 0
    if (v5 > timer):
        v5 = -1
        c5 = 0
    if (v6 > timer):
        v6 = -1
        c6 = 0
    if (v7 > timer):
        v7 = -1
        c7 = 0
    if (v8 > timer):
        v8 = -1
        c8 = 0
    if (v9 > timer):
        v9 = -1
        c9 = 0
    if ((focuseye == 0) and !isconspec and (eyef > 0)):
        # follow
        dx = refveldx
        setaim = angle(refxpos, refypos)
        if (eyef > 40):
            shootval = 8
            if (refeye == 0):
                shoot = -1
#                if (look == 1):
#                    look = 0 # looking is over
#                    # don't move!
#                    dx = 0
#                    up = 0
#                    aimdx = 0
#                    setaim = aim
#                else:
#                    look = 1 # just looking around
#                    focuseye = ((rnd 3) + 1) * ((rnd 1) * 2 - 1) # anything except 0
            elif ((venom >= 30) and (refshell > 100)):
                shoot = -3
                shootval = 30
            else
                shoot = -6
            up = refvelup
        else:
            up = refvelup + 40
    else:
        if (dist(hivexpos, hiveypos) < 3200):
            setaim = angle(hivexpos, hiveypos) + 628
        else:
            aimdx = cc
        # drift
        up = 10
        if (eyef > 0):
            # fancy eye stuff - remember where things are
            if ((v1 <= v2) and (v1 <= v3) and (v1 <= v4) and (v1 <= v5) and (v1 <= v6) and (v1 <= v7) and (v1 <= v8) and (v1 <= v9)):
                v1 = timer
                x1 = refxpos
                y1 = refypos
                if (refeye == 0):
                    c1 = 1
                elif (isconspec):
                    c1 = 2
                else:
                    c1 = 3
            elif ((v2 <= v1) and (v2 <= v3) and (v2 <= v4) and (v2 <= v5) and (v2 <= v6) and (v2 <= v7) and (v2 <= v8) and (v2 <= v9)):
                v2 = timer
                x2 = refxpos
                y2 = refypos
                if (refeye == 0):
                    c2 = 1
                elif (isconspec):
                    c2 = 2
                else:
                    c2 = 3
            elif ((v3 <= v1) and (v3 <= v2) and (v3 <= v4) and (v3 <= v5) and (v3 <= v6) and (v3 <= v7) and (v3 <= v8) and (v3 <= v9)):
                v3 = timer
                x3 = refxpos
                y3 = refypos
                if (refeye == 0):
                    c3 = 1
                elif (isconspec):
                    c3 = 2
                else:
                    c3 = 3
            elif ((v4 <= v1) and (v4 <= v2) and (v4 <= v3) and (v4 <= v5) and (v4 <= v6) and (v4 <= v7) and (v4 <= v8) and (v4 <= v9)):
                v4 = timer
                x4 = refxpos
                y4 = refypos
                if (refeye == 0):
                    c4 = 1
                elif (isconspec):
                    c4 = 2
                else:
                    c4 = 3
            elif ((v5 <= v1) and (v5 <= v2) and (v5 <= v3) and (v5 <= v4) and (v5 <= v6) and (v5 <= v7) and (v5 <= v8) and (v5 <= v9)):
                v5 = timer
                x5 = refxpos
                y5 = refypos
                if (refeye == 0):
                    c5 = 1
                elif (isconspec):
                    c5 = 2
                else:
                    c5 = 3
            elif ((v6 <= v1) and (v6 <= v2) and (v6 <= v3) and (v6 <= v4) and (v6 <= v5) and (v6 <= v7) and (v6 <= v8) and (v6 <= v9)):
                v6 = timer
                x6 = refxpos
                y6 = refypos
                if (refeye == 0):
                    c6 = 1
                elif (isconspec):
                    c6 = 2
                else:
                    c6 = 3
            elif ((v7 <= v1) and (v7 <= v2) and (v7 <= v3) and (v7 <= v4) and (v7 <= v5) and (v7 <= v6) and (v7 <= v8) and (v7 <= v9)):
                v7 = timer
                x7 = refxpos
                y7 = refypos
                if (refeye == 0):
                    c7 = 1
                elif (isconspec):
                    c7 = 2
                else:
                    c7 = 3
            elif ((v8 <= v1) and (v8 <= v2) and (v8 <= v3) and (v8 <= v4) and (v8 <= v5) and (v8 <= v6) and (v8 <= v7) and (v8 <= v9)):
                v8 = timer
                x8 = refxpos
                y8 = refypos
                if (refeye == 0):
                    c8 = 1
                elif (isconspec):
                    c8 = 2
                else:
                    c8 = 3
            elif ((v9 <= v1) and (v9 <= v2) and (v9 <= v3) and (v9 <= v4) and (v9 <= v5) and (v9 <= v6) and (v9 <= v7) and (v9 <= v8)):
                v9 = timer
                x9 = refxpos
                y9 = refypos
                if (refeye == 0):
                    c9 = 1
                elif (isconspec):
                    c9 = 2
                else:
  &

36
F2 bots / Hive 0.2 (F2, I guess)
« on: May 23, 2008, 07:31:26 AM »
Yeah, I made a mistake in the worker code which deleted the queen gene. The code which turned workers into queens then basically killed the bot, as none of the genes would fire (except the conspec).
I made a new version, with mostly rewritten worker code. I'll post that in a bit.

37
F2 bots / Hive 0.2 (F2, I guess)
« on: May 22, 2008, 07:41:55 AM »
Quote from: bacillus
Overall not a bad bot, I can draw some ideas out of it. The eye 5 is set inefficiently, though, the initial queen has trouble getting enough energy to start a colony due to its high speed, and the queen to worker ratio is WAY too high. At the moment it seems to be 1:1, try get it down to at least 1:20. In the current ratio, the queens have no way to get enough energy.

The initial queen... well, I won't argue.

I'm not sure if I understood your "queen to worker" problem -
Code: [Select]
if ((robage == 0) and (status == 1)):
    if (((rnd 20) == 0) or (queen == 1)):
        status = 1
        queen = 0
    else:
        status = 2
Basically, newly spawned bots have a 1/21 chance of being a queen unless they are forced to be by the parent because it had too much energy and body.

(I just realized that I don't actually need that 'status = 1'. Meh.)

38
F2 bots / Hive 0.2 (F2, I guess)(22-05-2008)
« on: May 21, 2008, 09:45:09 PM »
This is an antbot-type bot, with multiple energy-sharing "queens" and a  lot of workers. A conspec system which puts *.timer in *.out5 and/or  *.out6 allows each bot to be loyal only to its own colony. (out5 is for  queens only, out6 is for everyone) There is a problem with workers  clumping around the hive - I tried to fix this by placing a timeout on  how long each worker can stay near the hive, but it didn't work too  well. Also, the conspec system is often a cycle late and I could not  stop the queens from sometimes tying to non-queens. The workers will  automatically delete the ties, but sometimes another bot (often a  veggy) will get tied and the workers will try to kill it, but will also  be killing the queen(s). Any help with these problems would be appreciated.
 
  Run this bot with a very small initial count (one per hive) and place  it in a large field with lots of veggies. (32000x24000 would be optimal  because it uses .xpos and .ypos to locate the hive.) Try to keep them away from being next to a corner, as that will probably mess up some of the worker logic.

I'm aware that the workers' eye genes are suboptimal but I'm too lazy to fix them. Basically, eyes 1-4 are unused.

Here is the DNA:
Code: [Select]
   'PyHive0.2.txt compiled by PyBot V2 from PyHive0.2.pyr.
   def hivexpos 971
   def hiveypos 972
   def status 973
   def queen 974
   def counter 53
   def return 54
   def first 55
   def seen 56
   def counter2 57
   cond
   *.status 0 =
   start
   *.refveldx dup *.dx != .dx store
   *.refvelup 30 add dup *.up != .up store
   *.robage 0 =
   1 dupbool dup *.timer != and .timer store dropbool
   100 dupbool dup *.eye5width != and .eye5width store dropbool
   dropbool *.eye5 45 >
   -1 dupbool dup *.shoot != and .shoot store dropbool
   8 dupbool dup *.shootval != and .shootval store dropbool
   *.refvelup dupbool dup *.up != and .up store dropbool
   dropbool *.eye5 0 =
   628 *.timer div dupbool dup *.aimdx != and .aimdx store dropbool
   not
   1 dupbool dup *.timer != and .timer store dropbool
   *.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
   dropbool *.waste 1000 >
   -4 dupbool dup *.shoot != and .shoot store dropbool
   *.waste dupbool dup *.shootval != and .shootval store dropbool
   dropbool *.nrg 25000 > *.body 6000 > and
   32000 rnd dupbool dup *.timer != and .timer store dropbool
   *.xpos dupbool dup *.hivexpos != and .hivexpos store dropbool
   *.ypos dupbool dup *.hiveypos != and .hiveypos store dropbool
   0 dupbool dup *.eye5width != and .eye5width store dropbool
   .status inc
   .fixpos inc
   dropbool
   stop
   
   cond
   *.status 0 !=
   start
   *.timer dup *.out6 != .out6 store
   stop
   
   cond
   *.robage 0 = *.status 1 = and
   start
   20 rnd 0 = *.queen 1 = or
   1 dupbool dup *.status != and .status store dropbool
   0 dupbool dup *.queen != and .queen store dropbool
   not
   2 dupbool dup *.status != and .status store dropbool
   dropbool
   stop
   
   cond
   *.robage 0 > *.status 1 = and
   start
   *.in5 *.timer 1 sub = *.seen 0 = and *.refeye *.myeye = and
   *.refkills 1 add dupbool dup *.seen != and .seen store dropbool
   dupbool not dupbool *.in5 *.timer 1 sub = *.seen *.refkills 1 add = and *.refeye *.myeye = and and
   0 dupbool dup *.seen != and .seen store dropbool
   .tie inc
   not and not or not
   0 dupbool dup *.seen != and .seen store dropbool
   dropbool
   50 dup *.sharenrg != .sharenrg store
   .tieang1 dec
   .tieang2 dec
   .tieang3 dec
   .tieang4 dec
   1 dup *.fixpos != .fixpos store
   80 rnd 0 =
   -4 dupbool dup *.shoot != and .shoot store dropbool
   *.waste dupbool dup *.shootval != and .shootval store dropbool
   dropbool *.body 2000 > *.nrg 31000 < and
   1000 dupbool dup *.fdbody != and .fdbody store dropbool
   dropbool *.body 2000 < *.nrg 10000 > and
   1000 dupbool dup *.strbody != and .strbody store dropbool
   dropbool *.nrg 25000 >
   dupbool dupbool *.shell 30000 < and
   500 dupbool dup *.mkshell != and .mkshell store dropbool
   dropbool dropbool dupbool dupbool *.poison 30000 < and
   500 dupbool dup *.strpoison != and .strpoison store dropbool
   dropbool dropbool
   dropbool
   *.shoot dup *.ploc != .ploc store
   *.robage 5 >
   60 dupbool dup *.aimdx != and .aimdx store dropbool
   dupbool dupbool *.body 20000 > *.nrg 20000 > and and
   1 dupbool dup *.queen != and .queen store dropbool
   50 dupbool dup *.repro != and .repro store dropbool
   not and not dupbool not dupbool *.nrg 10000 > *.body 1000 > and *.eye5 40 < and and
   0 dupbool dup *.queen != and .queen store dropbool
   10 *.body 1000 div add dupbool dup *.repro != and .repro store dropbool
   dropbool dropbool dropbool
   not
   dropbool
   *.xpos dup *.hivexpos != .hivexpos store
   *.ypos dup *.hiveypos != .hiveypos store
   *.timer dup *.out5 != .out5 store
   stop
   
   cond
   *.robage 0 > *.status 2 = and *.return 0 = and
   start
   *.robage 1 =
   .tie inc
   .mkshell dupbool dup *.vloc != and .vloc store dropbool
   -32000 dupbool dup *.venval != and .venval store dropbool
   31 dupbool dup *.counter2 != and .counter2 store dropbool
   628 dupbool dup *.aimdx != and .aimdx store dropbool
   4 dupbool dup *.delgene != and .delgene store dropbool
   dropbool *.numties 0 >
   *.tiepres dupbool dup *.deltie != and .deltie store dropbool
   dropbool
   .shoot dup *.ploc != .ploc store
   *.hivexpos *.hiveypos dist 300 <
   .counter2 inc
   not
   0 dupbool dup *.counter2 != and .counter2 store dropbool
   dropbool *.eye5 0 > *.in6 *.timer 1 sub = not and
   0 dupbool dup *.counter != and .counter store dropbool
   dupbool not dupbool *.counter2 30 > and
   *.hivexpos *.hiveypos angle 628 add dupbool dup *.setaim != and .setaim store dropbool
   15 dupbool dup *.up != and .up store dropbool
   not and dupbool *.eye6 0 > and
   34 dupbool dup *.aimdx != and .aimdx store dropbool
   not and dupbool *.eye7 0 > and
   69 dupbool dup *.aimdx != and .aimdx store dropbool
   not and dupbool *.eye8 0 > and
   104 dupbool dup *.aimdx != and .aimdx store dropbool
   not and dupbool *.eye9 0 > and
   139 dupbool dup *.aimdx != and .aimdx store dropbool
   not and not or not
   dupbool dupbool *.counter 30 < and
   174 dupbool dup *.aimdx != and .aimdx store dropbool
   .counter inc
   not and
   2 dupbool dup *.aimdx != and .aimdx store dropbool
   10 dupbool dup *.up != and .up store dropbool
   dropbool
   dropbool *.eye5 0 > *.in6 *.timer 1 sub = not and
   *.refveldx dupbool dup *.dx != and .dx store dropbool
   dupbool dupbool *.eye5 35 > and
   *.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
   8 dupbool dup *.shootval != and .shootval store dropbool
   dupbool dupbool *.refeye 0 = and
   -1 dupbool dup *.shoot != and .shoot store dropbool
   not and not dupbool not dupbool *.venom 30 >= *.refshell 0 > and 3 rnd 0 = and and
   -3 dupbool dup *.shoot != and .shoot store dropbool
   30 dupbool dup *.shootval != and .shootval store dropbool
   not and not or not
   -6 dupbool dup *.shoot != and .shoot store dropbool
   dropbool
   *.refvelup dupbool dup *.up != and .up store dropbool
   not and
   *.refvelup 30 add dupbool dup *.up != and .up store dropbool
   dropbool
   dropbool *.body 800 < *.nrg 15000 > and
   500 dupbool dup *.strbody != and .strbody store dropbool
   dropbool *.body 800 > *.nrg 30000 < and
   500 dupbool dup *.fdbody != and .fdbody store dropbool
   dropbool *.nrg 10000 > *.venom 1000 < and
   200 dupbool dup *.strvenom != and .strvenom store dropbool
   dropbool *.fixed 0 !=
   .fixpos dec
   dropbool *.shflav -1 = *.refeye 0 = *.in6 *.timer 1 sub = or and *.poison 500 < and
   500 *.poison sub dupbool dup *.strpoison != and .strpoison store dropbool
   dropbool *.shflav -6 = *.refeye 0 = *.in6 *.timer 1 sub = or and *.shell 500 < and
   500 *.shell sub dupbool dup *.mkshell != and .mkshell store dropbool
   dropbool
   0 dup *.shflav != .shflav store
   *.waste 1000 >
   -4 dupbool dup *.shoot != and .shoot store dropbool
   *.waste dupbool dup *.shootval != and .shootval store dropbool
   dropbool
   stop
   
   cond
   *.robage 0 > *.status 2 = and *.nrg 30000 >= and *.body 1000 > and *.return 0 = and
   start
   .return inc
   stop
   
   cond
   *.robage 0 > *.status 2 = and *.nrg 10000 < and *.return 0 != and
   start
   0 dup *.return != .return store
   31 dup *.counter2 != .counter2 store
   628 dup *.aimdx != .aimdx store
   stop
   
   cond
   *.robage 0 > *.status 2 = and *.shflav 0 != and *.shflav -2 != and *.return 0 != and
   start
   0 dup *.return != .return store
   *.shell 500 <
   500 *.shell sub dupbool dup *.mkshell != and .mkshell store dropbool
   dropbool
   500 dup *.strpoison != .strpoison store
   stop
   
   cond
   *.robage 0 > *.status 2 = and *.return 0 != and
   start
   *.eye5 0 = *.in5 *.timer 1 sub = not or
   *.hivexpos *.hiveypos angle dupbool dup *.setaim != and .setaim store dropbool
   30 *.velup sub 0 ceil 30 floor dupbool dup *.up != and .up store dropbool
   dropbool *.eye5 40 < *.in5 *.timer 1 sub = and
   *.refvelup 30 add dupbool dup *.up != and .up store dropbool
   dropbool *.eye5 40 >= *.in5 *.timer 1 sub = and
   -2 dupbool dup *.shoot != and .shoot store dropbool
   1200 dupbool dup *.shootval != and .shootval store dropbool
   *.refxpos *.refypos angle dupbool dup *.setaim != and .setaim store dropbool
   *.refxpos dupbool dup *.hivexpos != and .hivexpos store dropbool
   *.refypos dupbool dup *.hiveypos != and .hiveypos store dropbool
   *.refvelup dupbool dup *.up != and .up store dropbool
   *.refveldx dupbool dup *.dx != and .dx store dropbool
   dropbool *.numties 0 >
   *.tiepres dupbool dup *.deltie != and .deltie store dropbool
   dropbool *.hivexpos *.hiveypos dist 200 <
   .counter inc
   not
   0 dupbool dup *.counter != and .counter store dropbool
   dropbool *.counter 700 >
   1 dupbool dup *.status != and .status store dropbool
   dup ^ inc
   stop

PyBot code:
Code: [Select]
#omit-original-code
 
 def hivexpos at 971
 def hiveypos at 972
 def status at 973 # 0 = initial, 1 = "queen", 2 = worker
 def queen at 974 # 0 = normal, 1 = forced queen
 def counter at 53
 def return at 54
 def first at 55
 def seen at 56
 def counter2 at 57
 
 define isqueen: (in5 == (timer - 1))
 define isconspec: (in6 == (timer - 1))
 
 if (status == 0): # initial stage
     dx = refveldx # match velocity
     up = refvelup + 30 # catch up
     if (robage == 0):
         timer = 1
         eye5width = 100
     if (eye5 > 45):
         shoot = -1
         shootval = 8
         up = refvelup # follow
     if (eye5 == 0):
         aimdx = 628 / timer
     else:
         timer = 1
         setaim = angle(refxpos, refypos) # aim
     if (waste > 1000):
         shoot = -4
         shootval = waste
     if ((nrg > 25000) and (body > 6000)):
         timer = rnd 32000
         hivexpos = xpos
         hiveypos = ypos
         eye5width = 0
         status++
         fixpos++
     
 if (status != 0):
     out6 = timer
 
 if ((robage == 0) and (status == 1)):
     if (((rnd 20) == 0) or (queen == 1)):
         status = 1
         queen = 0
     else:
         status = 2
 
 if ((robage > 0) and (status == 1)):
     if (isqueen and (seen == 0) and (refeye == myeye)):
         seen = (refkills + 1)
     elif (isqueen and (seen == (refkills + 1)) and (refeye == myeye)):
         seen = 0
         tie++
     else
         seen = 0
     sharenrg = 50
     tieang1--
     tieang2--
     tieang3--
     tieang4--
     fixpos = 1
     if ((rnd 80) == 0):
         shoot = -4
         shootval = waste
     if ((body > 2000) and (nrg < 31000)):
         fdbody = 1000
     if ((body < 2000) and (nrg > 10000)):
         strbody = 1000
     if (nrg > 25000):
         if (shell < 30000):
             mkshell = 500
         if (poison < 30000):
             strpoison = 500
     ploc = shoot
     if (robage > 5):
         aimdx = 60
         if ((body > 20000) and (nrg > 20000)):
             queen = 1
             repro = 50
         elif ((nrg > 10000) and (body > 1000) and (eye5 < 40)):
             queen = 0
             repro = (10 + (body / 1000))
     hivexpos = xpos
     hiveypos = ypos
     out5 = timer
 
 if ((robage > 0) and (status == 2) and (return == 0)):
     if (robage == 1):
         tie++
         vloc = &mkshell
         venval = -32000
         counter2 = 31
         aimdx = 628
         delgene = 4
     if (numties > 0):
         deltie = tiepres
     ploc = &shoot
     if (dist(hivexpos, hiveypos) < 300):
         counter2++
     else:
         counter2 = 0
     if ((eye5 > 0) and (!isconspec)):
         counter = 0
     elif (counter2 > 30):
         setaim = (angle(hivexpos, hiveypos) + 628)
         up = 15
     elif (eye6 > 0):
         aimdx = 34
     elif (eye7 > 0):
         aimdx = 69
     elif (eye8 > 0):
         aimdx = 104
     elif (eye9 > 0):
         aimdx = 139
     else:
         if (counter < 30):
             aimdx = 174
             counter++
         else:
             aimdx = 2
             up = 10
     if ((eye5 > 0) and (!isconspec)):
         dx = refveldx
         if (eye5 > 35):
             setaim = angle(refxpos, refypos) # aim
             shootval = 8
             if (refeye == 0):
                 shoot = -1
             elif ((venom >= 30) and (refshell > 0) and (rnd(3) == 0)):
                 shoot = -3
                 shootval = 30
             else:
                 shoot = -6
             up = refvelup
         else:
             up = refvelup + 30
     if ((body < 800) and (nrg > 15000)):
         strbody = 500
     if ((body > 800) and (nrg < 30000)):
         fdbody = 500
     if ((nrg > 10000) and (venom < 1000)):
         strvenom = 200
     if (fixed != 0):
         fixpos--
     if ((shflav == -1) and ((refeye == 0) or isconspec) and (poison < 500)):
         strpoison = 500 - poison
     if ((shflav == -6) and ((refeye == 0) or isconspec) and (shell < 500)):
         mkshell = 500 - shell
     shflav = 0
     if (waste > 1000):
         shoot = -4
         shootval = waste
 
 if ((robage > 0) and (status == 2) and (nrg >= 30000) and (body > 1000) and (return == 0)):
     return++
 
 if ((robage > 0) and (status == 2) and (nrg < 10000) and (return != 0)):
     return = 0
     counter2 = 31
     aimdx = 628
 
 if ((robage > 0) and (status == 2) and (shflav != 0) and (shflav != -2) and (return != 0)):
     return = 0
     if (shell < 500):
         mkshell = 500-shell
     strpoison = 500
 
 if ((robage > 0) and (status == 2) and (return != 0)):
     if ((eye5 == 0) or (!isqueen)):
         setaim = angle(hivexpos, hiveypos)
         up = floor(ceil(30 - velup, 0), 30)
     if ((eye5 < 40) and isqueen):
         up = refvelup + 30
     if ((eye5 >= 40) and isqueen):
         shoot = -2
         shootval = 1200
         setaim = angle(refxpos, refypos)
         hivexpos = refxpos
         hiveypos = refypos
         up = refvelup
         dx = refveldx
     if (numties > 0):
         deltie = tiepres
     if (dist(hivexpos,hiveypos) < 200):
         counter++
     else:
         counter = 0
     if (counter > 700):
         status = 1

39
Bug reports / Pausing the simulation keeps using the CPU
« on: May 17, 2008, 04:04:49 PM »
I'm not sure if this is a VirtualBox bug, although it doesn't occur with any other program. Basically, when I click on the 'pause' button, the simulation stops but CPU usage is still maxed out. The "new simulation" dialog, though, when not in Internet Mode, stops using CPU and pauses the simulation, so I use that as a workaround.

This happens with *all* sims and has happened since I started using Darwinbots.

(VirtualBox is a PC emulator much like VMWare or VirtualPC, I use it to run Windows for Darwinbots.)

Oh, and sorry if this is a known problem, I couldn't find it using the search feature.

40
The bot attached to the single veggy in this sim is trying to delete the tie because it is the wrong number (at least, it thinks so, because of this bug), and it is failing because *.tiepres isn't set to the correct value (it is 1, it should be 2).

41
Bug reports / trefnrg returning 0
« on: May 15, 2008, 10:07:53 PM »
Quote from: Trafalgar
Quote from: Peksa
Doesn't *.tiepres .readtie store do that?

Does setting .readtie instantly update the trefvars? If not, then not quite.  

Probably I should set readtie to 1 before anything ties to the bot, since if there is no tie 1 that should be what tiepres will become when another bot ties to us.
Actually, .tiepres will become what the other bot put into .tie, IIRC.

Correct me if I'm wrong

42
Bug reports / trefnrg returning 0
« on: May 15, 2008, 06:38:54 PM »
Quote from: gymsum
The easiest way to read all ties constantly, unless you want the bot to focus, is to use the following gene:

cond
*.......
start
*.timer mod *.numties *.tiepres add .readtie store
stop

It takes the timer (an infitely expanding number and wraps it around the number of ties a bot has), that means every cycle a new tie is read.

Eek. '*.timer mod' doesn't quite do anything (I think you meant '*.timer *.numties mod'), and you're assuming that all the ties are in order - but you could have ties numbered 3, 792, and 29674, and your snippet would check 29674, 29675 and 29676.

43
Internet Mode Commentary / The State of the Simulation
« on: May 13, 2008, 09:31:36 PM »
Hmm, you might know this, but http://xkcd.com/303/

44
Internet Mode Commentary / What's going on with the DB server?
« on: May 11, 2008, 05:47:27 PM »
The only security problems with opening a *single* port for BitTorrent are bugs in BitTorrent itself - just as likely as having bugs in your Web browser, so you really aren't taking a huge risk (except for what you download with it).

45
DNA - General / The Quick guide to making a 1-gene bot
« on: May 11, 2008, 10:51:34 AM »
You have a few "1 add"s - you can replace them with "++"

Also, your NOT operator is actually OR. Put your original "negation" in as NOT

Pages: 1 2 [3] 4 5