Shroomism

Move

Jul 9th, 2014
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. #debuglevel 5
  2.  
  3.  
  4. goto move.end
  5. move.retry:
  6. math move.retry add 1
  7. if %move.retry > 3 then goto move.fail
  8. echo ***
  9. echo *** Retrying move to $1 $2 in %move.retry second(s).
  10. echo ***
  11. pause %move.retry
  12. goto move.goto
  13. move:
  14. var move.skip 0
  15. var move.retry 0
  16. var move.fail 0
  17. var move.room $0
  18. move.goto:
  19. matchre move.return ^YOU HAVE ARRIVED
  20. matchre move.skip ^SHOP CLOSED
  21. matchre move.retry ^MOVE FAILED
  22. matchre move.fail ^DESTINATION NOT FOUND
  23. put #goto %move.room
  24. matchwait
  25. move.fail:
  26. var move.fail 1
  27. goto move.return
  28. move.skip:
  29. var move.skip 1
  30. move.return:
  31. pause 0.1
  32. pause 0.1
  33. return
  34.  
  35.  
  36.  
  37. walk:
  38. var alsohere no
  39. var People.Room empty
  40. var critter no
  41. var todo $0
  42. var move.direction $0
  43. move1:
  44. var location moving
  45. moving:
  46. matchre stand.then.move ^You must be standing to do that\.|^You can't do that while lying down\.|^Stand up first\.|You can't do that while kneeling\.
  47. matchre pause.then.move %retry.command.triggers|You are too tired|All this climbing back and forth is getting a bit tiresome|^You work against the current
  48. matchre retreat.from.melee.then.move ^You are engaged to .+ melee range\!|^You try to move, but you're engaged\.|^While in combat\?|^You can't do that
  49. matchre retreat.from.pole.then.move ^You are engaged to .+ at pole weapon range\!|^While in combat\?|You'll have better luck if you first retreat\.
  50. matchre Dig.then.move ^You struggle forward
  51. matchre Dig.then.move ^Like a blind, lame duck, you wallow in the mud
  52. matchre Dig.then.move ^The mud holds you tightly
  53. matchre Dig.then.move ^You find yourself stuck in the mud
  54. matchre stow.then.move ^Free up your hands first
  55. matchre walk.return ^Obvious|It's pitch dark and you can't see a thing
  56. matchre move.error ^You can't go there\.|^You can't swim in that direction\.
  57. put %move.direction
  58. GOTO retry
  59. stand.then.move:
  60. gosub stand
  61. goto moving
  62. pause.then.move:
  63. pause .2
  64. goto moving
  65. retreat.from.melee.then.move:
  66. put retreat
  67. retreat.from.pole.then.move:
  68. gosub stand
  69. put retreat
  70. goto moving
  71. move.error:
  72. echo * Bad move direction, will try next command in 1 second. *
  73. put .alert
  74. pause
  75. return
  76. walk.return:
  77. pause 0.1
  78. return
  79. Dig.then.move:
  80. pause .1
  81. put dig %move.direction
  82. pause .5
  83. pause .5
  84. goto moving
  85. stow.then.move:
  86. GOSUB stow
  87. goto moving
  88.  
  89.  
  90. moveRandomDirection:
  91. if $east then
  92. {
  93. put east
  94. return
  95. }
  96. if $north then
  97. {
  98. put north
  99. return
  100. }
  101. if $northeast then
  102. {
  103. put northeast
  104. return
  105. }
  106. if $southeast then
  107. {
  108. put southeast
  109. return
  110. }
  111. if $south then
  112. {
  113. put south
  114. return
  115. }
  116. if $southwest then
  117. {
  118. put southwest
  119. return
  120. }
  121. if $west then
  122. {
  123. put west
  124. return
  125. }
  126. if $northwest then
  127. {
  128. put northwest
  129. return
  130. }
  131. if $out then
  132. {
  133. put out
  134. return
  135. }
  136. if $up then
  137. {
  138. put up
  139. return
  140. }
  141. if $down then
  142. {
  143. put down
  144. return
  145. }
  146. echo no random direction possible? looking to attempt to reset room exit vars
  147. #might need a counter here to prevent infinite loops
  148. put look
  149. waitforre ^Obvious
  150. pause
  151. goto moveRandomDirection
  152.  
  153. move.end:
Advertisement
Add Comment
Please, Sign In to add comment