Author Topic: Why doesn't this work?  (Read 3858 times)

Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Why doesn't this work?
« on: October 18, 2011, 08:51:11 PM »
Well i made a bot and all i was doing was testing communication between them. But it isn't working the way i want. Could you look at it and see whats wrong. What it does is if the type is 0 it is the cell that sends a message and if it is above 0 then it receives it. Bots can only have one tie at a time for now. I used tout1 and tin1 for the communication could you please see what is wrong with this.

Code: [Select]

def type 0

cond
*.type 0 =
*.nrg 4000 >
start
25 .repro store
.type inc
stop

cond
*.refeye *.myeye =
*.numties 1 <
start
.tie inc
stop

cond
*.numties 1 >
start
*.tiepres .deltie store
stop

cond
*.robage 0 =
*.type 1 <
start
-1 .tout1 store
stop

cond
*.tie 0 >
*.type 0 >
*.body 800 <
start
*.tiepres .readtie store
*.tin1 .shoot store
stop

cond
*.multi 1 = or
start
stop

cond
 *.eye5 0 >
 *.refeye *.myeye !=
start
 *.refveldx .dx store
 *.refvelup 30 add .up store
stop

cond
 *.eye5 50 >
 *.refeye *.myeye !=
start
-1 .shoot store
 *.refvelup .up store
stop

cond
 *.eye5 0 =
 *.refeye *.myeye = or
start
 314 rnd .aimdx store
stop


cond
 *.nrg 8000 >
 *.type 20000 =
start
 20 .repro store
.type inc
stop

end




Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Why doesn't this work?
« Reply #1 on: October 19, 2011, 03:12:05 AM »
You're setting type to 0, which isn't really a valid memory location to store things into.  Try setting it to, say, 50.  eg: def type 50

Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Re: Why doesn't this work?
« Reply #2 on: October 19, 2011, 03:05:25 PM »
Ok thanks! Ill tell you if it works.

Offline havingphun

  • Bot Builder
  • **
  • Posts: 54
    • View Profile
Re: Why doesn't this work?
« Reply #3 on: October 23, 2011, 09:55:47 AM »
I changed it to this:

Code: [Select]

def type 50

cond
*.type 0 =
*.nrg 4000 >
start
25 .repro store
.type inc
stop

cond
*.refeye *.myeye =
*.numties 1 <
start
.tie inc
stop

cond
*.numties 1 >
start
*.tiepres .deltie store
stop

cond
*.robage 0 =
*.type 1 <
start
200 .tout1 store
stop

cond
*.tie 0 >
*.type 0 >
*.body 800 <
start
*.tiepres .readtie store
*.tin1 .body store
stop

cond
 *.eye5 0 >
 *.refeye *.myeye !=
start
 *.refveldx .dx store
 *.refvelup 30 add .up store
stop

cond
 *.eye5 50 >
 *.refeye *.myeye !=
start
-1 .shoot store
 *.refvelup .up store
stop

cond
 *.eye5 0 =
 *.refeye *.myeye = or
start
 314 rnd .aimdx store
stop

'Made it have a difficult condition just so its disabled for testing
cond
 *.nrg 8000 >
 *.type 20000 =
start
 20 .repro store
.type inc
stop

end


And the other bot doesn't get bigger. Whats wrong?