Difference between revisions of ".Tin and .Tout"
From WikiManual
m |
m |
||
Line 1: | Line 1: | ||
− | This refers to the [[.tin1]] - [[.tin10]] and [[.tout1]] - [[.tout10]] | + | 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 | + | 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 | ||
Line 26: | Line 26: | ||
stop | stop | ||
− | This will pass target position from one bot to another so the tied bots could help | + | This will pass target position from one bot to another so the tied bots could help one another out. |
+ | |||
+ | [[Sysvar]] | ||
[[Robot DNA]] | [[Robot DNA]] |
Latest revision as of 22: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.