Author Topic: Would this work?  (Read 4048 times)

Offline kage

  • Bot Neophyte
  • *
  • Posts: 49
    • View Profile
Would this work?
« on: April 14, 2007, 10:16:47 PM »
Could I use this if I wanted my bot to shoot nrg towards fellow bots when it was full of nrg anyways, to serve as a kind of medic?

Code: [Select]
' Medic Gene
cond
 *.eye5 0 =
  *.nrg 32000 >
  *.refeye *.myeye = or
start
-2 .shoot store
 *.refvelup .up store
stop

Offline abyaly

  • Bot Destroyer
  • ***
  • Posts: 363
    • View Profile
Would this work?
« Reply #1 on: April 14, 2007, 11:13:19 PM »
This gene would execute
If [(eye5 > 0) && [(nrg > 32000) || (refeye = myeye)]]

So the *.nrg 32000 > part will always be false since you cant have more than 32000 energy.
But the gene would still execute every time the bot sees a conspec, reguardless of how much energy it has.
Lancre operated on the feudal system, which was to say, everyone feuded all
the time and handed on the fight to their descendants.
        -- (Terry Pratchett, Carpe Jugulum)

Offline kage

  • Bot Neophyte
  • *
  • Posts: 49
    • View Profile
Would this work?
« Reply #2 on: April 15, 2007, 09:52:28 AM »
So then maybe set it down to like 25000?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Would this work?
« Reply #3 on: April 15, 2007, 08:12:15 PM »
Probably, though the conditions are still odd.  The way it works now, the bot would fire nrg out only after[/ the conspec it saw is no longer visible.

I would change it to something like:

' Medic Gene
cond
  *.eye5 0 >
  *.refeye *.myeye =
  *.nrg 25000 >
start
-2 .shoot store
*.refvelup .up store
stop
« Last Edit: April 15, 2007, 08:12:35 PM by Numsgil »

Offline Light

  • Bot Destroyer
  • ***
  • Posts: 245
    • View Profile
Would this work?
« Reply #4 on: April 19, 2007, 06:00:10 AM »
maybe add in *.refnrg 1000 < to only shoot at bots that are low on energy