Advertisement
Guest User

MAZE

a guest
Jan 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.10 KB | None | 0 0
  1. #########################################################################
  2. # DROUGHTMAN'S MAZE UBER SCRIPT
  3. # BY SHROOM 2018
  4. # Shroom#0046 - Discord
  5. #
  6. # SCRIPT SHOULD NOW ONLY WAND PLAYERS WHO HAVE GOTTEN THE GOLDEN KEY
  7. # (Will no longer wand everyone it sees)
  8. # It creates a whitelist of users who get the key during a run
  9. # And will also look at players to see if they have a key
  10. #
  11. ##########################################################################
  12. # SET LOOP TO YES TO GO IN CONTINUAL LOOPS
  13. var LOOP YES
  14.  
  15. # SET THE PLAYERS TO ~NOT~ WAND
  16. var no.attack.list Wenwick
  17.  
  18.  
  19. Actions:
  20. action goto FINISHED when The noise from the cheering spectators, although muffled, can still be heard|Muffled noise from cheering spectators echoes off the walls of this cool room
  21. action goto WINNER when You also see a golden arch
  22. action goto KIT when This appears to be a preparation room for the maze contestants
  23. action goto MAIN when ^You feel mobility returning to your limbs
  24. action goto MAIN when ^With immense focus
  25. action goto KHRI when ^It's pitch dark
  26. action goto KIT when cheers the spieler, taking your hand and escorting you away
  27. action echo **** GOT A GOLDEN KEY!!! SEARCHING FOR THE WHITE DOOR! IGNORING ROPES! when ^You pick up a golden key
  28. action instant put #tvar whitelist $1|$whitelist;echo Adding $1 to Wand Whitelist! when (\S+) just found a golden key\!
  29. if !def(whitelist) then put #tvar whitelist null
  30.  
  31. var doorcount 0
  32. var searchloop 0
  33. var timeloop 0
  34. var wandwave 0
  35. var CAMP OFF
  36. var AUTOWAND YES
  37. put #echo >Log *** Droughtman's Maze Uber Script by Shroom
  38. if ($invisible = 1) then send khri stop silence vanish
  39. if_1 then goto %1
  40. if matchre("$roomname","(Droughtman's Compound, The Maze)") then
  41. {
  42. echo *** STARTING SCRIPT FROM INSIDE MAZE
  43. goto MAIN
  44. }
  45. if matchre("$roomname","(Droughtman's Maze, Contestant's Box)") then
  46. {
  47. echo *** GEARING UP
  48. goto MAIN
  49. }
  50. if matchre("$roomobjs","(colorfully garbed maze spieler)") then put ask spieler about access
  51. pause 0.5
  52. if !matchre("$roomobjs","(colorfully garbed maze spieler)") then goto ERROR
  53. TOP:
  54. #WHITELIST
  55. put #tvar whitelist null
  56. #action instant when ($1) has prevailed over Droughtman's Maze\!
  57. var whitelist $whitelist
  58. eval whitelist replace("%whitelist", "null", "")
  59. eval whitelist replace("%whitelist", "||", "|")
  60. put #var whitelist %whitelist
  61. ###
  62. REDEEM:
  63. pause 0.01
  64. pause 0.01
  65. if ($invisible = 1) then send khri stop silence vanish
  66. pause 0.2
  67. send get pass
  68. pause 0.5
  69. if ($invisible = 1) then send khri stop silence vanish
  70. matchre REDEEM2 ^Once you redeem
  71. matchre DONE ^The REDEEM verb
  72. put redeem pass
  73. matchwait 15
  74.  
  75. REDEEM2:
  76. pause 0.1
  77. put redeem pass
  78. pause 0.5
  79. pause 0.3
  80. gosub stowing
  81. pause 0.2
  82. pause 0.3
  83. if ($invsible = 1) then
  84. {
  85. send khri stop silence vanish
  86. pause 0.2
  87. }
  88. put ask spieler about access
  89. pause 0.5
  90.  
  91. KIT:
  92. pause 0.5
  93. CHECK.KIT:
  94. pause 0.1
  95. pause 0.4
  96. matchre ARMOR (gauntlets|gloves|shield|claw guards|steel mail gloves|parry stick|handwraps|\bhat\b|hand claws|jacket|armwraps|footwraps|aegis|buckler|\bhood\b|\bcowl\b|\bheater|pavise|scutum|shield|sipar|\btarge\b|aventail|backplate|balaclava|barbute|bascinet|breastplate|\bcap\b|coat|cowl|cuirass|fauld|greaves|hauberk|helm|\bhood\b|jerkin|leathers|lorica|mantle|mask|morion|pants|(?<=(field|fluted|full|half) )\bplate\b|handguards|robe|sallet|shirt|sleeves|ticivara|tabard|tasset|thorakes|\blid\b|vambraces|vest|collar|coif|mitt|steel mail)
  97. matchre START ^In the
  98. send look in my back
  99. matchwait 15
  100. goto START
  101.  
  102. ARMOR:
  103. pause 0.1
  104. var armor $0
  105. put get %armor from my back
  106. send swap
  107. pause 0.5
  108. pause 0.3
  109. if matchre("$lefthandnoun","(shield|buckler|targe|aegis|sipar)") then send adjust my $lefthand
  110. pause 0.2
  111. pause 0.5
  112. send wear %armor
  113. pause 0.5
  114. pause 0.5
  115. if ("$lefthand" != "Empty") then send drop $lefthand
  116. pause 0.5
  117. pause 0.1
  118. pause 0.2
  119. goto CHECK.KIT
  120.  
  121. WEAPON:
  122. var weapon $0
  123. put get %weapon
  124. pause 0.5
  125. goto CHECK.KIT
  126.  
  127. START:
  128. pause 0.2
  129. send get wand
  130. pause 0.5
  131. if ("$Guild" = "Thief") then
  132. {
  133. send khri secure silence liberation
  134. pause 2
  135. pause 0.2
  136. }
  137. if ("$Guild" != "Thief") then
  138. {
  139. send shake wand
  140. pause 0.5
  141. pause 0.2
  142. }
  143. pause 0.3
  144. pause 0.1
  145. send go door
  146. pause 0.1
  147. pause 0.1
  148. pause 0.1
  149. send go door
  150. pause 0.3
  151. pause 0.2
  152. timer clear
  153. timer start
  154.  
  155. MAIN:
  156. delay 0.0001
  157. send look
  158. pause 0.1
  159. pause 0.001
  160. math doorcount add 1
  161. math searchloop add 1
  162. math timeloop add 1
  163. pause 0.001
  164. pause 0.001
  165. if !matchre("$righthandnoun|$lefthandnoun", "wand") then send get wand
  166. if ("$Guild" = "Thief" then
  167. {
  168. if !matchre("$righthandnoun|$lefthandnoun", "key") && ($invisible = 0) && ($concentration > 80) && (%timeloop > 10) then
  169. {
  170. pause 0.1
  171. send khri vanish
  172. var timeloop 0
  173. pause 0.5
  174. pause 0.1
  175. pause 0.2
  176. if $invisible = 0 then send khri silence
  177. pause 0.1
  178. pause 0.1
  179. }
  180. }
  181. if matchre("$roomobjs","(wand)") then send get wand
  182. if matchre("$roomobjs","(key)") then
  183. {
  184. if ($invisible = 1) then
  185. {
  186. pause 0.001
  187. send khri stop silence vanish
  188. pause 0.2
  189. pause 0.1
  190. }
  191. send get key
  192. pause 0.1
  193. }
  194. if ($standing = 0) then send stand
  195. pause 0.001
  196. pause 0.001
  197. gosub SCAN.ROOM
  198. if ($stunned = 1) then
  199. {
  200. pause
  201. goto MAIN
  202. }
  203. pause 0.001
  204. if matchre("$roomobjs","(key)") then
  205. {
  206. if ($invisible = 1) then
  207. {
  208. pause 0.001
  209. send khri stop silence vanish
  210. pause 0.2
  211. pause 0.1
  212. }
  213. send get key
  214. pause 0.1
  215. }
  216. pause 0.001
  217. if matchre("$roomobjs","(white door)") then
  218. {
  219. echo *** FOUND THE WHITE DOOR!
  220. if !matchre("$righthandnoun|$lefthandnoun", "key") then echo NO KEY :(
  221. if matchre("$roomobjs","(healer|scholar|warrior|mage|hunter|scoundrel|maiden|gentleman|farmer|Halfling maiden|Halfling healer|Halfling warrior)") then
  222. {
  223. pause 0.1
  224. var mob $0
  225. if ($invisible = 1) then
  226. {
  227. pause 0.001
  228. put khri stop silence vanish
  229. pause 0.2
  230. pause 0.1
  231. }
  232. send wave wand at %mob
  233. math wandwave add 1
  234. pause 0.4
  235. pause 0.2
  236. }
  237. send go white door
  238. pause 0.5
  239. pause 0.2
  240. if ("%CAMP" = "ON") then goto WHITEDOOR
  241. }
  242. if matchre("$roomobjs","(white lever)") then
  243. {
  244. pause 0.1
  245. if ($invisible = 1) then
  246. {
  247. pause 0.001
  248. put khri stop silence vanish
  249. pause 0.2
  250. pause 0.1
  251. }
  252. send pull white lever
  253. pause 0.5
  254. }
  255. if matchre("$roomobjs","(lever)") then
  256. {
  257. pause 0.1
  258. if ($invisible = 1) then
  259. {
  260. pause 0.001
  261. put khri stop silence vanish
  262. pause 0.2
  263. pause 0.1
  264. }
  265. send pull lever
  266. pause 0.2
  267. pause 0.3
  268. }
  269. if matchre("$righthandnoun|$lefthandnoun", "key") then goto ENDMAIN
  270. if matchre("$roomobjs","(key)") then
  271. {
  272. if ($invisible = 1) then
  273. {
  274. pause 0.001
  275. send khri stop silence vanish
  276. pause 0.2
  277. pause 0.1
  278. }
  279. send get key
  280. pause 0.1
  281. }
  282. if matchre("$roomobjs","(, a rope and a rope)") then
  283. {
  284. if !matchre("$righthandnoun|$lefthandnoun", "key") then
  285. {
  286. if ($invisible = 1) then
  287. {
  288. pause 0.001
  289. put khri stop silence vanish
  290. pause 0.2
  291. pause 0.1
  292. }
  293. send pull third rope
  294. pause 0.2
  295. pause 0.3
  296. }
  297. }
  298. if matchre("$roomobjs","(a rope, a rope|a rope and a rope)") then
  299. {
  300. if !matchre("$righthandnoun|$lefthandnoun", "key") then
  301. {
  302. if ($invisible = 1) then
  303. {
  304. pause 0.001
  305. put khri stop silence vanish
  306. pause 0.2
  307. pause 0.1
  308. }
  309. send pull second rope
  310. pause 0.2
  311. pause 0.3
  312. }
  313. }
  314. if matchre("$roomobjs","(a rope)") then
  315. {
  316. if !matchre("$righthandnoun|$lefthandnoun", "key") then
  317. {
  318. pause 0.2
  319. if ($invisible = 1) then
  320. {
  321. pause 0.001
  322. put khri stop silence vanish
  323. pause 0.2
  324. pause 0.1
  325. }
  326. send pull rope
  327. pause 0.3
  328. pause 0.3
  329. }
  330. }
  331. pause 0.001
  332. if matchre("$roomobjs","(a rope)") then
  333. {
  334. if !matchre("$righthandnoun|$lefthandnoun", "key") then
  335. {
  336. pause 0.1
  337. if ($invisible = 1) then
  338. {
  339. pause 0.001
  340. put khri stop silence vanish
  341. pause 0.2
  342. pause 0.1
  343. }
  344. send pull rope
  345. pause 0.3
  346. pause 0.4
  347. }
  348. }
  349. if matchre("$roomobjs","(key)") then
  350. {
  351. if ($invisible = 1) then
  352. {
  353. pause 0.001
  354. send khri stop silence vanish
  355. pause 0.2
  356. pause 0.1
  357. }
  358. send get key
  359. pause 0.1
  360. }
  361. if matchre("$roomobjs","(door)") && (%doorcount > 3) then
  362. {
  363. if matchre("$roomobjs","(healer|scholar|warrior|mage|hunter|scoundrel|maiden|gentleman|farmer|Halfling maiden|Halfling healer|Halfling warrior)") then
  364. {
  365. var mob $0
  366. if ($invisible = 1) then
  367. {
  368. pause 0.001
  369. put khri stop silence vanish
  370. pause 0.2
  371. pause 0.1
  372. }
  373. send wave wand at %mob
  374. math wandwave add 1
  375. pause 0.4
  376. pause 0.2
  377. }
  378. send go door
  379. var doorcount 0
  380. pause 0.4
  381. }
  382. pause 0.001
  383. if ($stunned) then goto MAIN
  384. if !($standing) then send stand
  385. pause 0.001
  386. pause 0.001
  387. #if matchre("$righthandnoun|$lefthandnoun", "key") && (%searchloop > 16) then gosub SEARCH.KEY
  388. pause 0.001
  389. ENDMAIN:
  390. if matchre("$roomobjs","(key)") then
  391. {
  392. if ($invisible = 1) then
  393. {
  394. pause 0.001
  395. send khri stop silence vanish
  396. pause 0.2
  397. pause 0.1
  398. }
  399. send get key
  400. pause 0.1
  401. }
  402. if matchre("$roomobjs","(wand)") && ("$righthand" = "Empty") then send get wand
  403. if matchre("$roomobjs","(door)") && (%doorcount > 3) then
  404. {
  405. if matchre("$roomobjs","(healer|scholar|warrior|mage|hunter|scoundrel|maiden|gentleman|farmer|Halfling maiden|Halfling healer|Halfling warrior)") then
  406. {
  407. var mob $0
  408. if ($invisible = 1) then
  409. {
  410. pause 0.001
  411. put khri stop silence vanish
  412. pause 0.2
  413. pause 0.1
  414. }
  415. send wave wand at %mob
  416. math wandwave add 1
  417. pause 0.5
  418. pause 0.2
  419. }
  420. send go door
  421. var doorcount 0
  422. pause 0.5
  423. pause 0.1
  424. }
  425. if matchre("$roomobjs","(healer|scholar|warrior|mage|hunter|scoundrel|maiden|gentleman|farmer|Halfling maiden|Halfling healer|Halfling warrior)") then
  426. {
  427. var mob $0
  428. if ($invisible = 1) then
  429. {
  430. pause 0.001
  431. put khri stop silence vanish
  432. pause 0.2
  433. pause 0.1
  434. }
  435. send wave wand at %mob
  436. math wandwave add 1
  437. pause 0.5
  438. pause 0.2
  439. }
  440. if matchre("$roomobjs","(key)") then
  441. {
  442. if ($invisible = 1) then
  443. {
  444. pause 0.001
  445. send khri stop silence vanish
  446. pause 0.2
  447. pause 0.1
  448. }
  449. send get key
  450. pause 0.1
  451. }
  452. gosub MOVE_RANDOM
  453. goto MAIN
  454.  
  455. KHRI:
  456. if ("$Guild" = "Thief") then
  457. {
  458. if matchre("$righthandnoun|$lefthandnoun", "key") then
  459. {
  460. send khri secure liberation sagacity
  461. pause 2
  462. pause 0.3
  463. goto MAIN
  464. }
  465. send khri sight silence liberation
  466. pause 2
  467. pause 0.3
  468. goto MAIN
  469. }
  470. if ("$Guild" != "Thief") then
  471. {
  472. send shake wand
  473. pause 0.5
  474. pause 0.2
  475. }
  476. pause 0.001
  477. goto MAIN
  478.  
  479. WHITEDOOR:
  480. ECHO **** CAMPING THE WHITE DOOR, HOPING TO ZAP SOMEONE WITH A KEY!
  481. if ("$Guild" = "Thief") then
  482. {
  483. send khri sight silence liberation
  484. pause 2
  485. pause 0.2
  486. }
  487. if ("$Guild" != "Thief") then
  488. {
  489. send shake wand
  490. pause 0.5
  491. pause 0.2
  492. }
  493. WHITEDOOR2:
  494. if ($invisible = 0) && ("$Guild" = "Thief") then
  495. {
  496. send khri silence sight liberation
  497. pause
  498. pause 0.5
  499. }
  500. pause 0.1
  501. if ("%AUTOWAND" = "YES") then gosub SCAN.ROOM
  502. if matchre("$roomobjs","(wand)") && ("$righthand" = "Empty") then send get wand
  503. if matchre("$roomobjs","(golden key)") then send get key
  504. pause 0.1
  505. if matchre("$roomobjs","(key)") then send get key
  506. if matchre("$roomobjs","(healer|scholar|warrior|mage|hunter|scoundrel|maiden|gentleman|farmer|Halfling maiden|Halfling healer|Halfling warrior)") then
  507. {
  508. var mob $0
  509. if ($invisible = 1) then
  510. {
  511. pause 0.001
  512. put khri stop silence vanish
  513. pause 0.2
  514. pause 0.1
  515. }
  516. send wave wand at %mob
  517. wait
  518. pause 0.2
  519. }
  520. if matchre("$roomobjs","(a rope)") then
  521. {
  522. if !matchre("$righthandnoun|$lefthandnoun", "key") then
  523. {
  524. if ($invisible = 1) then
  525. {
  526. pause 0.001
  527. put khri stop silence vanish
  528. pause 0.2
  529. pause 0.1
  530. }
  531. send pull rope
  532. pause 0.1
  533. pause 0.3
  534. }
  535. }
  536. if matchre("$righthandnoun|$lefthandnoun", "key") then goto OPENDOOR
  537. pause 0.1
  538. goto WHITEDOOR2
  539. OPENDOOR:
  540. matchre NOKEY ^Although the door itself is open, an emergent wall of light repels your passage
  541. matchre WHITEDOORCLOSED Bonk\!
  542. matchre WINNER ^As you pass through the white door
  543. send go white door
  544. matchwait
  545. WHITEDOORCLOSED:
  546. echo *** OH NO DOOR IS CLOSED! .. WAITING HERE SO WE DONT LOSE IT
  547. goto WHITEDOOR2
  548. NOKEY:
  549. echo **** YOU DON'T HAVE A KEY!!! WAITING FOR A VICTIM....
  550. goto WHITEDOOR2
  551.  
  552. SEARCH.KEY:
  553. pause 0.2
  554. send search my wand
  555. var searchloop 0
  556. pause
  557. pause 0.4
  558. RETURN
  559.  
  560. WINNER:
  561. action remove ^You feel mobility returning to your limbs
  562. action remove ^With immense focus
  563. pause 0.3
  564. pause 0.2
  565. send go arch
  566. if ($invisible = 1) then send khri stop silence vanish
  567. pause 0.5
  568. echo
  569. echo **** WOOHOO!! WINNER WINNER CHICKEN DINNER!!!
  570. pause 2
  571. pause 0.2
  572. send get prize box
  573. pause 0.2
  574. OPENPRIZE:
  575. echo **** Attempting to Open Prize Box
  576. pause
  577. if matchre("$righthandnoun|$lefthandnoun", "box") then send shake my box
  578. if matchre("$righthandnoun|$lefthandnoun", "box") then send turn my box
  579. pause 0.5
  580. pause 0.4
  581. if matchre("$righthandnoun|$lefthandnoun", "box") then send poke my box
  582. if matchre("$righthandnoun|$lefthandnoun", "box") then send pull my box
  583. pause 0.4
  584. pause 0.4
  585. if matchre("$righthandnoun|$lefthandnoun", "box") then send prod my box
  586. if matchre("$righthandnoun|$lefthandnoun", "box") then send push my box
  587. pause 0.4
  588. pause 0.4
  589. pause 0.1
  590. if matchre("$righthandnoun|$lefthandnoun", "box") then send poke my box
  591. if matchre("$righthandnoun|$lefthandnoun", "box") then send yank my box
  592. pause 0.4
  593. pause 0.1
  594. pause 0.5
  595. if matchre("$righthandnoun|$lefthandnoun", "box") then send tap my box
  596. if matchre("$righthandnoun|$lefthandnoun", "box") then send chew my box
  597. pause
  598. pause 0.5
  599. if matchre("$righthandnoun|$lefthandnoun", "box") then goto PRIZEDONE
  600. goto PRIZE
  601. PRIZEDONE:
  602. echo **** COULD NOT OPEN YOUR PRIZE BOX - EXITING SCRIPT TO BE SAFE
  603. echo **** MANUALLY OPEN YOUR PRIZE BOX AND GET YOUR LOOT
  604. echo **** EXIT VIA THE OVAL AND THEN RESTART SCRIPT
  605. exit
  606. PRIZE:
  607. echo **** WOOHOO! Won a $lefthand
  608. put #echo >Log **** Won a Droughtman's Top Prize - $lefthand
  609. send stow $lefthand
  610. pause
  611. goto OPENP
  612. FINISHED:
  613. action remove ^You feel mobility returning to your limbs
  614. action remove ^With immense focus
  615. echo
  616. echo **** RUN COMPLETED
  617. echo
  618. if ($invisible = 1) then send khri stop silence vanish
  619. pause 0.5
  620. OPENP:
  621. pause
  622. pause 0.2
  623. matchre OPENP ^You don't seem to be able to move
  624. matchre PACKAGE ^You open|^That is already
  625. send open my $righthand
  626. matchwait 5
  627. PACKAGE:
  628. pause 0.5
  629. pause 0.2
  630. matchre DROPIT ^There is nothing in there
  631. matchre PACKAGE ^I could not find|^What were you
  632. matchre COIN coin
  633. matchre GETIT (\S+)(\.)
  634. match OPENP That is closed.
  635. send look in my $righthand
  636. matchwait 10
  637. goto DROPIT
  638. COIN:
  639. send get coin
  640. send get coin
  641. pause 0.5
  642. send get coin
  643. pause 0.5
  644. pause 0.2
  645. goto PACKAGE
  646. GETIT:
  647. var item $0
  648. pause 0.2
  649. send get %item from my packag
  650. pause 0.5
  651. pause 0.5
  652. if ("$lefthand" != "Empty") then put #echo >Log Gold **** Droughtman's Maze - Won a $lefthand !
  653. pause 0.3
  654. if ("$lefthand" != "Empty") then send stow %item
  655. pause 0.3
  656. goto PACKAGE
  657. DROPIT:
  658. pause 0.1
  659. if matchre("$roomobjs", "a bucket of viscous gloop|a waste bucket") then send put my package in buck
  660. else send drop my packag
  661. pause 0.7
  662. if ($standing = 0) then send stand
  663. pause 0.2
  664. pause 0.1
  665. if matchre("$roomobjs", "shimmering silver oval") then
  666. {
  667. send go oval
  668. pause 0.5
  669. send go oval
  670. pause 0.5
  671. }
  672. if ($standing = 0) then send stand
  673. pause 0.2
  674. send out
  675. pause 0.8
  676. if ($standing = 0) then send stand
  677. pause
  678. if ("%LOOP" = "YES") then
  679. {
  680. echo
  681. echo LOOP IS **ON***
  682. echo STARTING NEW RUN IN 5 SECONDS...
  683. pause 5
  684. goto TOP
  685. }
  686. goto DONE
  687. ERROR:
  688. echo **** ERROR! NOT IN A RECOGNIZED ROOM!
  689. echo **** FIND THE MAZE SPIELER AND RESTART
  690. echo
  691. pause 2
  692. DONE:
  693. echo **** FINISHED WITH SCRIPT
  694. exit
  695.  
  696. SCAN.ROOM:
  697. # debuglevel 10
  698. var players $roomplayers
  699. eval players replacere("%players", "Also here\:\s+", "")
  700. eval players replacere("%players", "Pirate", "")
  701. eval players replacere("%players", "King of the road", "")
  702. eval players replacere("%players", "\sand", ",")
  703. # eval players replacere("%players", "\swho\s(?:is|has)\s[w'-]+\,", ",")
  704. eval players replacere("%players", "Lord of the Sands", "")
  705. eval players replacere("%players", "Elemental Magic Authority", "")
  706. eval players replacere("%players", "\swho is hidden\,", ",")
  707. eval players replacere("%players", "\swho is hidden\.", ",")
  708. eval players replacere("%players", "\swho is hiding\,", ",")
  709. eval players replacere("%players", "\swho is hiding\.", ",")
  710. eval players replacere("%players", "\swho is invisible\,", ",")
  711. eval players replacere("%players", "\swho is invisible\.", ",")
  712. eval players replacere("%players", "\swho is almost invisible\,", ",")
  713. eval players replacere("%players", "\swho is almost invisible\.", ",")
  714. eval players replacere("%players", "\swho is sitting\,", ",")
  715. eval players replacere("%players", "\swho is sitting\.", ",")
  716. eval players replacere("%players", "\swho is kneeling\,", ",")
  717. eval players replacere("%players", "\swho is kneeling\.", ",")
  718. eval players replacere("%players", "\swho is stunned\,", ",")
  719. eval players replacere("%players", "\swho is stunned\.", ",")
  720. eval players replacere("%players", "\swho is lying down\,", ",")
  721. eval players replacere("%players", "\swho is lying down\.", ",")
  722. eval players replacere("%players", "\swho is in .+ cage\,", ",")
  723. eval players replacere("%players", "\swho is in .+ cage\.", ",")
  724. eval players replacere("%players", "\swho has .+ visage\,", ",")
  725. eval players replacere("%players", "\swho has .+ visage\.", ",")
  726. eval players replacere("%players", "\swho is in a globe of blue fire\,", ",")
  727. eval players replacere("%players", "\swho is in a globe of blue fire\.", ",")
  728. eval players replacere("%players", "\swho is radiating a glowing aura\,", ",")
  729. eval players replacere("%players", "\swho is radiating a glowing aura\.", ",")
  730. eval players replacere("%players", "\swho is emanating a .+ holy aura\,", ",")
  731. eval players replacere("%players", "\swho is emanating a .+ holy aura\.", ",")
  732. eval players replacere("%players", "\swho is who is mounted on .+ horse\,", ",")
  733. eval players replacere("%players", "\swho is who is mounted on .+ horse\.", ",")
  734. eval players replacere("%players", "\swho is shrouded in ghostly flames\,", ",")
  735. eval players replacere("%players", "\swho is shrouded in ghostly flames\.", ",")
  736. eval players replacere("%players", "\swho is surrounded by a fiery mantle\,", ",")
  737. eval players replacere("%players", "\swho is surrounded by a fiery mantle\.", ",")
  738. eval players replacere("%players", "\swho is covered with whitened ridges\,", ",")
  739. eval players replacere("%players", "\swho is covered with whitened ridges\.", ",")
  740. eval players replacere("%players", "\swho is shrouded by swirling grey fog\,", ",")
  741. eval players replacere("%players", "\swho is shrouded by swirling grey fog\.", ",")
  742. eval players replacere("%players", "\swho is darkened by an unnatural shadow\,", ",")
  743. eval players replacere("%players", "\swho is darkened by an unnatural shadow\.", ",")
  744. eval players replacere("%players", "\swho is behind a plexus of azure lines\,", ",")
  745. eval players replacere("%players", "\swho is behind a plexus of azure lines\.", ",")
  746. eval players replacere("%players", "\swho is bathed in pale golden sunlight\,", ",")
  747. eval players replacere("%players", "\swho is bathed in pale golden sunlight\.", ",")
  748. eval players replacere("%players", "\swho is enveloped in a hellish inferno\,", ",")
  749. eval players replacere("%players", "\swho is enveloped in a hellish inferno\.", ",")
  750. eval players replacere("%players", "\swho is shining with a dark golden glow\,", ",")
  751. eval players replacere("%players", "\swho is shining with a dark golden glow\.", ",")
  752. eval players replacere("%players", "\swho is surrounded by a hellish inferno\,", ",")
  753. eval players replacere("%players", "\swho is surrounded by a hellish inferno\.", ",")
  754. eval players replacere("%players", "\swho is behind a plexus of azure lines\,", ",")
  755. eval players replacere("%players", "\swho is behind a plexus of azure lines\.", ",")
  756. eval players replacere("%players", "\swho is shining with a dark golden glow\,", ",")
  757. eval players replacere("%players", "\swho is shining with a dark golden glow\.", ",")
  758. eval players replacere("%players", "\swho is surrounded by .+ shimmering shield\,", ",")
  759. eval players replacere("%players", "\swho is surrounded by .+ shimmering shield\.", ",")
  760. eval players replacere("%players", "\swho is surrounded by .+ circling blades? of ice\,", ",")
  761. eval players replacere("%players", "\swho is surrounded by .+ circling blades? of ice\.", ",")
  762. eval players replacere("%players", "\swho is surrounded by a ring of jagged stone spears at melee range\,", ",")
  763. eval players replacere("%players", "\swho is surrounded by a ring of jagged stone spears at melee range\.", ",")
  764. eval players replacere("%players", "\swho has coalesced into a battle of light and shadow, each warring for dominance\.", ",")
  765. eval players replacere("%players", "\swho has coalesced into a battle of light and shadow, each warring for dominance\,", ",")
  766. eval players replacere("%players", "\swho has coalesced into a battle of light and shadow, each warring for dominance", ",")
  767. eval players replacere("%players", "\slight", ",")
  768. eval players replacere("%players", "\sshadow,", ",")
  769. eval players replacere("%players", "\sdominance\,", ",")
  770. eval players replacere("%players", "\sfire\,", ",")
  771. eval players replacere("%players", "\sdust\,", ",")
  772. eval players replacere("%players", "\sof\,", ",")
  773. eval players replacere("%players", "\sblue\,", ",")
  774. eval players replacere("%players", "\swith\,", "")
  775. eval players replacere("%players", "\sinvisible\,", ",")
  776. eval players replacere("%players", "\.", ", ")
  777. eval players replacere("%players", "\,\s[\w'-]+\s", ", ")
  778. eval players replacere("%players", "\,\s[\w'-]+\s", ", ")
  779. eval players replacere("%players", "\,\s[\w'-]+\s", ", ")
  780. eval players replacere("%players", "\,\s[\w'-]+\s", ", ")
  781. eval players replacere("%players", "\,\s[\w'-]+\s", ", ")
  782. eval players replacere("%players", "\,\s[\w'-]+\s", ", ")
  783. eval players replacere("%players", "\,\s[\w'-]+\s", ", ")
  784. eval players replacere("%players", "\,\s[\w'-]+\s", ", ")
  785. eval players replacere("%players", "\,\s", "|")
  786. var players |%players|
  787. eval players replacere("%players", "\|[\w'-]+\s", "|")
  788. eval players replacere("%players", "\|[\w'-]+\s", "|")
  789. eval players replacere("%players", "\|[\w'-]+\s", "|")
  790. eval players replacere("%players", "\|[\w'-]+\s", "|")
  791. eval players replacere("%players", "\|[\w'-]+\s", "|")
  792. eval players replacere("%players", "\|[\w'-]+\s", "|")
  793. eval players replacere("%players", "\|[\w'-]+\s", "|")
  794. eval players replacere("%players", "\|[\w'-]+\s", "|")
  795. eval players replace("%players", "," "")
  796. eval players replace("%players", "||" "|")
  797. if !("$roomplayers" = "") then echo Players: %players
  798. eval total count("%players", "|")
  799. delay 0.0001
  800. eval player element("%players", 1)
  801. eval number count("%players", "|%player")
  802. var count 0
  803. gosub REMOVE.LOOP
  804. action var player $1 when ^@.* (\S+)$
  805. put #parse @%player
  806. var target %player
  807. if !("$roomplayers" = "") then echo ** Target: %target
  808. counter set %count
  809. if !("$roomplayers" = "") then
  810. {
  811. if matchre("$righthandnoun|$lefthandnoun", "key") then
  812. {
  813. if matchre("%no.attack.list","(%target)") then RETURN
  814. if ($invisible = 1) then put khri stop silence vanish
  815. pause 0.2
  816. pause 0.1
  817. send wave my wand at %target
  818. pause 0.2
  819. pause 0.001
  820. pause 0.001
  821. if %c < 0 then counter set 0
  822. RETURN
  823. }
  824. if matchre("%no.attack.list","(%target)") then RETURN
  825. if !matchre("$whitelist","(%target)") then goto LOOK.CHECK
  826. if ($invisible = 1) then put khri stop silence vanish
  827. pause 0.2
  828. pause 0.1
  829. send wave my wand at %target
  830. pause 0.2
  831. pause 0.001
  832. pause 0.001
  833. }
  834. pause 0.001
  835. if %c < 0 then counter set 0
  836. RETURN
  837. LOOK.CHECK:
  838. pause 0.1
  839. pause 0.1
  840. pause 0.001
  841. matchre WAIT ^\.\.\.wait|^Sorry\,
  842. matchre HAS.KEY a golden key
  843. matchre NO.KEY ^You see|He|She
  844. send look %target
  845. matchwait 6
  846. NO.KEY:
  847. echo *** Target has no Key... Skipping
  848. if %c < 0 then counter set 0
  849. RETURN
  850. HAS.KEY:
  851. echo *** Target has a golden key! Adding to Wand Whitelist!
  852. put #tvar whitelist %target|$whitelist
  853. if %c < 0 then counter set 0
  854. RETURN
  855. REMOVE.LOOP:
  856. delay 0.0001
  857. eval number count("%players", "|%player|")
  858. eval players replace("%players", "|%player|", "|")
  859. eval players replace("%players", "invisible", "")
  860. eval players replace("%players", "almost", "")
  861. eval players replace("%players", "sitting", "")
  862. eval players replace("%players", "flames", "")
  863. eval players replace("%players", "is", "")
  864. eval players replace("%players", "||" "|")
  865. evalmath count %count + %number
  866. if !contains("%players", "|%player|") then return
  867. goto REMOVE.LOOP
  868. #######################################################################################
  869. ######################################################################################
  870. # GOSUBS
  871.  
  872.  
  873. #### PUT SUB
  874. PUT:
  875. delay 0.0001
  876. var command $0
  877. var LOCATION PUT_1
  878. PUT_1:
  879. matchre WAIT ^\.\.\.wait|^Sorry\,
  880. matchre IMMOBILE ^You don't seem to be able to move to do that
  881. matchre WEBBED ^You can't do that while entangled in a web
  882. matchre STUNNED ^You are still stunned
  883. matchre PUT_STOW ^You need a free hand
  884. matchre WAIT ^\[Enter your command again if you want to\.\]
  885. matchre RETURN_CLEAR ^You (?:hand|slide|get|work|pull|shuffle|attach|push|move|put|now|scan|wear|sling|slowly|whisper|lean|tap|spin|filter|pick|silently|slip|realize|stop|open|close|need|drop|place|shouldn't|knock|grab|fade|toss|pour|set|add|offer|search|circle|fake|weave|shove|carefully|attach|remove|tie|try|must|wave|sit|fail|turn|are|can't|aren't|glance|bend|kneel|carefully|quietly|sense|exhale|blow|begin|rub|sprinkle|twist|struggle|vigorously) .*(?:\.|\!|\?)
  886. matchre RETURN_CLEAR ^But (that|you) .*(?:\.|\!|\?)
  887. matchre RETURN_CLEAR ^The|^That|too injured
  888. matchre RETURN_CLEAR ^Roundtime\:?|^\[Roundtime\:?|^\(Roundtime\:?
  889. matchre RETURN_CLEAR ^I could not find what you were referring to\.
  890. matchre RETURN_CLEAR ^Please rephrase that command\.
  891. matchre RETURN_CLEAR ^That is already|has already
  892. matchre RETURN_CLEAR ^Tie it off
  893. matchre RETURN_CLEAR ^What were you referring to\?
  894. matchre RETURN_CLEAR ^.* what\?
  895. matchre RETURN_CLEAR ^Your (?:actions|dance|fingers|song).*\.
  896. matchre RETURN_CLEAR ^You sense that you are as pure of spirit as you can be\, and you are ready for whatever rituals might face you\.
  897. matchre RETURN_CLEAR ^Subservient type|^The shadows|^Close examination|^Try though
  898. matchre RETURN_CLEAR ^USAGE\:
  899. matchre RETURN_CLEAR ^Allows a Moon Mage
  900. matchre RETURN_CLEAR ^A slit across the door
  901. matchre RETURN_CLEAR ^You.*analyze
  902. matchre RETURN_CLEAR ^Having no further use for .*\, you discard it\.
  903. matchre RETURN_CLEAR ^You don't have a .* coin on you\!\s*The .* spider looks at you in forlorn disappointment\.
  904. matchre RETURN_CLEAR ^The .* spider turns away\, looking like it's not hungry for what you're offering\.
  905. matchre RETURN_CLEAR ^Brother Durantine nods slowly\.
  906. matchre RETURN_CLEAR ^Durantine waves a small censer over a neatly-wrapped package and intones a short prayer before he hands it to you\.
  907. matchre RETURN_CLEAR ^After a moment\, .*\.
  908. matchre RETURN_CLEAR ^Quietly touching your lips with the tips of your fingers as you kneel\, you make the Cleric's sign with your hand\.
  909. matchre RETURN_CLEAR ^Maybe you should stand up\.
  910. matchre RETURN_CLEAR ^The clerk counts out .*\.
  911. matchre RETURN_CLEAR ^The gem pouch
  912. matchre RETURN_CLEAR ^An attendant
  913. matchre RETURN_CLEAR ^The .* is not damaged enough to warrant repair\.
  914. matchre RETURN_CLEAR ^There is no more room in .*\.
  915. matchre RETURN_CLEAR ^There is nothing in there\.
  916. matchre RETURN_CLEAR ^In the .* you see .*\.
  917. matchre RETURN_CLEAR ^This spell cannot be targeted\.
  918. matchre RETURN_CLEAR ^You cannot figure out how to do that\.
  919. matchre RETURN_CLEAR ^You will now store .* in your .*\.
  920. matchre RETURN_CLEAR ^That tool does not seem suitable for that task\.
  921. matchre RETURN_CLEAR ^There isn't any more room in .* for that\.
  922. matchre RETURN_CLEAR ^\[Ingredients can be added by using ASSEMBLE Ingredient1 WITH Ingredient2\]
  923. matchre RETURN_CLEAR ^\s*LINK ALL CANCEL\s*\- Breaks all links
  924. matchre RETURN_CLEAR STOW HELP
  925. matchre RETURN_CLEAR ^This ritual may only be performed on a corpse\.
  926. matchre RETURN_CLEAR ^There is nothing else to face\!
  927. matchre RETURN_CLEAR ^You're already stalking
  928. matchre RETURN_CLEAR ^There aren't
  929. matchre RETURN_CLEAR ^An offer
  930. matchre RETURN_CLEAR ^That area
  931. matchre RETURN_CLEAR ^Ylono (?:looks|frowns|shrugs|smiles) .*(?:\.|\!|\?)
  932. matchre RETURN_CLEAR ^Malik (?:nods|shakes) .*(?:\.|\!|\?)
  933. matchre RETURN_CLEAR ^Obvious exits
  934. matchre RETURN_CLEAR ^Obvious paths
  935. matchre RETURN_CLEAR ^But the merchant can't see you|are invisible|^Doing that would
  936. matchre STAND ^You should stand up first\.
  937. # matchre RETURN_CLEAR ^
  938. matchre RETURN ^\s*Encumbrance\s*\:
  939. send %command
  940. matchwait 15
  941. put #echo >$Log Crimson $datetime *** MISSING MATCH IN PUT! ***
  942. put #echo >$Log Crimson $datetime Command = %command
  943. put #echo >Log Crimson $datetime *** MISSING MATCH IN PUT! ***
  944. put #echo >Log Crimson $datetime Command = %command
  945. put #log $datetime MISSING MATCH IN PUT
  946. RETURN
  947. PUT_STOW:
  948. delay 0.0001
  949. gosub EMPTY_HANDS
  950. goto PUT_1
  951.  
  952. STOWING:
  953. delay 0.0001
  954. var LOCATION STOWING
  955. if "$righthand" = "vine" then put drop vine
  956. if "$lefthand" = "vine" then put drop vine
  957. if "$righthandnoun" = "rope" then put coil my rope
  958. if "$righthand" = "bundle" || "$lefthand" = "bundle" then put wear bund;drop bun
  959. #if matchre("$righthandnoun","(crossbow|bow|short bow)") then gosub unload
  960. if matchre("$righthandnoun","(block|granite block)") then put drop block
  961. if matchre("$lefthandnoun","(block|granite block)") then put drop block
  962. if matchre("$righthand","(partisan|shield|buckler|lumpy bundle|halberd|staff|longbow|khuj)") then gosub wear my $1
  963. if matchre("$lefthand","(partisan|shield|buckler|lumpy bundle|halberd|staff|longbow|khuj)") then gosub wear my $1
  964. if matchre("$lefthand","(longbow|khuj)") then gosub stow my $1 in my %SHEATH
  965. if "$righthand" != "Empty" then GOSUB STOW right
  966. if "$lefthand" != "Empty" then GOSUB STOW left
  967. RETURN
  968. STOW:
  969. var LOCATION STOW1
  970. var todo $0
  971. STOW1:
  972. delay 0.0001
  973. if "$righthand" = "vine" then put drop vine
  974. if "$lefthand" = "vine" then put drop vine
  975. matchre WAIT ^\.\.\.wait|^Sorry\,
  976. matchre IMMOBILE ^You don't seem to be able to move to do that
  977. matchre WEBBED ^You can't do that while entangled in a web
  978. matchre STUNNED ^You are still stunned
  979. matchre STOW2 not designed to carry anything|any more room|no matter how you arrange|^That's too heavy|too thick|too long|too wide|^But that's closed|I can't find your container|^You can't
  980. matchre RETURN ^Wear what\?|^Stow what\? Type 'STOW HELP' for details\.
  981. matchre RETURN ^You put
  982. matchre RETURN ^You open
  983. matchre RETURN needs to be
  984. matchre RETURN ^You stop as you realize
  985. matchre RETURN ^But that is already in your inventory\.
  986. matchre RETURN ^That can't be picked up
  987. matchre LOCATION.unload ^You should unload the
  988. matchre LOCATION.unload ^You need to unload the
  989. put stow %todo
  990. matchwait 15
  991. put #echo >$Log Crimson $datetime *** MISSING MATCH IN STOW! (base.inc) ***
  992. put #echo >$Log Crimson $datetime Stow = %todo
  993. put #log $datetime MISSING MATCH IN STOW (base.inc)
  994. STOW2:
  995. delay 0.0001
  996. var LOCATION STOW2
  997. matchre RETURN ^Wear what\?|^Stow what\?
  998. matchre RETURN ^You put
  999. matchre RETURN ^But that is already in your inventory\.
  1000. matchre RETURN any more room|no matter how you arrange|^That's too heavy|too thick|too long|too wide|not designed to carry anything|^But that's closed
  1001. matchre LOCATION.unload ^You should unload the
  1002. matchre LOCATION.unload ^You need to unload the
  1003. put stow %todo in my back
  1004. matchwait 15
  1005. put #echo >$Log Crimson $datetime *** MISSING MATCH IN STOW2! (base.inc) ***
  1006. put #echo >$Log Crimson $datetime Stow = %todo
  1007. put #log $datetime MISSING MATCH IN STOW2 (base.inc)
  1008. OPEN.THING:
  1009. put open %BOX.CONTAINER
  1010. put open %DEFAULT.CONTAINER
  1011. pause 0.2
  1012. goto STOWING
  1013. REM.WEAR:
  1014. put rem bund
  1015. put drop bund
  1016. wait
  1017. pause 0.5
  1018. goto WEAR1
  1019. ################################
  1020. # MOVEMENT ROUTINES
  1021. ################################
  1022. MOVE:
  1023. delay 0.0001
  1024. var Direction $0
  1025. var movefailCounter 0
  1026. MOVE_RESUME:
  1027. matchre MOVE_RESUME ^\.\.\.wait|^Sorry\,
  1028. matchre MOVE_RESUME ^You make your way up the .*\.\s*Partway up\, you make the mistake of looking down\.\s*Struck by vertigo\, you cling to the .* for a few moments\, then slowly climb back down\.
  1029. matchre MOVE_RESUME ^You pick your way up the .*\, but reach a point where your footing is questionable\.\s*Reluctantly\, you climb back down\.
  1030. matchre MOVE_RESUME ^You approach the .*\, but the steepness is intimidating\.
  1031. matchre MOVE_RESUME ^You struggle
  1032. matchre MOVE_RESUME ^You blunder
  1033. matchre MOVE_RESUME ^You slap
  1034. matchre MOVE_RESUME ^You work
  1035. matchre MOVE_RESUME ^You are still stunned\.
  1036. matchre MOVE_RESUME ^You don't seem to be able to
  1037. matchre MOVE_RESUME make much headway
  1038. matchre MOVE_RESUME ^Noticing your attempt
  1039. matchre MOVE_RESUME ^You flounder around in the water\.
  1040. matchre MOVE_RETREAT ^You are engaged to .*\!
  1041. matchre MOVE_RETREAT ^You can't do that while engaged\!
  1042. matchre MOVE_STAND ^You start up the .*\, but slip after a few feet and fall to the ground\!\s*You are unharmed but feel foolish\.
  1043. matchre MOVE_STAND ^Running heedlessly over the rough terrain\, you trip over an exposed root and land face first in the dirt\.
  1044. matchre MOVE_STAND ^You can't do that while lying down\.
  1045. matchre MOVE_STAND ^You can't do that while sitting\!
  1046. matchre MOVE_STAND ^You must be standing to do that\.
  1047. matchre MOVE_STAND ^You can't do that while kneeling\!
  1048. matchre MOVE_STAND ^You must stand first\.
  1049. matchre MOVE_STAND ^Stand up first.
  1050. matchre MOVE_DIG ^You make no progress in the mud \-\- mostly just shifting of your weight from one side to the other\.
  1051. matchre MOVE_DIG ^You find yourself stuck in the mud\, unable to move much at all after your pathetic attempts\.
  1052. matchre MOVE_DIG ^You struggle forward\, managing a few steps before ultimately falling short of your goal\.
  1053. matchre MOVE_DIG ^Like a blind\, lame duck\, you wallow in the mud in a feeble attempt at forward motion\.
  1054. matchre MOVE_DIG ^The mud holds you tightly\, preventing you from making much headway\.
  1055. matchre MOVE_DIG ^You fall into the mud with a loud \*SPLUT\*\.
  1056. matchre MOVE_FAILED ^I could not find what you were referring to\.
  1057. matchre MOVE_FAILED ^What were you referring to\?
  1058. matchre MOVE_RETURN ^It's pitch dark
  1059. matchre MOVE_RETURN2 ^You can't go there
  1060. matchre MOVE_RETURN ^Obvious
  1061. send %Direction
  1062. matchwait
  1063. MOVE_STAND:
  1064. pause 0.1
  1065. matchre MOVE_STAND ^\.\.\.wait|^Sorry\,
  1066. matchre MOVE_STAND ^You are overburdened and cannot manage to stand\.
  1067. matchre MOVE_STAND ^The weight
  1068. matchre MOVE_STAND ^You try
  1069. matchre MOVE_RETREAT ^You are already standing\.
  1070. matchre MOVE_RETREAT ^You stand(?:\s*back)? up\.
  1071. matchre MOVE_RETREAT ^You stand up\.
  1072. send stand
  1073. matchwait
  1074. MOVE_RETREAT:
  1075. pause 0.1
  1076. matchre MOVE_RETREAT ^\.\.\.wait|^Sorry\,
  1077. matchre MOVE_RETREAT ^You retreat back to pole range\.
  1078. matchre MOVE_RETREAT ^You try to back away
  1079. matchre MOVE_STAND ^You must stand first\.
  1080. matchre MOVE_RESUME ^You retreat from combat\.
  1081. matchre MOVE_RESUME ^You are already as far away as you can get\!
  1082. send retreat
  1083. matchwait
  1084. MOVE_DIG:
  1085. pause 0.1
  1086. matchre MOVE_DIG ^\.\.\.wait|^Sorry\,
  1087. matchre MOVE_DIG ^You struggle to dig off the thick mud caked around your legs\.
  1088. matchre MOVE_STAND ^You manage to dig enough mud away from your legs to assist your movements\.
  1089. matchre MOVE_DIG_STAND ^Maybe you can reach better that way\, but you'll need to stand up for that to really do you any good\.
  1090. matchre MOVE_RESUME ^You will have to kneel
  1091. send dig
  1092. matchwait
  1093. MOVE_DIG_STAND:
  1094. pause 0.1
  1095. matchre MOVE_DIG_STAND ^\.\.\.wait|^Sorry\,
  1096. matchre MOVE_DIG_STAND ^The weight
  1097. matchre MOVE_DIG_STAND ^You try
  1098. matchre MOVE_DIG_STAND ^You are overburdened and cannot manage to stand\.
  1099. matchre MOVE_DIG ^You stand(?:\s*back)? up\.
  1100. matchre MOVE_DIG ^You are already standing\.
  1101. send stand
  1102. matchwait
  1103. MOVE_FAILED:
  1104. evalmath movefailCounter (movefailCounter + 1)
  1105. if (%movefailCounter > 3) then goto MOVE_FAIL_BAIL
  1106. pause 0.5
  1107. goto MOVE_RESUME
  1108. MOVE_FAIL_BAIL:
  1109. put #echo
  1110. put #echo >$Log Crimson *** MOVE FAILED. ***
  1111. put #echo Crimson *** MOVE FAILED. ***
  1112. put #echo
  1113. MOVE_RETURN2:
  1114. send look
  1115. MOVE_RETURN:
  1116. return
  1117. ####################################################################################
  1118. AUTOMOVE:
  1119. delay 0.0001
  1120. var Destination $0
  1121. var automovefailCounter 0
  1122. if (!$standing) then gosub AUTOMOVE_STAND
  1123. if ("$roomid" = "%Destination") then return
  1124. AUTOMOVE_GO:
  1125. delay 0.0001
  1126. matchre AUTOMOVE_FAILED ^(?:AUTOMAPPER )?MOVE(?:MENT)? FAILED
  1127. matchre AUTOMOVE_RETURN ^YOU HAVE ARRIVED(?:\!)?
  1128. matchre AUTOMOVE_RETURN ^SHOP CLOSED(?:\!)?
  1129. matchre AUTOMOVE_FAIL_BAIL ^DESTINATION NOT FOUND
  1130. put #goto %Destination
  1131. matchwait
  1132. AUTOMOVE_STAND:
  1133. pause 0.1
  1134. matchre AUTOMOVE_STAND ^\.\.\.wait|^Sorry\,
  1135. matchre AUTOMOVE_STAND ^Roundtime\:?|^\[Roundtime\:?|^\(Roundtime\:?
  1136. matchre AUTOMOVE_STAND ^The weight of all your possessions prevents you from standing\.
  1137. matchre AUTOMOVE_STAND ^You are still stunned\.
  1138. matchre AUTOMOVE_RETURN ^You stand(?:\s*back)? up\.
  1139. matchre AUTOMOVE_RETURN ^You are already standing\.
  1140. send stand
  1141. matchwait
  1142. AUTOMOVE_FAILED:
  1143. evalmath automovefailCounter (automovefailCounter + 1)
  1144. if (%automovefailCounter > 5) then goto AUTOMOVE_FAIL_BAIL
  1145. send #mapper reset
  1146. pause 0.5
  1147. pause 0.1
  1148. goto AUTOMOVE_GO
  1149. AUTOMOVE_FAIL_BAIL:
  1150. put #echo
  1151. put #echo >$Log Crimson *** AUTOMOVE FAILED. ***
  1152. put #echo >$Log Destination: %Destination
  1153. put #echo Crimson *** AUTOMOVE FAILED. ***
  1154. put #echo Crimson Destination: %Destination
  1155. put #echo
  1156. exit
  1157. AUTOMOVE_RETURN:
  1158. return
  1159. ####################################################################################
  1160. MOVE_RANDOM:
  1161. delay 0.0001
  1162. random 1 8
  1163. if (%r = 1) && (!$north) then goto MOVE_RANDOM
  1164. if (%r = 2) && (!$northeast) then goto MOVE_RANDOM
  1165. if (%r = 3) && (!$east) then goto MOVE_RANDOM
  1166. if (%r = 4) && (!$southeast) then goto MOVE_RANDOM
  1167. if (%r = 5) && (!$south) then goto MOVE_RANDOM
  1168. if (%r = 6) && (!$southwest) then goto MOVE_RANDOM
  1169. if (%r = 7) && (!$west) then goto MOVE_RANDOM
  1170. if (%r = 8) && (!$northwest) then goto MOVE_RANDOM
  1171. #
  1172. if (%r = 1) then var Direction north
  1173. if (%r = 2) then var Direction northeast
  1174. if (%r = 3) then var Direction east
  1175. if (%r = 4) then var Direction southeast
  1176. if (%r = 5) then var Direction south
  1177. if (%r = 6) then var Direction southwest
  1178. if (%r = 7) then var Direction west
  1179. if (%r = 8) then var Direction northwest
  1180. #
  1181. if (%r = 1) then var Reverse.Direction south
  1182. if (%r = 2) then var Reverse.Direction southwest
  1183. if (%r = 3) then var Reverse.Direction west
  1184. if (%r = 4) then var Reverse.Direction northwest
  1185. if (%r = 5) then var Reverse.Direction north
  1186. if (%r = 6) then var Reverse.Direction northeast
  1187. if (%r = 7) then var Reverse.Direction east
  1188. if (%r = 8) then var Reverse.Direction southeast
  1189. #
  1190. var Exits 0
  1191. if ($north) then math Exits add 1
  1192. if ($northeast) then math Exits add 1
  1193. if ($east) then math Exits add 1
  1194. if ($southeast) then math Exits add 1
  1195. if ($south) then math Exits add 1
  1196. if ($southwest) then math Exits add 1
  1197. if ($west) then math Exits add 1
  1198. if ($northwest) then math Exits add 1
  1199. #
  1200. # don't move "back" on a path unless we hit a dead end
  1201. if (%Exits > 1) && ("%Last.Direction" = "%Reverse.Direction") then goto MOVE_RANDOM
  1202. #
  1203. var Last.Direction %Direction
  1204. gosub MOVE_RESUME
  1205. return
  1206. moveRandomDirection:
  1207. random 1 8
  1208. if (%r = 1) then goto 1
  1209. if (%r = 2) then goto 2
  1210. if (%r = 3) then goto 3
  1211. if (%r = 4) then goto 4
  1212. if (%r = 5) then goto 5
  1213. if (%r = 6) then goto 6
  1214. if (%r = 7) then goto 7
  1215. if (%r = 8) then goto 8
  1216. 1:
  1217. if $north then
  1218. {
  1219. gosub MOVE north
  1220. return
  1221. }
  1222. 2:
  1223. if $northwest then
  1224. {
  1225. gosub MOVE northwest
  1226. return
  1227. }
  1228. 3:
  1229. if $northeast then
  1230. {
  1231. gosub MOVE northeast
  1232. return
  1233. }
  1234. 4:
  1235. if $southeast then
  1236. {
  1237. gosub MOVE southeast
  1238. return
  1239. }
  1240. 5:
  1241. if $south then
  1242. {
  1243. gosub MOVE south
  1244. return
  1245. }
  1246. 6:
  1247. if $west then
  1248. {
  1249. gosub MOVE west
  1250. return
  1251. }
  1252. 7:
  1253. if $east then
  1254. {
  1255. gosub MOVE east
  1256. return
  1257. }
  1258. 8:
  1259. if $southwest then
  1260. {
  1261. gosub MOVE southwest
  1262. return
  1263. }
  1264. 9:
  1265. if $out then
  1266. {
  1267. gosub MOVE out
  1268. return
  1269. }
  1270. 10:
  1271. if $up then
  1272. {
  1273. gosub MOVE up
  1274. return
  1275. }
  1276. if $down then
  1277. {
  1278. gosub MOVE down
  1279. return
  1280. }
  1281. if matchre("$roomobjs","(arch|door|gate|hole|hatch|trapdoor)") then
  1282. {
  1283. gosub MOVE go $1
  1284. return
  1285. }
  1286. echo no random direction possible? looking to attempt to reset room exit vars
  1287. #might need a counter here to prevent infinite loops
  1288. put look
  1289. waitforre ^Obvious|fog|see
  1290. pause 0.5
  1291. goto moveRandomDirection
  1292.  
  1293. #### CATCH AND RETRY SUBS
  1294. WAIT:
  1295. delay 0.0001
  1296. pause 0.1
  1297. if (!$standing) then gosub STAND
  1298. goto %LOCATION
  1299. WEBBED:
  1300. delay 0.0001
  1301. if ($webbed) then waiteval (!$webbed)
  1302. if (!$standing) then gosub STAND
  1303. goto %LOCATION
  1304. IMMOBILE:
  1305. delay 0.0001
  1306. if contains("$prompt" , "I") then pause 20
  1307. if (!$standing) then gosub STAND
  1308. goto %LOCATION
  1309. STUNNED:
  1310. delay 0.0001
  1311. if ($stunned) then waiteval (!$stunned)
  1312. if (!$standing) then gosub STAND
  1313. goto %LOCATION
  1314. CALMED:
  1315. delay 5
  1316. if ($stunned) then waiteval (!$stunned)
  1317. if (!$standing) then gosub STAND
  1318. goto %LOCATION
  1319. #### RETURNS
  1320. RETURN:
  1321. delay 0.0001
  1322. RETURN
  1323. RETURN_CLEAR:
  1324. delay 0.0001
  1325. put #queue clear
  1326. pause 0.0001
  1327. RETURN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement