Author Topic: Eye template  (Read 6927 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Eye template
« on: September 13, 2014, 05:35:36 PM »
I made this for myself to have a better grip on how it works, but maybe it can be helpful for others too.

Code: [Select]
'.eye1 through 9 are located clockwise in numerical order.
'
'Positive numbers are anti-clockwise and negative numbers are clockwise.
'
'Default positions of the eyes are:
'
'.eye1 = 140
'.eye2 = 105
'.eye3 = 70
'.eye4 = 35
'.eye5 = 0
'.eye6 = -35
'.eye7 = -70
'.eye8 = -105
'.eye9 = -140
'
'Eye width:
'
'Smallest = -34
'Default = 0
'Widest = 1221
'
'Below is an example of eye settings.
'
'=====================
'Maximum surveillance:
'
start
 50 .eye5width store
 240 .eye4width store
 240 .eye6width store
 277 .eye1width store
 277 .eye9width store
 -20 .eye3width store
 -20 .eye2width store
 -20 .eye7width store
 -20 .eye8width store
stop

start
 145 .eye4dir store
 -145 .eye6dir store
 333 .eye1dir store
 -333 .eye9dir store
stop

start
 *.robage .eye3dir store
stop

start
 *.robage sub .eye2dir store
stop

start
 *.robage .eye7dir store
stop

start
 *.robage sub .eye8dir store
stop

cond
 *.robage 2
start
 0 .focuseye store
stop

cond
 *.robage 4 mod 0 =
start
 -1 .focuseye store
stop

cond
 *.robage 4 mod 1 =
start
 1 .focuseye store
stop

cond
 *.robage 5 mod 0 =
start
 -4 .focuseye store
stop

cond
 *.robage 5 mod 1 =
start
 4 .focuseye store
stop

cond
 *.robage 6 mod 0 =
start
 -5 .focuseye store
stop

cond
 *.robage 6 mod 1 =
start
 2 .focuseye store
stop

cond
 *.robage 7 mod 0 =
start
 -2 .focuseye store
stop

cond
 *.robage 7 mod 1 =
start
 3 .focuseye store
stop

end
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Re: Eye template
« Reply #1 on: September 13, 2014, 05:56:37 PM »
Uuuhh... I just realised that anything based on .robage only works for 32000 cycles.  :glare:
The internet is corrupt and controlled by criminally minded people.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Eye template
« Reply #2 on: September 13, 2014, 06:09:32 PM »
def robage2 998
def robage1 997
cond
start
.robage1 inc
stop

cond
*.robage1 32000 =
start
.robage2 inc
stop

'actual age =  *.robage *.robage2 32000 mult add 32000 mod
'close enough, play with it...

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Re: Eye template
« Reply #3 on: September 13, 2014, 06:36:46 PM »
Wow! The bot gets a second childhood!  :D Thanks.
The internet is corrupt and controlled by criminally minded people.

Offline Shadowgod2

  • Bot Destroyer
  • ***
  • Posts: 387
    • View Profile
Re: Eye template
« Reply #4 on: September 13, 2014, 08:28:29 PM »
def robage2 998
def robage1 997
cond
start
.robage1 inc
stop

may i modify this to:

cond
*.robage 32000 =
start
.robage1 inc
stop

but if we're going there how about this:

def robagemult 50
def robage1 51

cond
*.robage 32000 =
start
.robage1 inc
stop

cond
*.robage1 32000 =
start
0 .robage1 store
.robagemult inc
stop

now bots have 32000 childhoods :D (yes i have had some bots over 100,000 cycles old before usually bigbirthas)
« Last Edit: September 13, 2014, 09:36:53 PM by Shadowgod2 »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Eye template
« Reply #5 on: September 13, 2014, 08:36:55 PM »
Ding! Ding! Ding! Ding!

Then you simply use

Code: [Select]
*.robage1 *.robagemult 32000 multi add 32000 add

Good find Shadowgod2  :)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Re: Eye template
« Reply #6 on: September 13, 2014, 08:56:47 PM »
Cool! I'll try it out tomorrow. Let me just show you what I tried:

