.Tin and .Tout

From WikiManual
Revision as of 20:58, 2 April 2008 by Shasta (talk | contribs) (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...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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