Author Topic: DNA Command Question  (Read 1701 times)

Offline AZPaul

  • Bot Builder
  • **
  • Posts: 76
    • View Profile
DNA Command Question
« on: March 20, 2005, 12:16:14 PM »
Quick question for the Gurus:

memloc and memval -- since these are not ref variables centered on eye5 I assume these will populate from that invisible "closest body" just like in1/in2, yes?

Also, console is great debug tool. It says "type help for commands" I type help, nothing happens.  Can I see memory locations on the console? How?  There appear to be a "hand" and a "nose" button. Each returns up/dn/sx/dx values. What are hand/nose?

As always, thanks for the help.

-P

Message modifed 20 March 12:10 Phoenix time.  -P
« Last Edit: March 20, 2005, 02:10:39 PM by AZPaul »

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2554
    • View Profile
    • http://kuro-tejina.com
DNA Command Question
« Reply #1 on: March 20, 2005, 03:36:45 PM »
Quote
memloc and memval -- since these are not ref variables centered on eye5 I assume these will populate from that invisible "closest body" just like in1/in2, yes?

What?  :blink:

Where did you get that idea from?

Memloc and memval most certainly DO work from the eye5 vision and so do in1 and in2.

Memloc is just the location that you are looking for a value let's say you want to find out a bot's current energy level and for some reason you don't want to use *.refnrg, your code would be something like this..

Code: [Select]
cond
*.eye5 0 !=
' check that we are looking at something in eye5
start
.nrg .memloc store
' set memloc value to read enrgy
stop

cond
*.memval 30000 >
start
' Too big. Run away quick!
100 .dn store
stop

memval only reads back the value of the last robot seen in eye5 and will remain at this level until it is overwritten by another viewing.
In this respect it works just like the other "refvars"

 :D  PY  :D
There are 10 kinds of people in the world

Those who understand binary.

and those who don't

:D PY :D

Offline AZPaul

  • Bot Builder
  • **
  • Posts: 76
    • View Profile
DNA Command Question
« Reply #2 on: March 20, 2005, 04:25:30 PM »
Oops. Brain fart.

It is .sexrepro that gets the genome from the invisible "closest body" regardless of the .in1/.in2 values in .eye5.  So I can ID a cousin and move in close to her.  Problem is to then make sure there are no invisible closer bots around as I approach her. I'll work on that one. I've avoided using ties up to this point but may have no other choice. Even then, could something behind me be even closer and usurp the mating routine? I Suppose I could alway spin around once to see.

Thanks for the correction.

-P