Code: [Select]
def robage2 998
def robage1 997

start
 *.robage *.robage1 32000 mult add 32000 mod
stop

cond
 *.robage 32000 =
start
 .robage1 inc
stop

cond
 *.robage1 256 =
start
  100 .mkpoison store
stop

start
 *.robage1 *.robage2 32000 mult add 32000 mod
stop

cond
 *.robage1 32000 =
start
 .robage2 inc
stop

cond
 *.robage2 256 =
start
 100 .mkvenom store
stop

I expected the bot to make venom at 64512 cycles but instead it made poison again like it did at 32256 cycles. Why is that?

I have to go to bed now. It's almost 3 am here.  :sleepin:
The internet is corrupt and controlled by criminally minded people.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Eye template
« Reply #7 on: September 13, 2014, 09:33:50 PM »
Testlund in a more serious programming language people always write 2 + 2 = 4 as 4 = 2 + 2, review my posts, good night.  :sleepin:

Offline Shadowgod2

  • Bot Destroyer
  • ***
  • Posts: 387
    • View Profile
Re: Eye template
« Reply #8 on: September 13, 2014, 09:39:06 PM »
oops i forgot the *.robage 32000 =

all fixed now :D

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Eye template
« Reply #9 on: September 13, 2014, 09:49:06 PM »
lol, shadow now has 32000 x 23000 childhoods. That will not work as it can not handle bigger then a long as follows: I am more interested in usage, say modulated between 0 and 100 = *.robage *.robage1 32000 mult add 101 mod. Meaning it will give you a number between 0 and 100. :sleepin:

Offline Shadowgod2

  • Bot Destroyer
  • ***
  • Posts: 387
    • View Profile
Re: Eye template
« Reply #10 on: September 13, 2014, 10:13:37 PM »
oh i had also made a simple eye scanning today too

start
*.robage 9 mod 4 sub .focuseye store
stop

now with the new code:

start
*.robage1 *.robagemult 32000 mult add *.robage add 9 mod 4 sub .focuseye store
stop

it doesn't seem to be storing anything in .robagemult though

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Eye template
« Reply #11 on: September 13, 2014, 10:21:49 PM »
lol, I know it is a pointless exercise, I just want people to get the math involved without spelling anything out. That does not make them better programmers. If you take  a + 4 mod 4 it is going to be equal to a mod 4. duh!

It becomes useful as Numsgil exposed math to conditions a while back, you can for example get away with

cond
*.robage *.robage1 32000 mult add
32000 777 add >
start
...
stop

I am really going to sleep now  :)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Re: Eye template
« Reply #12 on: September 14, 2014, 07:00:53 AM »
Well, that's my problem. I suck at math. With these operators I can't figure out what exactly is being calculated, so it becomes all trial and error for me.

OK, let's see what I can do with your examples...
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Re: Eye template
« Reply #13 on: September 14, 2014, 07:15:38 AM »
Testlund in a more serious programming language people always write 2 + 2 = 4 as 4 = 2 + 2, review my posts, good night.  :sleepin:

Yeah, I'm aware of the reversed polish notation or whatever it's called, otherwise I wouldn't have gotten this far. But I don't understand why the .robage2 instruction wasn't executed in my example.
The internet is corrupt and controlled by criminally minded people.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Re: Eye template
« Reply #14 on: September 14, 2014, 07:55:02 AM »
I'm getting the same problem here. The first instruction to move forward is carried out, but not the second where it's supposed to move backwards.

Code: [Select]
def robagemult 50
def robage1 51

start
 *.robage1 *.robagemult 32000 multi add 32000 add
stop

cond
 *.robage 32000 =
start
 .robage1 inc
 .up inc
stop

cond
 *.robage1 32000 =
start
 0 .robage1 store
 .robagemult inc
 .dn inc
stop
The internet is corrupt and controlled by criminally minded people.