MoveInclude (script)

From Elanthipedia
Jump to navigation Jump to search
MoveInclude (script)
Category utility
Front-end Genie
Author Gavinne


Save as move.cmd

Move.cmd is an INCLUDE. to use it add the text 'include move.cmd' at the top or bottom of your script. Anytime you need your script to travel simply put 'gosub move DESTINATION'

EXAMPLE:

include move.cmd

gosub move pond
put wave gybrush
pause 5
gosub move ne gate
gosub move faldesu
gosub move riverhaven
echo Now we're in riverhaven!
gosub move faldesu
gosub move crossing
gosub move crossing
gosub move pond
echo Now we're back at the pond in crossing!
#MOVE INCLUDE SCRIPT
goto move.end
move.retry:
         math move.retry add 1
         if %move.retry > 3 then goto move.fail
         echo ***
         echo *** Retrying move to $1 $2 in %move.retry second(s).
         echo ***
         pause %move.retry
         goto move.goto
move:
         var move.skip 0
         var move.retry 0
         var move.fail 0
         var move.room $0
         if "%move.room" = "$roomid" then return
move.goto:
         matchre move.return ^YOU HAVE ARRIVED
         matchre move.skip ^SHOP CLOSED
         matchre move.retry ^MOVE FAILED
         matchre move.fail ^DESTINATION NOT FOUND
         match move.return (You have arrived|you have arrived)
         match move.retry can't do that while entangled in a web.
         put #goto %move.room
         matchwait
move.fail:
         var move.fail 1
         goto move.return
move.skip:
         var move.skip 1
move.return:
         return
move.end: