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...)
 
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
+
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, tin2 or another tin respectively. These work just like any other [[TrefVar]].
  
Example of how [[tin]] and [[tout]] can be used:
+
Example of how .tinX and .toutX 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
 +
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
  
'Specifies tie to be read, uses the newest one in this example, change this if you want to pick were it is read from
+
This will pass target position from one bot to another so the tied bots could help one another out.
start
 
*.tiepres .readtie store
 
stop
 
  
'Check for target and store position to be read
+
[[Sysvar]]
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]]
 
[[Robot DNA]]

Latest revision as of 23:05, 30 October 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, tin2 or another tin respectively. These work just like any other TrefVar.

Example of how .tinX and .toutX 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 one another out.

Sysvar

Robot DNA