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.


Topics - goffrie

Pages: [1]
1
Off Topic / wxBots
« on: August 23, 2008, 10:29:17 PM »
(Updated!)

wxBots is my personal (re)implementation of Darwinbots in C++. It uses wxWidgets for its GUI, so it looks native on Windows and GTK+-based systems and Box2D for physics. (It also uses AGG as an optional, anti-aliased renderer, and the Boost C++ libraries.) It's at a pretty early state, but it's mostly usable and doesn't crash very much  I licensed it under the very liberal 2-clause BSD license.

It depends on the SVN version of Box2D (revision 172 right now), Boost 1.35.0 or 1.36.0, AGG 2.4 (2.5 works too but it's licensed under the GPL), and wxWidgets 2.8.8 (earlier versions might or might not work). It also needs zlib for loading/saving (XML-based save files are huge, and compression helps a lot).

Attached is the source code and a UPX-compressed Windows binary.

Things which work:
  • Loading most bots
  • Movement (but is calibrated somewhat differently from Darwinbots, I need to fix that)
  • Veggies with either nrg/cycle or nrg/kilobody feeding
  • Shots (with poison, venom, but shell is currently not handled correctly, and viruses don't work because I don't have a gene splitter)
  • Ordinary reproduction (.repro only)
  • Eyes (along with some refvars, eyeXwidth/dir work)
  • Rendering with either native (non-antialiased through wxWidgets) or AGG (anti-aliased, much slower) rendering
  • Dragging bots around and panning with the mouse (note: double clicking on a bot results in a bot properties dialog which shows basic statistics as well as code and memory)
  • Tie shooting, display and (sort of working) physics. No bot interaction yet though other than .tie for shooting, and having a lot of ties messes up the physics - any help on that?
  • Loading and saving in a gzip-compressed XML format
[attachment=980:src.zip]
[attachment=981:wxBots.exe]

2
Bugs and fixes / trefbody redefinition? RESOLVED (NO BUG)
« on: July 02, 2008, 06:43:25 PM »
I'm not too sure of the circumstances behind this (I'm not very familiar with the DB code) but in DNATokenizing.bas 'trefbody' seems to be defined twice, with different values:
Code: [Select]
(...)
  sysvar(66).Name = "trefbody"
  sysvar(66).value = 437
(...)
  sysvar(101).Name = "trefbody"
  sysvar(101).value = 472
(...)
This is from the SVN repository.

3
Darwinbots Program Source Code / NSIS-based installer
« on: June 07, 2008, 07:09:41 PM »
I created an NSIS-based installer for Darwinbots 2.43.1L. It currently installs all the OCX's installed by the original installer as well as msstdfmt.dll (needed for the custom costs dialog), and registers them all. It does not install comdlg32.dll, which is usually already present. If it should be added, tell me. Currently the installed bots consist of Alga Minimalis, Animal Minimalis, Seasnake, and Republican Bee. If you want to recommend any example bots, then do so

I tested it on a brand-new Windows XP SP2 install (hosed my old VirtualBox image thanks to a lack of disk space when merging a snapshot) and it seems to work mostly fine, although for some reason the Settings directory didn't seem to get created (it's in the script though as a recursive copy, although with only default.set).

