Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##TODO: Stow command (puts in 1st, 2nd, 3rd, containers)
- def matchfind2(*strings)
- regex = /#{strings.flatten.join('|').gsub('?', '(.+)')}/i
- if reobj = regex.match($lastline)
- ret = reobj.captures.compact
- if ret.length < 2
- return ret.first
- else
- return ret
- end
- end
- end
- def rput(rputcommand, goodstrings, badstrings)
- rputdone = false
- until rputdone
- put rputcommand
- gotresponse = false
- until gotresponse
- $lastline = get
- if ( goodstrings.any? { |word| $lastline.include?(word) } )
- gotresponse = true
- rputdone = true
- elsif ( !rputdone and badstrings.any? { |word| $lastline.include?(word) } )
- gotresponse = true
- if($lastline.include?("...wait"))
- $lastline = $lastline.delete("^0-9")
- pausetime = $lastline.to_i - 1
- sleep $lastline.to_i
- else
- sleep 0.5
- end
- clear
- end
- end
- end
- end
- start_script "repository", [ "download-updates" ]
- start_script "infomon"
- start_script "alias"
- start_script "lnet"
- start_script "gameobjadd"
- start_script "uberbar"
- start_script "uberspells"
- start_script "narost"
- start_script "dreavening"
- toggle_upstream
- $hidden = false
- $alreadyaccepted = false
- $previousperson = false
- $soldtreasure = false
- $soldgems = false
- $spelluprooms = [223,1777,3620,3621,3625,3732,3760,3807,3828,3832,3840,3841,3908,3911,3978,18230,18232,18233,21298,21299,21300,21301]
- $spellthreadrunning = false
- put "group open"
- loop {
- $lastline = get
- $roomnum = Room.current.nil? ? '(unknown)' : Room.current.id.to_i
- $hidden = checkhidden
- ## GIVE DONATIONS TO RADDA ##
- if $spelluprooms.include?($roomnum)
- person,amount = matchfind2 "? just gave you ? coins which you quickly pocket"
- if (amount and person != "Adelphiana")
- sleep(rand(1.0...2.5))
- put "say @" + person + " thanks!"
- end
- end
- ## PAWN SHOP ##
- if ($roomnum == 408 and $soldtreasure == false)
- $soldtreasure = true
- fput "look in my pack"
- contents = false
- until contents
- $lastline = get
- contents = matchfind2 "In the black pack you see ?"
- if (contents)
- #contents = contents.split(',')
- delimiters = [','," and"]
- contents = contents.split(Regexp.union(delimiters))
- contents.each { |item|
- #echo item
- 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"))
- if(item.include?("box") || item.include?("coffer") || item.include?("chest") || item.include?("trunk"))
- noun = item.split(' ').last
- elsif(item.include?("steel jaws"))
- noun = item.split(' ')[-1]
- else
- noun = item.split(' ')[-2] + " " + item.split(' ')[-1]
- end
- rput("get #{noun} from my pack",["You remove"],["...wait"])
- rput("sell my #{noun}",["You offer to sell"],["...wait"])
- end
- }
- end
- end
- end
- if ($roomnum != 408)
- $soldtreasure = false
- end
- ## GEM SHOP ##
- if ($roomnum == 1776 and $soldgems == false)
- $soldgems = true
- fput "remove my pack"
- fput "sell my pack"
- fput "wear my pack"
- fput "look in my pack"
- end
- if ($roomnum != 1776)
- $soldgems = false
- end
- ## DREAVENING - Lich bones ##
- person = matchfind2 'Dreaven whispers, "? the HERO! Type CLENCH FIST to roll."'
- if person then fput "clench fist" end
- ## SPELLS (Self) ##
- if(!$spellthreadrunning)
- $spellthreadrunning = true
- Thread.new do
- while true do
- #puts Time.now # or call tick function
- if ($spelluprooms.include?($roomnum) and !$hidden and $roomnum != 3807) then
- ## Spirit Warding I ## (stacks)
- if Spell[101].timeleft < 30
- count = 0
- until Spell[101].timeleft > 240 or count > 5
- put "whisper Adelphiana cast 101"
- pause 4
- count += 1
- end
- end
- ## Spirit Defense ##
- if Spell[103].timeleft < 30
- put "whisper Adelphiana cast 103"
- pause 4
- end
- ## Disease Resistance ## (stacks)
- if Spell[104].timeleft < 30
- count = 0
- until Spell[104].timeleft > 240 or count > 5
- put "whisper Adelphiana cast 104"
- pause 4
- count += 1
- end
- end
- ## Poison Resistance ## (stacks)
- if Spell[105].timeleft < 30
- count = 0
- until Spell[105].timeleft > 240 or count > 5
- put "whisper Adelphiana cast 105"
- pause 4
- count += 1
- end
- end
- ## Spirit Warding II ## (stacks)
- if Spell[107].timeleft < 30
- count = 0
- until Spell[107].timeleft > 240 or count > 5
- put "whisper Adelphiana cast 107"
- pause 4
- count += 1
- end
- end
- ## Spirit Shield ##
- if Spell[202].timeleft < 30
- put "whisper Adelphiana cast 202"
- pause 4
- end
- ## Unpresence ##
- if Spell[204].timeleft < 30
- put "whisper Adelphiana cast 204"
- pause 4
- end
- ## Purify Air ##
- if Spell[207].timeleft < 30
- put "whisper Adelphiana cast 207"
- pause 4
- end
- end
- sleep 10
- end
- end
- end
- person = matchfind2 'You accept ? offer and are now holding'
- if (person and ($lastline.include?("trunk") || $lastline.include?("box") || $lastline.include?("coffer") || $lastline.include?("chest")))
- $alreadyaccepted = true
- person = person.chop.chop
- $previousperson = person
- elsif person
- person = false
- end
- ## PICKING ##
- if ($spelluprooms.include?($roomnum))
- person,box = matchfind2 '? offers you ? the offer will expire in 30 seconds.'
- if ($alreadyaccepted || box.include?("trunk") || box.include?("box") || box.include?("coffer") || box.include?("chest"))
- if $alreadyaccepted
- person = $previousperson
- $previousperson = false
- $alreadyaccepted = false
- else
- rput("accept",["You accept"],["...wait"])
- put "look"
- end
- rput("swap",["from your right to your left"],["...wait","from your left to your right"])
- fput "detect ##{GameObj.left_hand.id}"
- detected = false
- trap = false
- traptype = false
- until detected
- $lastline = get
- 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.")
- echo "NO TRAPS!"
- detected = true
- elsif ($lastline.include?("scarab wedged into the lock"))
- echo "SCARAB!!!!"
- detected = true
- trap = true
- traptype = "scarab"
- 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"))
- echo "TINY VIAL!!!!"
- detected = true
- trap = true
- traptype = "vial"
- elsif ($lastline.include?("the gem would be caught amongst them."))
- echo "SPHERE!!!!"
- detected = true
- trap = true
- traptype = "sphere"
- elsif ($lastline.include?("you spy a miniature blood red scarab"))
- echo "SCARAB!!!!"
- detected = true
- trap = true
- traptype = "scarab"
- elsif ($lastline.include?("would push the two rods together"))
- echo "RODS!!!!"
- detected = true
- trap = true
- traptype = "rods"
- elsif ($lastline.include?("tiny hole next to the lock plate"))
- echo "NEEDLE!!!!"
- detected = true
- trap = true
- traptype = "needle"
- elsif ($lastline.include?("faintest scent of sulphur"))
- echo "SULPHUR!!!!"
- detected = true
- trap = true
- traptype = "sulphur"
- elsif ($lastline.include?("spring-loaded jaws pressed flush"))
- echo "JAWS!!!!"
- detected = true
- trap = true
- traptype = "jaws"
- elsif ($lastline.include?("small vial of liquid and a tiny hammer device"))
- echo "GAS!!!!"
- detected = true
- trap = true
- traptype = "gas"
- elsif ($lastline.include?("appears to be a plate over the lock"))
- echo "PLATE!!!!"
- detected = true
- trap = true
- traptype = "plate"
- elsif ($lastline.include?("hundreds of tiny metal scales"))
- echo "SCALES!!!!"
- detected = true
- trap = true
- traptype = "scales"
- elsif ($lastline.include?("is coated with a strange white substance"))
- echo "BOOMER!!!!"
- detected = true
- trap = true
- traptype = "boomer"
- elsif ($lastline.include?("you see a small tube towards the bottom of the tumbler mechanism"))
- echo "SPORES!!!!"
- detected = true
- trap = true
- traptype = "spores"
- elsif ($lastline.include?("it might be some type of glyph spell"))
- echo "GLYPH!!!!"
- detected = true
- trap = true
- traptype = "glyph"
- elsif ($lastline.include?("dark crystal which seems imbedded in the locking mechanism"))
- echo "CRYSTAL!!!!"
- detected = true
- trap = true
- traptype = "crystal"
- end
- end
- giveupdisarm = false
- if trap
- trapsizenumber = false
- until trapsizenumber
- $lastline = get
- trapsizenumber = matchfind2 '-?\).'
- ##########################
- ### MAX TRAP TO DISARM ###
- ##########################
- if (trapsizenumber.to_i > 373 and traptype != "plate")
- giveupdisarm = true
- end
- end
- end
- if !giveupdisarm
- if trap
- if (trapsizenumber.to_i > 266 and traptype != "plate" and Spell[404].timeleft < 1)
- rput("remove armor",["undo the fastenings of your","work your way out of","Remove what?","aren't wearing that"],["...wait"])
- fput "put armor in my longc"
- cast(404)
- end
- if traptype == "scarab"
- put "say bug drop'n"
- rput("disarm ##{GameObj.left_hand.id}",["free of all obstructions","scarab free of its prison"],["are not able to disarm the trap","Roundtime","...wait"])
- rput("disarm scarab",["scritch scritch"],["Roundtime","...wait"])
- fput "get scarab"
- fput "put scarab in my pack"
- elsif traptype == "vial"
- 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"])
- rput("put right in my pouch",["You put","could not find what you were","have nothing in your right"],["Roundtime","...wait"])
- elsif traptype == "sphere"
- rput("get copper lock from my pouch",["remove a copper","what?"],["Roundtime","...wait"])
- rput("disarm ##{GameObj.left_hand.id}",["gently nudge the tiny gem until it begins to work loose"],["Roundtime","...wait"])
- rput("put copper lock in my pouch",["You put a copper","could not find what you"],["...wait"])
- elsif traptype == "rods"
- rput("disarm ##{GameObj.left_hand.id}",["great care you take a pair of metal grips and bend the sensitive metal"],["Roundtime","...wait"])
- elsif traptype == "needle"
- 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"])
- rput("put right in my pack",["You put","could not find what you were","have nothing in your right"],["Roundtime","...wait"])
- elsif traptype == "sulphur"
- 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"])
- elsif traptype == "jaws"
- rput("disarm ##{GameObj.left_hand.id}",["you manage to pull out the two pins that hold the upper and lower jaw"],["Roundtime","...wait"])
- rput("put right in my pack",["You put","could not find what you were","have nothing in your right"],["Roundtime","...wait"])
- elsif traptype == "gas"
- rput("disarm ##{GameObj.left_hand.id}",["you manage to reach in and grasp the post of the metal hammer"],["Roundtime","...wait"])
- rput("put right in my pouch",["You put","could not find what you were","have nothing in your right"],["Roundtime","...wait"])
- elsif traptype == "plate"
- rput("disarm ##{GameObj.left_hand.id}",["take a vial out of your brown leather case and carefully pour"],["Roundtime","...wait"])
- elsif traptype == "scales"
- #do nothing now
- elsif traptype == "boomer"
- rput("disarm ##{GameObj.left_hand.id}",["you cake a thin layer on the lock casing"],["Roundtime","...wait"])
- elsif traptype == "spores"
- rput("disarm ##{GameObj.left_hand.id}",["That should block whatever it's meant to deploy"],["Roundtime","...wait"])
- elsif traptype == "glyph"
- 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"])
- elsif traptype == "crystal"
- rput("disarm ##{GameObj.left_hand.id}",["manage to grind down parts of the lock mechanism with your metal file"],["Roundtime","...wait"])
- rput("put right in my pack",["You put","could not find what you were","have nothing in your right"],["...wait"])
- end
- end
- rput("get my cali",["remove a set of", "already have that"],["...wait"])
- rput("lm cali my cali",["calipers could not be more","make some effort to fine-tune"],["...wait"])
- rput("lm measure ##{GameObj.left_hand.id}",["you carefully begin to measure the lock"],["...wait","Roundtime"])
- gotsize = false
- pick = "copper"
- until gotsize
- $lastline = get
- sizeline = matchfind2 "Measuring carefully, it looks to be ?."
- if sizeline
- gotsize = true
- case sizeline
- when "a primitive lock"
- echo "5 - 40"
- pick = "red"
- when "a rudimentary lock"
- echo "45 - 75"
- pick = "red"
- when "an extremely easy lock"
- echo "80 - 115"
- pick = "red"
- when "a very easy lock"
- echo "120 - 155"
- pick = "red"
- when "an easy lock"
- echo "160 - 195"
- pick = "red"
- when "a very basic lock"
- echo "200 - 235"
- pick = "red"
- when "a fairly easy lock"
- echo "240 - 275"
- pick = "copper"
- when "a simple lock"
- echo "280 - 315"
- pick = "gold"
- when "a fairly simple lock"
- echo "320 - 355"
- pick = "gold"
- when "a fairly plain lock"
- echo "360 - 395"
- pick = "mithril"
- when "a moderately well-crafted lock"
- echo "400 - 435"
- pick = "ora"
- when "a well-crafted lock"
- echo "440 - 475"
- pick = "laje"
- when "a tricky lock"
- echo "480 - 515"
- pick = "laje"
- when "a somewhat difficult lock"
- echo "520 - 555"
- pick = "rolaren"
- when "a moderately difficult lock"
- echo "560 - 595"
- pick = "veniom"
- when "a very well-crafted lock"
- echo "600 - 635"
- pick = "veniom"
- when "a difficult lock"
- echo "640 - 675"
- pick = "invar"
- when "an extremely well-crafted lock"
- echo "680 - 715"
- pick = "kelyn"
- when "a very difficult lock"
- echo "720 - 755"
- pick = "vaalin"
- when "a fairly complicated lock"
- echo "760 - 795"
- pick = "rolaren"
- lore = true
- when "an intricate lock"
- echo "800 - 835"
- pick = "veniom"
- lore = true
- when "an amazingly well-crafted lock"
- echo "840 - 875"
- pick = "veniom"
- lore = true
- when "a very complex lock"
- echo "880 - 915"
- pick = "invar"
- lore = true
- when "an impressively complicated lock"
- echo "920 - 955"
- pick = "kelyn"
- lore = true
- when "an amazingly intricate lock"
- echo "960 - 995"
- pick = "kelyn"
- lore = true
- when "an extremely difficult lock"
- echo "1000 - 1035"
- pick = "vaalin"
- pick = true
- when "an extremely complex lock"
- echo "1040 - 1075"
- pick = false
- when "a masterfully well-crafted lock"
- echo "1080 - 1115"
- pick = false
- when "an amazingly complicated lock"
- echo "1120 - 1155"
- pick = false
- when "an astoundingly complex lock"
- echo "1160 - 1195"
- pick = false
- when "an incredibly intricate lock"
- echo "1200 - 1235"
- pick = false
- when "an absurdly well-crafted lock"
- echo "1240 - 1275"
- pick = false
- when "an exceedingly complex lock"
- echo "1280 - 1315"
- pick = false
- when "an absurdly difficult lock"
- echo "1320 - 1355"
- pick = false
- when "an unbelievably complicated lock"
- echo "1360 - 1395"
- pick = false
- when "a masterfully intricate lock"
- echo "1400 - 1435"
- pick = false
- end
- end
- end
- rput("put cali in my pouch",["You put a set","could not find what you were"],["...wait"])
- if pick
- if (lore and Spell[403].timeleft < 1) then
- 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"])
- fput "put armor in my longc"
- cast(403)
- end
- rput("get " + pick + " lock from my pouch",["You remove","You already have"],["...wait"])
- rput("lm ptrick flip ##{GameObj.left_hand.id}",["an audible *click* as the tumblers snap open.","does not appear to be locked"],["Roundtime","...wait"])
- rput("put right in my pouch",["in your leather tool pouch","have nothing in your right hand!"],["...wait","Roundtime"])
- if traptype == "scales"
- fput "get stil from my harn"
- pause 1
- rput("disarm ##{GameObj.left_hand.id}",["That oughta do it"],["You still have a good enough picture of the trap","Roundtime","...wait"])
- pause 1
- fput "put stil in my harn","put a shadowy","could not find what you"
- end
- if person != "Adelphiana"
- fput "give ##{GameObj.left_hand.id} to " + person
- else
- fput "open ##{GameObj.left_hand.id}"
- fput "get coins"
- #fput "empty ##{GameObj.left_hand.id} into my pack"
- rput("empty ##{GameObj.left_hand.id} into my pack",["everything falls in","but nothing comes"],["...wait"])
- rput("put ##{GameObj.left_hand.id} in my pack",["in your black pack"],["...wait"])
- end
- accepted = false
- $alreadyaccepted = false
- until accepted or (person == "Adelphiana")
- $lastline = get
- if $lastline.include?("has accepted your offer and is now holding")
- accepted = true
- end
- end
- fput "accept"
- put "look"
- acceptresult = false
- until acceptresult
- $lastline = get
- if $lastline.include?("have no offers to accept.")
- acceptresult = true
- elsif $lastline.include?("and are now holding")
- acceptresult = true
- $previousperson = person
- $alreadyaccepted = true
- end
- end
- else
- echo "TOO HARD! wedge it!"
- end
- else
- echo "TOO HARD TO DISARM, I GIVE UP!!!"
- # if okay to disarm
- end
- # if given box
- end
- # if in east tower
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement