Darwinbots Forum
Welcome To Darwinbots => Newbie => Topic started by: zerodexter 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?
-
replace:
1 .NF add store
with
1 *.NF add .NF store
-
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.
-
thank you
-
50 is the traditional custom variable.
Welcome to DB