All pastes #142131 Raw Edit

Stuff

public text v1 · immutable
#142131 ·published 2006-08-21 08:52 UTC
rendered paste body
set %pointx . 1 998   ;;START HERE X
set %pointy . 1 511    ;;START HERE Y
set %pointx . 2 998
set %pointy . 2 530
set %pointx . 3 982
set %pointy . 3 530
set %pointx . 4 982
set %pointy . 4 511

set %cnt 2

set %targetX %pointx . %cnt
set %targetY %pointy . %cnt

initevents

loop:
 gosub walkAround
 wait 60
 goto loop


sub walkAround
 if #charposx < %targetX
 {
  set %goX ( #charposx + 1 )
  set %goY #charposy
  _wait:
   move %goX %goY 0
   if #charposx <> %goX
   {
    wait 1
    goto _wait
   }
 }

 if #charposx > %targetX
 {
  set %goX ( #charposx - 1 )
  set %goY #charposy
  _wait:
   move %goX %goY 0
   if #charposx <> %goX
   {
    wait 1
    goto _wait
   }
 }

 if #charposy > %targety
 {
  set %goX #charposx
  set %goY ( #charposy - 1 )
  _wait:
   move %goX %goY 0
   if #charposx <> %goX
   {
    wait 1
    goto _wait
   }
 }

 if #charposy < %targety
 {
  set %goX #charposx
  set %goY ( #charposy + 1 )
  _wait:
   move %goX %goY 0
   if #charposx <> %goX
   {
    wait 1
    goto _wait
   }
 }

 if #charposx = %targetX && #charposy = %targetY
 {
  if %cnt < 4
   set %cnt %cnt + 1
  else
   set %cnt 1

  set %targetX %pointx . %cnt
  set %targetY %pointy . %cnt
 }
return