If you were to make a consistent way of downlloading the newest Darwinbots executable (I.e. in a single place which doesn't change between versions), I could make the installer download the newest version during the installation, using NSISdl. ZIP decompression is also supported in NSIS so that isn't a problem.

The installer is internally compressed with solid LZMA compression so don't bother compressing it again.

(edit: new installer below)

Oh, and here is the NSIS script. It'll need some adjusting to work on Windows since I use it on Linux and it is using Unix-style paths.

Right now, it doesn't uninstall any of the DLLs/OCXs which it installs. If that's an issue I can still add the removal to the uninstall code, but I'd have to add more registry keys to remember whether or not it existed before the installer ran.
Code: [Select]
!include MUI2.nsh
!include VB6RunTime.nsh

Name "DarwinBots 2.4"
OutFile "Darwin_setup.exe"
InstallDir "$PROGRAMFILES\DarwinBots"
InstallDirRegKey HKCU "Software\DarwinBots" ""
RequestExecutionLevel admin
BrandingText " "
XPStyle on
CRCCheck on
SilentInstall normal
SetCompressor /SOLID lzma

Var AlreadyInstalled

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

!insertmacro MUI_LANGUAGE "English"

Section "Install" Install
  SetOutPath "$INSTDIR"

  File "/home/goffrie/Darwinbots/DarwinBotsII/Darwin.exe"
  File "/home/goffrie/Darwinbots/DarwinBotsII/How to setup a DarwinBots server.txt"
  SetOverwrite off
  File "/home/goffrie/Darwinbots/DarwinBotsII/intsett.ini"
  File /r "/home/goffrie/Darwinbots/DarwinBotsII/Robots"
  File /r "/home/goffrie/Darwinbots/DarwinBotsII/Settings"
  SetOutPath "$INSTDIR\Autosave"
  SetOutPath "$INSTDIR\Saves"
  SetOutPath "$INSTDIR\Transfers"
  SetOutPath "$INSTDIR\Transfers\F1"
  SetOutPath "$INSTDIR\Transfers\F1\in"
  SetOutPath "$INSTDIR\Transfers\F1\out"

  SetOutPath "$SYSDIR"

  File "/home/goffrie/Darwinbots/OCX/*.OCX"
  RegDLL "$SYSDIR\COMCT232.OCX"
  RegDLL "$SYSDIR\COMDLG32.OCX"
  RegDLL "$SYSDIR\MSCOMCTL.OCX"
  RegDLL "$SYSDIR\MSINET.OCX"
  RegDLL "$SYSDIR\RICHTX32.OCX"
  RegDLL "$SYSDIR\TABCTL32.OCX"
  File "msstdfmt.dll"
  RegDLL "$SYSDIR\msstdfmt.dll"
  SetOverwrite on

;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.exe"

;Store installation folder
  WriteRegStr HKCU "Software\Darwinbots" "" $INSTDIR

;Install VB runtime
  IfFileExists "$INSTDIR\Darwin.exe" 0 new_installation
    StrCpy $AlreadyInstalled 1
  new_installation:

  !insertmacro VB6RunTimeInstall /home/goffrie/Darwinbots/vb6 $AlreadyInstalled
SectionEnd

Section "Uninstall"

  Delete "$INSTDIR\Darwin.exe"
  Delete "$INSTDIR\How to setup a DarwinBots server.txt"
  Delete "$INSTDIR\intsett.ini"
  Delete "$INSTDIR\Uninstall.exe"
  Delete "$INSTDIR\Robots\Alga_Minimalis.txt"
  Delete "$INSTDIR\Robots\Animal_Minimalis.txt"
  Delete "$INSTDIR\Robots\Gridlock.txt"
  Delete "$INSTDIR\Robots\Republican_Bee.txt"
  Delete "$INSTDIR\Robots\Seasnake_1.0.txt"
  Delete "$INSTDIR\Settings\default.set"
  RMDir "$INSTDIR\Autosave"
  RMDir "$INSTDIR\Robots"
  RMDir "$INSTDIR\Saves"
  RMDir "$INSTDIR\Settings"
  RMDir "$INSTDIR\Transfers\F1\in"
  RMDir "$INSTDIR\Transfers\F1\out"
  RMDir "$INSTDIR\Transfers\F1"
  RMDir "$INSTDIR\Transfers"
  RMDir "$INSTDIR"
  DeleteRegKey /ifempty HKCU "Software\Darwinbots"

;Remove VB runtime
  !insertmacro VB6RunTimeUnInstall
SectionEnd

Gah, another thing I forgot to mention: It doesn't install any shortcuts, I forgot to add it in. I'll put it in... later

4
Darwinbots3 / P2P Internet Mode
« on: May 29, 2008, 08:34:00 PM »
It would be nice if there was a peer-to-peer network of sorts for Internet Mode in Darwinbots3, in which all capable clients would be able to connect to each other directly. Of course, there would still be a central server, but it would reduce the load on the central server, and a relay system could be set up to allow clients behind firewalls to connect to IM (maybe falling back to FTP). It would also be possible this way to have relatively real-time organism exchanges, as the server could tell the clients when a new organism was available and clients could download it as soon as they were told (the server could randomly choose a client to give it to). If the Darwinbots server can't run custom protocols, it could probably be managed over HTTP. The protocol itself should be fairly trivial, as it does not need to support a lot of features (maybe just compression), and efficiency is not a major issue. The only issue I see with this is that many people run behind routers and the system does not really work that way .

Of course, as Darwinbots3 is still early in development, it's not really time just yet to be implementing these kinds of things, but it's just an idea .

5
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):

6
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?

7
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:
  &

8
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

9
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.

10
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).

11
F2 bots / P. Delicious
« on: February 12, 2008, 09:53:27 PM »
Yep, it's my first bot, but it's gone through tons of changes and I think it's pretty good
It should be suitable for F2.

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']
Code: [Select]
' P. Delicious
' Based (somewhat) on "Animal Minimalis"
' Now with extra ____!

' 360 degree vision, shamelessly stolen from 'Beholder'
cond
 *.robage 0 =
