Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #debuglevel 10
- var secondsToWait 10
- var startingRoom $roomid
- action var someoneFound 1 when You hear someone
- start:
- if_1 goto ROOM.PROCESS
- gosub LOG.NOTIFY No room found
- gosub LOG.NOTIFY Heading back to %startingRoom
- gosub TRAVEL.ROOM %startingRoom
- put #parse ZROOM FAIL
- goto end
- ROOM.PROCESS:
- gosub TRAVEL.ROOM %1
- gosub ROOM.CHECK
- gosub TIME.WAIT
- if (%someoneFound > 0) then goto ROOM.ADVANCE
- gosub LOG.NOTIFY Empty room located : $roomid
- put #parse ZROOM SUCCESS
- goto end
- ROOM.CHECK:
- gosub ROOM.CHECK.PLAYERS
- if contains("$roomobjs", "and some other") then goto ROOM.ADVANCE
- if ("$monsterlist" != "") then goto ROOM.CHECK.SEARCH
- goto ROOM.CHECK.DONE
- return
- ROOM.CHECK.PLAYERS:
- if ("$roomplayers" != "") then goto ROOM.ADVANCE
- return
- ROOM.CHECK.SEARCH:
- matchre ROOM.CHECK.DONE ^You don\'t find anything
- matchre ROOM.ADVANCE ^You see signs that someone is about|^You notice
- matchre ROOM.CHECK.SEARCH ...wait
- send search
- matchwait
- ROOM.ADVANCE:
- gosub clear
- shift
- goto start
- ROOM.CHECK.DONE:
- return
- TIME.WAIT:
- timer stop
- gosub TIME.CALC
- var remainingTime 0
- evalmath remainingTime (%secondsToWait - %runTime)
- TIME.WAIT.CHECK:
- if (%remainingTime <= 0) then goto TIME.WAIT.DONE
- if (%remainingTime >= 4) then
- {
- timer clear
- timer start
- gosub ROOM.CHECK.SEARCH
- timer stop
- gosub TIME.CALC
- evalmath remainingTime (%remainingTime - %runTime)
- }
- if (%remainingTime > 0) then
- {
- gosub ROOM.CHECK.PLAYERS
- evalmath remainingTime (%remainingTime - 1)
- pause 1
- }
- goto TIME.WAIT.CHECK
- TIME.WAIT.DONE:
- return
- TIME.CALC:
- evalmath runTime round(%t,0)
- RETURN
- TRAVEL.ROOM:
- var destination $0
- put #goto %destination
- waitfor YOU HAVE ARRIVED
- var someoneFound 0
- timer clear
- timer start
- pause 0.1
- return
- LOG.NOTIFY:
- var message $0
- put #echo >Log Yellow zroom | %message
- put #echo Yellow *** zroom | %message
- return
- end:
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement