Difference between revisions of ".Tin and .Tout"

From WikiManual
Jump to: navigation, search
(New page: This refers to the .tin1 - .tin10 and .tout1 - .tout10 trefvars locations. The number stored at tout1, tout2 or another tout can be read by any robot tied to the bot, w...)
 
Line 2: Line 2:
  
 
Example of how [[tin]] and [[tout]] can be used:
 
Example of how [[tin]] and [[tout]] can be used:
'Defines two custom variables to be used later, must be placed at top
+
'Defines two custom variables to be used later, must be placed at top
def targetx 50
+
def targetx 50
def targety 51
+
def targety 51
 
+
'Specifies tie to be read, uses the newest one in this example, change this if you want to pick were it is read from
+
'Specifies tie to be read, uses the newest one in this example, change this if you want to pick were it is read from
start
+
start
*.tiepres .readtie store
+
*.tiepres .readtie store
stop
+
stop
 
+
'Check for target and store position to be read
+
'Check for target and store position to be read
start
+
start
*.refeye *.myeye !=
+
*.refeye *.myeye !=
*.eye5 0 != and
+
*.eye5 0 != and
*.refxpos .tout1 store
+
*.refxpos .tout1 store
*.refypos .tout2 store
+
*.refypos .tout2 store
stop
+
stop
 
+
'Check for target position every ten cycles
+
'Check for target position every ten cycles
start
+
start
*.robage 10 mod 0 =  'Every ten cycles this will return true
+
*.robage 10 mod 0 =  'Every ten cycles this will return true
*.tin1 .targetx store
+
*.tin1 .targetx store
*.tin2 .targety store
+
*.tin2 .targety store
stop
+
stop
 
 
  
 
This will pass target position from one bot to another so the tied bots could help on another out.
 
This will pass target position from one bot to another so the tied bots could help on another out.
  
 
[[Robot DNA]]
 
[[Robot DNA]]

Revision as of 22:00, 2 April 2008

This refers to the .tin1 - .tin10 and .tout1 - .tout10 trefvars locations. The number stored at tout1, tout2 or another tout can be read by any robot tied to the bot, with the value arriving at tin1, in2 or another tin respectively. These work just like any other trefvar.

Example of how tin and tout can be used:

'Defines two custom variables to be used later, must be placed at top
def targetx 50
def targety 51

'Specifies tie to be read, uses the newest one in this example, change this if you want to pick were it is read from
start
*.tiepres .readtie store
stop

'Check for target and store position to be read
start
*.refeye *.myeye !=
*.eye5 0 != and
*.refxpos .tout1 store
*.refypos .tout2 store
stop

'Check for target position every ten cycles
start
*.robage 10 mod 0 =  'Every ten cycles this will return true
*.tin1 .targetx store
*.tin2 .targety store
stop

This will pass target position from one bot to another so the tied bots could help on another out.

Robot DNA