start
 420 .eye1dir store
 315 .eye2dir store
 210 .eye3dir store
 105 .eye4dir store
 -105 .eye6dir store
 -210 .eye7dir store
 -315 .eye8dir store
 -420 .eye9dir store
 105 .eye1width store
 105 .eye2width store
 105 .eye3width store
 105 .eye4width store
 105 .eye5width store
 105 .eye6width store
 105 .eye7width store
 105 .eye8width store
 105 .eye9width store
 .shoot .ploc store
 .body .memloc store
stop

' Birth initialization
cond
 *971 0 >
 *.robage 0 =
start
 .tie inc
 *.maxvel 4 div *.vel sub .dn store
stop

' Otherwise
cond
 *971 0 =
 *.robage 0 =
start
 971 inc
stop

' Food Finder
cond
 *.eyef 0 >
 *.refeye *.myeye !=
 *.refaimdx *.myaimdx != or
start
 *.refveldx *.body mult 1000 div .dx store
 *.refvelup *.body mult 1000 div 30 add .up store
 *.refxpos *.refypos angle *.refveldx 2 mult sub .setaim store
 0 .focuseye store
stop

' Eat Food for Nonhostile
cond
 *.eye5 30 >
 *.refeye *.myeye !=
 *.refaimdx *.myaimdx != or
 *.waste 500 <
 *.refshoot 0 =
 *.focuseye 0 =
start
 4 .shootval store
 -1 .shoot store
 *.refvelup *.body mult 1000 div .up store
stop

' Eat Food for Hostile
cond
 *.eye5 40 >
 *.refeye *.myeye !=
 *.refaimdx *.myaimdx != or
 *.waste 500 <
 *.refshoot 0 !=
 *.focuseye 0 =
start
 8 .memval 400 sub sgn 1 add 2 div 8 mult add .shootval store
 -6 .shoot store
 *.refvelup *.body mult 1000 div .up store
stop

' Shoot Waste
cond
 *.eye5 25 >
 *.refeye *.myeye !=
 *.refaimdx *.myaimdx != or
 *.waste 500 >=
 *.focuseye 0 =
start
 -4 .shoot store
 *.waste .shootval store
 *.refvelup *.body mult 1000 div .up store
stop

' Reproduce
cond
 *.nrg 5000 >
 *.body 1000 >
 *50 10 <
 *.poison 20000 >= or
 *.eye5 20 <
 *.totalmyspecies 150 <
start
 10 .repro store
 50 inc
stop

' Roam
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
start
 3 .up store
 4 .aimdx 1 *.aimdx sgn abs sub mult store
stop

' Begin eXtreme inefficiency.
' Any help here in making it more efficient would be appreciated, but it works for now
' "othar" is an intentional misspelling, dont ask

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye -4 =
start
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye -3 =
start
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye -2 =
start
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye -1 =
start
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye 0 =
start
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye 1 =
start
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye 2 =
start
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
 3 .focuseye *.eye8 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye 3 =
start
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
 4 .focuseye *.eye9 sgn mult store
stop

' Detect othars
cond
 *.eyef 0 =
 *.refeye *.myeye =
 *.refaimdx *.myaimdx = and or
 *.focuseye 4 =
start
 3 .focuseye *.eye8 sgn mult store
 2 .focuseye *.eye7 sgn mult store
 1 .focuseye *.eye6 sgn mult store
 0 .focuseye *.eye5 sgn mult store
 -1 .focuseye *.eye4 sgn mult store
 -2 .focuseye *.eye3 sgn mult store
 -3 .focuseye *.eye2 sgn mult store
 -4 .focuseye *.eye1 sgn mult store
stop

' End eXtreme inefficiency

' Retaliate
cond
 *.shflav 0 !=
 *.shflav -2 !=
start
 1256 *.shang sub .aimshoot store
 628 .shootval store
 .aimdx .shoot store
 0 .shflav store
stop

' Store energy
cond
 *.nrg 10000 >
 *.poison 32000 =
 *.body 2000 < or
start
 1000 .strbody store
stop

' Restore energy
cond
 *.nrg 5000 <
 *.body 800 >=
start
 1000 .fdbody store
stop

' Emergency energy restore
cond
 *.nrg 2000 <
 *.pain 200 >=
start
 *.body 10 mult 10 sub .fdbody store
stop

' Create poison
cond
 *.nrg 15000 >
 *.body 2000 >=
 *.poison 32000 <
start
 5000 .mkpoison store
stop

' Unstick
cond
 *.fixed 0 >
start
 .fixpos dec
stop

' Antivirus
cond
 *.mkvirus 0 !=
start
 *.mkvirus .delgene store
stop

' Kill ties
cond
 *.numties 0 !=
start
 *.tiepres .deltie store
stop

end

Pages: [1]