Author Topic: custom labels? noob problem  (Read 4221 times)

Offline zerodexter

  • Bot Neophyte
  • *
  • Posts: 2
    • View Profile
custom labels? noob problem
« on: October 02, 2006, 07:24:37 AM »
hi everyone, Db is great!  

I just started programming my first bots from scratch, but I have a problem with custom labels as they don't seem to be 'accessible' to me?

here's a very short example of the code:

'ZDbot

def NF 1

cond
  *.eye1 0 =
  *.eye2 0 =
  *.eye3 0 =
  *.eye4 0 =
  *.eye5 0 =
  *.eye6 0 =
  *.eye7 0 =
  *.eye8 0 =
  *.eye9 0 =
start
  314 .aimdx store
  1 .NF add store
stop

cond
  *.NF 5 >
start
  10 .up store
  1 .NF store
stop

end

what I'm trying to do is simple: let the bot do a 360° scan and if it doesn't find anything, let it move a bit and do another scan.
problem is, the NF variable is never increased and I've got no idea why  

any ideas?

Offline kenstauffer

  • Bot Neophyte
  • *
  • Posts: 12
    • View Profile
custom labels? noob problem
« Reply #1 on: October 02, 2006, 09:13:12 AM »
replace:

Quote
1 .NF add store

with

Quote
1 *.NF add .NF store

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
custom labels? noob problem
« Reply #2 on: October 02, 2006, 10:54:58 AM »
Also try to use memory locations that are not already taken by existing sysvars (sysem variables)
You chose 1 as your memory location for NF. 1 is already used by .up so it will obey various criteria laid down for that sysvar.
First, any value placed in memory location 1 will be acted upon by making yoour bot accelerate forward by that values
Second, memory location 1 is wiped at the end of every cycle so your value will be lost.

Try opening up the sysvars2.21.txt file (in your DB root directory) with notepad and look at the list of sysvars and their associated memory locations then use a free location for your custom variables.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline zerodexter

  • Bot Neophyte
  • *
  • Posts: 2
    • View Profile
custom labels? noob problem
« Reply #3 on: October 02, 2006, 11:41:45 AM »
thank you  

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
custom labels? noob problem
« Reply #4 on: October 02, 2006, 11:07:53 PM »
50 is the traditional custom variable.

Welcome to DB