Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.61 KB | None | 0 0
  1. ##TODO: Stow command (puts in 1st, 2nd, 3rd, containers)
  2.  
  3. def matchfind2(*strings)
  4. regex = /#{strings.flatten.join('|').gsub('?', '(.+)')}/i
  5. if reobj = regex.match($lastline)
  6. ret = reobj.captures.compact
  7. if ret.length < 2
  8. return ret.first
  9. else
  10. return ret
  11. end
  12. end
  13. end
  14.  
  15. def rput(rputcommand, goodstrings, badstrings)
  16. rputdone = false
  17. until rputdone
  18. put rputcommand
  19. gotresponse = false
  20. until gotresponse
  21. $lastline = get
  22. if ( goodstrings.any? { |word| $lastline.include?(word) } )
  23. gotresponse = true
  24. rputdone = true
  25. elsif ( !rputdone and badstrings.any? { |word| $lastline.include?(word) } )
  26. gotresponse = true
  27. if($lastline.include?("...wait"))
  28. $lastline = $lastline.delete("^0-9")
  29. pausetime = $lastline.to_i - 1
  30. sleep $lastline.to_i
  31. else
  32. sleep 0.5
  33. end
  34. clear
  35. end
  36. end
  37. end
  38. end
  39.  
  40. start_script "repository", [ "download-updates" ]
  41. start_script "infomon"
  42. start_script "alias"
  43. start_script "lnet"
  44. start_script "gameobjadd"
  45. start_script "uberbar"
  46. start_script "uberspells"
  47. start_script "narost"
  48. start_script "dreavening"
  49.  
  50. toggle_upstream
  51.  
  52. $hidden = false
  53. $alreadyaccepted = false
  54. $previousperson = false
  55. $soldtreasure = false
  56. $soldgems = false
  57. $spelluprooms = [223,1777,3620,3621,3625,3732,3760,3807,3828,3832,3840,3841,3908,3911,3978,18230,18232,18233,21298,21299,21300,21301]
  58. $spellthreadrunning = false
  59.  
  60. put "group open"
  61.  
  62. loop {
  63. $lastline = get
  64. $roomnum = Room.current.nil? ? '(unknown)' : Room.current.id.to_i
  65. $hidden = checkhidden
  66.  
  67. ## GIVE DONATIONS TO RADDA ##
  68. if $spelluprooms.include?($roomnum)
  69. person,amount = matchfind2 "? just gave you ? coins which you quickly pocket"
  70. if (amount and person != "Adelphiana")
  71. sleep(rand(1.0...2.5))
  72. put "say @" + person + " thanks!"
  73. end
  74. end
  75.  
  76. ## PAWN SHOP ##
  77. if ($roomnum == 408 and $soldtreasure == false)
  78. $soldtreasure = true
  79. fput "look in my pack"
  80. contents = false
  81. until contents
  82. $lastline = get
  83. contents = matchfind2 "In the black pack you see ?"
  84. if (contents)
  85. #contents = contents.split(',')
  86. delimiters = [','," and"]
  87. contents = contents.split(Regexp.union(delimiters))
  88. contents.each { |item|
  89. #echo item
  90. if (item.include?("box") || item.include?("coffer") || item.include?("chest") || item.include?("trunk") || item.include?("wand") || item.include?("crystal amulet") || item.include?("lockpick") || item.include?("small statue") || item.include?("heavy quartz orb") || item.include?("wand") || item.include?("white crystal") || item.include?("blue crystal") || item.include?("gold coin") || item.include?("steel jaws") || item.include?("moonstone cube") || item.include?("slender steel needle") || item.include?("granite triangle") || item.include?("scroll") || item.include?("white flask"))
  91. if(item.include?("box") || item.include?("coffer") || item.include?("chest") || item.include?("trunk"))
  92. noun = item.split(' ').last
  93. elsif(item.include?("steel jaws"))
  94. noun = item.split(' ')[-1]
  95. else
  96. noun = item.split(' ')[-2] + " " + item.split(' ')[-1]
  97. end
  98. rput("get #{noun} from my pack",["You remove"],["...wait"])
  99. rput("sell my #{noun}",["You offer to sell"],["...wait"])
  100. end
  101. }
  102. end
  103. end
  104. end
  105. if ($roomnum != 408)
  106. $soldtreasure = false
  107. end
  108.  
  109. ## GEM SHOP ##
  110. if ($roomnum == 1776 and $soldgems == false)
  111. $soldgems = true
  112. fput "remove my pack"
  113. fput "sell my pack"
  114. fput "wear my pack"
  115. fput "look in my pack"
  116. end
  117. if ($roomnum != 1776)
  118. $soldgems = false
  119. end
  120.  
  121. ## DREAVENING - Lich bones ##
  122. person = matchfind2 'Dreaven whispers, "? the HERO! Type CLENCH FIST to roll."'
  123. if person then fput "clench fist" end
  124.  
  125. ## SPELLS (Self) ##
  126. if(!$spellthreadrunning)
  127. $spellthreadrunning = true
  128. Thread.new do
  129. while true do
  130. #puts Time.now # or call tick function
  131. if ($spelluprooms.include?($roomnum) and !$hidden and $roomnum != 3807) then
  132. ## Spirit Warding I ## (stacks)
  133. if Spell[101].timeleft < 30
  134. count = 0
  135. until Spell[101].timeleft > 240 or count > 5
  136. put "whisper Adelphiana cast 101"
  137. pause 4
  138. count += 1
  139. end
  140. end
  141. ## Spirit Defense ##
  142. if Spell[103].timeleft < 30
  143. put "whisper Adelphiana cast 103"
  144. pause 4
  145. end
  146. ## Disease Resistance ## (stacks)
  147. if Spell[104].timeleft < 30
  148. count = 0
  149. until Spell[104].timeleft > 240 or count > 5
  150. put "whisper Adelphiana cast 104"
  151. pause 4
  152. count += 1
  153. end
  154. end
  155. ## Poison Resistance ## (stacks)
  156. if Spell[105].timeleft < 30
  157. count = 0
  158. until Spell[105].timeleft > 240 or count > 5
  159. put "whisper Adelphiana cast 105"
  160. pause 4
  161. count += 1
  162. end
  163. end
  164. ## Spirit Warding II ## (stacks)
  165. if Spell[107].timeleft < 30
  166. count = 0
  167. until Spell[107].timeleft > 240 or count > 5
  168. put "whisper Adelphiana cast 107"
  169. pause 4
  170. count += 1
  171. end
  172. end
  173. ## Spirit Shield ##
  174. if Spell[202].timeleft < 30
  175. put "whisper Adelphiana cast 202"
  176. pause 4
  177. end
  178. ## Unpresence ##
  179. if Spell[204].timeleft < 30
  180. put "whisper Adelphiana cast 204"
  181. pause 4
  182. end
  183. ## Purify Air ##
  184. if Spell[207].timeleft < 30
  185. put "whisper Adelphiana cast 207"
  186. pause 4
  187. end
  188. end
  189. sleep 10
  190. end
  191. end
  192. end
  193.  
  194.  
  195. person = matchfind2 'You accept ? offer and are now holding'
  196. if (person and ($lastline.include?("trunk") || $lastline.include?("box") || $lastline.include?("coffer") || $lastline.include?("chest")))
  197. $alreadyaccepted = true
  198. person = person.chop.chop
  199. $previousperson = person
  200. elsif person
  201. person = false
  202. end
  203.  
  204. ## PICKING ##
  205. if ($spelluprooms.include?($roomnum))
  206. person,box = matchfind2 '? offers you ? the offer will expire in 30 seconds.'
  207. if ($alreadyaccepted || box.include?("trunk") || box.include?("box") || box.include?("coffer") || box.include?("chest"))
  208. if $alreadyaccepted
  209. person = $previousperson
  210. $previousperson = false
  211. $alreadyaccepted = false
  212. else
  213. rput("accept",["You accept"],["...wait"])
  214. put "look"
  215. end
  216. rput("swap",["from your right to your left"],["...wait","from your left to your right"])
  217. fput "detect ##{GameObj.left_hand.id}"
  218. detected = false
  219. trap = false
  220. traptype = false
  221. until detected
  222. $lastline = get
  223. if ($lastline == "You discover no traps." || $lastline == "The lock appears to be free of all obstructions." || $lastline == "A thin layer of mud or putty has been dabbed on the connecting point of the striking arm and the white substance to prevent it from igniting the box when it is unlocked." || $lastline == "You spot a shiny metal needle sticking out of a small hole next to the lockplate with some sort of dark paste on it." || $lastline == "A thorough search of the area inside the tumblers reveals what appears to be a metal bracket of some sort, although it seems to be empty now." || $lastline == "You see a tiny hole next to the lock plate which has been completely plugged." || $lastline == "You notice some spiderweb-like scratches on the lock plate which seem, after some bit of scrutiny, too organized to be just wear and tear -- it might be some type of glyph spell, but some of the markings have been altered. This may prevent any magical nature they have from manifesting itself." || $lastline.include?("You blink in surprise as though just becoming aware of") || $lastline == "Looking closely into the keyhole of the lock, you spy a tiny hammer device and several splinters of glass." || $lastline.include?("There is a small hole in the bladder, most likely from whatever ruptured it") || $lastline == "Looking closely into the keyhole, you notice a pair of small metal rods that have been bent in opposite directions of each other." || $lastline == "Peering closely into the lock, you spy a tiny vial placed just past the tumblers of the lock mechanism. A small ball of cotton has been pushed up against the vial, protecting it from anything that may shatter it." || $lastline.include?("It appears as though the tube has been plugged with something") || $lastline.include?("tiny hammer device which has been bent") || $lastline.include?("but the pins that hold the jaws together have been pushed out.") || $lastline == "You see a metal plate covering the lock plate, but it appears to have been melted through, granting sufficient access to the lock to attempt picking it." || $lastline == "You peer inside the lock and see that the tumblers have been fused into a lump of useless metal." || $lastline == "You can see what appears to be a tiny hole next to the lock plate which doesn't seem to belong there. However, nothing about it seems to indicate cause for alarm.")
  224. echo "NO TRAPS!"
  225. detected = true
  226. elsif ($lastline.include?("scarab wedged into the lock"))
  227. echo "SCARAB!!!!"
  228. detected = true
  229. trap = true
  230. traptype = "scarab"
  231. elsif ($lastline.include?("spy a tiny vial placed just past") || $lastline.include?("a tiny hammer device which seems poised to shatter it") || $lastline.include?("you notice what appears to be the ends of springs incorporated with the hinges"))
  232. echo "TINY VIAL!!!!"
  233. detected = true
  234. trap = true
  235. traptype = "vial"
  236. elsif ($lastline.include?("the gem would be caught amongst them."))
  237. echo "SPHERE!!!!"
  238. detected = true
  239. trap = true
  240. traptype = "sphere"
  241. elsif ($lastline.include?("you spy a miniature blood red scarab"))
  242. echo "SCARAB!!!!"
  243. detected = true
  244. trap = true
  245. traptype = "scarab"
  246. elsif ($lastline.include?("would push the two rods together"))
  247. echo "RODS!!!!"
  248. detected = true
  249. trap = true
  250. traptype = "rods"
  251. elsif ($lastline.include?("tiny hole next to the lock plate"))
  252. echo "NEEDLE!!!!"
  253. detected = true
  254. trap = true
  255. traptype = "needle"
  256. elsif ($lastline.include?("faintest scent of sulphur"))
  257. echo "SULPHUR!!!!"
  258. detected = true
  259. trap = true
  260. traptype = "sulphur"
  261. elsif ($lastline.include?("spring-loaded jaws pressed flush"))
  262. echo "JAWS!!!!"
  263. detected = true
  264. trap = true
  265. traptype = "jaws"
  266. elsif ($lastline.include?("small vial of liquid and a tiny hammer device"))
  267. echo "GAS!!!!"
  268. detected = true
  269. trap = true
  270. traptype = "gas"
  271. elsif ($lastline.include?("appears to be a plate over the lock"))
  272. echo "PLATE!!!!"
  273. detected = true
  274. trap = true
  275. traptype = "plate"
  276. elsif ($lastline.include?("hundreds of tiny metal scales"))
  277. echo "SCALES!!!!"
  278. detected = true
  279. trap = true
  280. traptype = "scales"
  281. elsif ($lastline.include?("is coated with a strange white substance"))
  282. echo "BOOMER!!!!"
  283. detected = true
  284. trap = true
  285. traptype = "boomer"
  286. elsif ($lastline.include?("you see a small tube towards the bottom of the tumbler mechanism"))
  287. echo "SPORES!!!!"
  288. detected = true
  289. trap = true
  290. traptype = "spores"
  291. elsif ($lastline.include?("it might be some type of glyph spell"))
  292. echo "GLYPH!!!!"
  293. detected = true
  294. trap = true
  295. traptype = "glyph"
  296. elsif ($lastline.include?("dark crystal which seems imbedded in the locking mechanism"))
  297. echo "CRYSTAL!!!!"
  298. detected = true
  299. trap = true
  300. traptype = "crystal"
  301. end
  302. end
  303. giveupdisarm = false
  304. if trap
  305. trapsizenumber = false
  306. until trapsizenumber
  307. $lastline = get
  308. trapsizenumber = matchfind2 '-?\).'
  309. ##########################
  310. ### MAX TRAP TO DISARM ###
  311. ##########################
  312. if (trapsizenumber.to_i > 373 and traptype != "plate")
  313. giveupdisarm = true
  314. end
  315. end
  316. end
  317. if !giveupdisarm
  318. if trap
  319. if (trapsizenumber.to_i > 266 and traptype != "plate" and Spell[404].timeleft < 1)
  320. rput("remove armor",["undo the fastenings of your","work your way out of","Remove what?","aren't wearing that"],["...wait"])
  321. fput "put armor in my longc"
  322. cast(404)
  323. end
  324. if traptype == "scarab"
  325. put "say bug drop'n"
  326. rput("disarm ##{GameObj.left_hand.id}",["free of all obstructions","scarab free of its prison"],["are not able to disarm the trap","Roundtime","...wait"])
  327. rput("disarm scarab",["scritch scritch"],["Roundtime","...wait"])
  328. fput "get scarab"
  329. fput "put scarab in my pack"
  330. elsif traptype == "vial"
  331. rput("disarm ##{GameObj.left_hand.id}",["With a little force applied to the springs","you manage to reach in and grasp the post of the metal hammer","carefully push a small ball of cotton","small ball of cotton has been pushed up against the vial"],["Roundtime","...wait"])
  332. rput("put right in my pouch",["You put","could not find what you were","have nothing in your right"],["Roundtime","...wait"])
  333. elsif traptype == "sphere"
  334. rput("get copper lock from my pouch",["remove a copper","what?"],["Roundtime","...wait"])
  335. rput("disarm ##{GameObj.left_hand.id}",["gently nudge the tiny gem until it begins to work loose"],["Roundtime","...wait"])
  336. rput("put copper lock in my pouch",["You put a copper","could not find what you"],["...wait"])
  337. elsif traptype == "rods"
  338. rput("disarm ##{GameObj.left_hand.id}",["great care you take a pair of metal grips and bend the sensitive metal"],["Roundtime","...wait"])
  339. elsif traptype == "needle"
  340. rput("disarm ##{GameObj.left_hand.id}",["Using a bit of putty from your brown leather case","Using a pair of metal grips","tiny hole next to the lock plate which has been completely"],["Roundtime","...wait"])
  341. rput("put right in my pack",["You put","could not find what you were","have nothing in your right"],["Roundtime","...wait"])
  342. elsif traptype == "sulphur"
  343. rput("disarm ##{GameObj.left_hand.id}",["use the tip of a small metal file to scrape away the","small section of the casing has been scraped clean"],["Roundtime","...wait"])
  344. elsif traptype == "jaws"
  345. rput("disarm ##{GameObj.left_hand.id}",["you manage to pull out the two pins that hold the upper and lower jaw"],["Roundtime","...wait"])
  346. rput("put right in my pack",["You put","could not find what you were","have nothing in your right"],["Roundtime","...wait"])
  347. elsif traptype == "gas"
  348. rput("disarm ##{GameObj.left_hand.id}",["you manage to reach in and grasp the post of the metal hammer"],["Roundtime","...wait"])
  349. rput("put right in my pouch",["You put","could not find what you were","have nothing in your right"],["Roundtime","...wait"])
  350. elsif traptype == "plate"
  351. rput("disarm ##{GameObj.left_hand.id}",["take a vial out of your brown leather case and carefully pour"],["Roundtime","...wait"])
  352. elsif traptype == "scales"
  353. #do nothing now
  354. elsif traptype == "boomer"
  355. rput("disarm ##{GameObj.left_hand.id}",["you cake a thin layer on the lock casing"],["Roundtime","...wait"])
  356. elsif traptype == "spores"
  357. rput("disarm ##{GameObj.left_hand.id}",["That should block whatever it's meant to deploy"],["Roundtime","...wait"])
  358. elsif traptype == "glyph"
  359. rput("disarm ##{GameObj.left_hand.id}",["you scrape some extra lines into the markings hoping to alter their meaning and defeat the spell","but some of the markings have been altered"],["Roundtime","...wait"])
  360. elsif traptype == "crystal"
  361. rput("disarm ##{GameObj.left_hand.id}",["manage to grind down parts of the lock mechanism with your metal file"],["Roundtime","...wait"])
  362. rput("put right in my pack",["You put","could not find what you were","have nothing in your right"],["...wait"])
  363. end
  364. end
  365. rput("get my cali",["remove a set of", "already have that"],["...wait"])
  366. rput("lm cali my cali",["calipers could not be more","make some effort to fine-tune"],["...wait"])
  367. rput("lm measure ##{GameObj.left_hand.id}",["you carefully begin to measure the lock"],["...wait","Roundtime"])
  368. gotsize = false
  369. pick = "copper"
  370. until gotsize
  371. $lastline = get
  372. sizeline = matchfind2 "Measuring carefully, it looks to be ?."
  373. if sizeline
  374. gotsize = true
  375. case sizeline
  376. when "a primitive lock"
  377. echo "5 - 40"
  378. pick = "red"
  379. when "a rudimentary lock"
  380. echo "45 - 75"
  381. pick = "red"
  382. when "an extremely easy lock"
  383. echo "80 - 115"
  384. pick = "red"
  385. when "a very easy lock"
  386. echo "120 - 155"
  387. pick = "red"
  388. when "an easy lock"
  389. echo "160 - 195"
  390. pick = "red"
  391. when "a very basic lock"
  392. echo "200 - 235"
  393. pick = "red"
  394. when "a fairly easy lock"
  395. echo "240 - 275"
  396. pick = "copper"
  397. when "a simple lock"
  398. echo "280 - 315"
  399. pick = "gold"
  400. when "a fairly simple lock"
  401. echo "320 - 355"
  402. pick = "gold"
  403. when "a fairly plain lock"
  404. echo "360 - 395"
  405. pick = "mithril"
  406. when "a moderately well-crafted lock"
  407. echo "400 - 435"
  408. pick = "ora"
  409. when "a well-crafted lock"
  410. echo "440 - 475"
  411. pick = "laje"
  412. when "a tricky lock"
  413. echo "480 - 515"
  414. pick = "laje"
  415. when "a somewhat difficult lock"
  416. echo "520 - 555"
  417. pick = "rolaren"
  418. when "a moderately difficult lock"
  419. echo "560 - 595"
  420. pick = "veniom"
  421. when "a very well-crafted lock"
  422. echo "600 - 635"
  423. pick = "veniom"
  424. when "a difficult lock"
  425. echo "640 - 675"
  426. pick = "invar"
  427. when "an extremely well-crafted lock"
  428. echo "680 - 715"
  429. pick = "kelyn"
  430. when "a very difficult lock"
  431. echo "720 - 755"
  432. pick = "vaalin"
  433. when "a fairly complicated lock"
  434. echo "760 - 795"
  435. pick = "rolaren"
  436. lore = true
  437. when "an intricate lock"
  438. echo "800 - 835"
  439. pick = "veniom"
  440. lore = true
  441. when "an amazingly well-crafted lock"
  442. echo "840 - 875"
  443. pick = "veniom"
  444. lore = true
  445. when "a very complex lock"
  446. echo "880 - 915"
  447. pick = "invar"
  448. lore = true
  449. when "an impressively complicated lock"
  450. echo "920 - 955"
  451. pick = "kelyn"
  452. lore = true
  453. when "an amazingly intricate lock"
  454. echo "960 - 995"
  455. pick = "kelyn"
  456. lore = true
  457. when "an extremely difficult lock"
  458. echo "1000 - 1035"
  459. pick = "vaalin"
  460. pick = true
  461. when "an extremely complex lock"
  462. echo "1040 - 1075"
  463. pick = false
  464. when "a masterfully well-crafted lock"
  465. echo "1080 - 1115"
  466. pick = false
  467. when "an amazingly complicated lock"
  468. echo "1120 - 1155"
  469. pick = false
  470. when "an astoundingly complex lock"
  471. echo "1160 - 1195"
  472. pick = false
  473. when "an incredibly intricate lock"
  474. echo "1200 - 1235"
  475. pick = false
  476. when "an absurdly well-crafted lock"
  477. echo "1240 - 1275"
  478. pick = false
  479. when "an exceedingly complex lock"
  480. echo "1280 - 1315"
  481. pick = false
  482. when "an absurdly difficult lock"
  483. echo "1320 - 1355"
  484. pick = false
  485. when "an unbelievably complicated lock"
  486. echo "1360 - 1395"
  487. pick = false
  488. when "a masterfully intricate lock"
  489. echo "1400 - 1435"
  490. pick = false
  491. end
  492. end
  493. end
  494. rput("put cali in my pouch",["You put a set","could not find what you were"],["...wait"])
  495. if pick
  496. if (lore and Spell[403].timeleft < 1) then
  497. rput("remove armor",["undo the fastenings of your","work your way out of","Remove what?","aren't wearing that"],["...wait","but fail in the attempt"])
  498. fput "put armor in my longc"
  499. cast(403)
  500. end
  501. rput("get " + pick + " lock from my pouch",["You remove","You already have"],["...wait"])
  502. rput("lm ptrick flip ##{GameObj.left_hand.id}",["an audible *click* as the tumblers snap open.","does not appear to be locked"],["Roundtime","...wait"])
  503. rput("put right in my pouch",["in your leather tool pouch","have nothing in your right hand!"],["...wait","Roundtime"])
  504. if traptype == "scales"
  505. fput "get stil from my harn"
  506. pause 1
  507. rput("disarm ##{GameObj.left_hand.id}",["That oughta do it"],["You still have a good enough picture of the trap","Roundtime","...wait"])
  508. pause 1
  509. fput "put stil in my harn","put a shadowy","could not find what you"
  510. end
  511. if person != "Adelphiana"
  512. fput "give ##{GameObj.left_hand.id} to " + person
  513. else
  514. fput "open ##{GameObj.left_hand.id}"
  515. fput "get coins"
  516. #fput "empty ##{GameObj.left_hand.id} into my pack"
  517. rput("empty ##{GameObj.left_hand.id} into my pack",["everything falls in","but nothing comes"],["...wait"])
  518. rput("put ##{GameObj.left_hand.id} in my pack",["in your black pack"],["...wait"])
  519. end
  520. accepted = false
  521. $alreadyaccepted = false
  522. until accepted or (person == "Adelphiana")
  523. $lastline = get
  524. if $lastline.include?("has accepted your offer and is now holding")
  525. accepted = true
  526. end
  527. end
  528. fput "accept"
  529. put "look"
  530. acceptresult = false
  531. until acceptresult
  532. $lastline = get
  533. if $lastline.include?("have no offers to accept.")
  534. acceptresult = true
  535. elsif $lastline.include?("and are now holding")
  536. acceptresult = true
  537. $previousperson = person
  538. $alreadyaccepted = true
  539. end
  540. end
  541. else
  542. echo "TOO HARD! wedge it!"
  543. end
  544. else
  545. echo "TOO HARD TO DISARM, I GIVE UP!!!"
  546. # if okay to disarm
  547. end
  548. # if given box
  549. end
  550. # if in east tower
  551. end
  552. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement