Author Topic: Stubborn conditional  (Read 3760 times)

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
Stubborn conditional
« on: January 09, 2008, 12:38:48 PM »
I don't get it. I've got this code:

Code: [Select]
start
...
clearbool

*.waste 100 >
*.waste .shootval store
-4 .shoot store
clearbool

And the waste shoot executes always.

But if I use:

Code: [Select]
start
...
clearbool

*.waste 100 >
-4 .shoot store
*.waste .shootval store
clearbool

The condition works right. Why? I'm using 2.43y.
« Last Edit: January 09, 2008, 12:43:28 PM by MacadamiaNuts »
Sometimes you win, and sometimes you lose...

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Stubborn conditional
« Reply #1 on: January 09, 2008, 12:42:05 PM »
Perhaps the bot is aquiring waste every cycle.  Perhaps it's a bug.  I will need a sim to investigate.
Many beers....

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
Stubborn conditional
« Reply #2 on: January 09, 2008, 01:24:36 PM »
Gimme some time. I'm trying to replicate it with a simpler bot, cos LF7 is nightmarish.
Sometimes you win, and sometimes you lose...

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
Stubborn conditional
« Reply #3 on: January 09, 2008, 02:06:33 PM »
Nailed it. There was a duplicated store lower in the code, like:

Code: [Select]
*.waste 100 >
*.waste .shootval store
-4 .shoot store
clearbool
(properly coded stuff)
store

Without the clearbool between, nothing happened, but with the clearbool, the command  was executed.
« Last Edit: January 09, 2008, 02:07:18 PM by MacadamiaNuts »
Sometimes you win, and sometimes you lose...