View Full Version : Lock Popping Script?
Maerit
07-25-2014, 04:55 PM
I'm looking for a script that is configurable to some extent for box popping... Is there anything out there?
The rules would be like:
1. Uses 704 to determine if a box has a Glyph Trap (optional)
2. Casts 402 and determines if the box is trapped using 416
3. Attempts to disarm "Safe" traps using 408 until the crimson pulse occurs (configurable?)
- Dark Crystal
- Gas Cloud
- Springs
- (Anything else someone is willing to risk disarming with magic)
4. Stows boxes with "unsafe" traps into the "dont unlock" container
5. Buffs 403 and then uses 407 to pop the disarmed box or untrapped box (or trapped with Plate / Jaws / Needles)
6. Optionally uses 125 to blow up boxes with traps that are not safe to disarm with 408?
Ignores Enruned / Mithril boxes (and Glyph traps)
That's a lot to ask for, but I think it could prove very useful for those rare souls (myself) who don't MA or have a pocket locksmith.
Maybe broken up into a few scripts for detecting traps and sorting the boxes into different containers, then disarming safe boxes, and unlocking all boxes with no traps / which have been disarmed.
Buckwheet
07-25-2014, 04:58 PM
It needs to be called popnlocks and include some dance moves after attempts or successes.
Allereli
07-25-2014, 05:04 PM
needles are safe to pop without disarming
Maerit
07-25-2014, 05:18 PM
needles are safe to pop without disarming
Updated OP. I guess you could pop Gas Clouds too as long as the script was only run outside of the justice system.
Tgo01
07-25-2014, 05:55 PM
Let's start with the basics: Getting the script to determine if a box has a glyph trap by casting 704 at it, because I'm not familiar with the messaging.
main_container = "cloak" #Change to wherever your boxes are found.
cant_open_container = "backpack" #Change to wherever you want boxes that can't be opened.
GameObj.inv.each{|container|
if container.name =~ /#{main_container}/i
(dothistimeout "look in ##{container.id}", 10, /In .*? you see/i) if container.contents.nil?
container.contents.each{ |chest|
if chest.type == "box"
waitrt?
waircastrt?
if chest.name =~ /enruned/ or chest.name =~ /mithril/
fput "put ##{chest.id} in my #{cant_open_container}"
else
fput "prep 704"
fput "cast at ##{chest.id}"
while line = get
if line =~ /MESSAGING FOR GLYPHED TRAP HERE/
echo "This box has a glyph trap!"
fput "put ##{chest.id} in my #{cant_open_container}"
break
elsif line =~ /MESSAGING FOR NO GLYPH TRAP/
echo "No glyph trap on this box."
fput "put ##{chest.id} in my #{main_container}"
break
end
end
end
end
}
end
}
Fill in the variables with your own containers and fill in the capitalized parts there.
Once you have the messaging in there then fill your container with some boxes and run the script and see if it works.
Maerit
07-25-2014, 06:15 PM
Let's start with the basics: Getting the script to determine if a box has a glyph trap by casting 704 at it, because I'm not familiar with the messaging.
main_container = "cloak" #Change to wherever your boxes are found.
cant_open_container = "backpack" #Change to wherever you want boxes that can't be opened.
GameObj.inv.each{|container|
if container.name =~ /#{main_container}/i
(dothistimeout "look in ##{container.id}", 10, /In .*? you see/i) if container.contents.nil?
container.contents.each{ |chest|
if chest.type == "box"
waitrt?
waircastrt?
if chest.name =~ /enruned/ or chest.name =~ /mithril/
fput "put ##{chest.id} in my #{cant_open_container}"
else
fput "prep 704"
fput "cast at ##{chest.id}"
while line = get
if line =~ /MESSAGING FOR GLYPHED TRAP HERE/
echo "This box has a glyph trap!"
fput "put ##{chest.id} in my #{main_container}"
break
elsif line =~ /MESSAGING FOR NO GLYPH TRAP/
echo "No glyph trap on this box."
fput "put ##{chest.id} in my #{main_container}"
break
end
end
end
end
}
end
}
Fill in the variables with your own containers and fill in the capitalized parts there.
Once you have the messaging in there then fill your container with some boxes and run the script and see if it works.
Cool! So, I can't say for certain, but I am pretty confident that the box will have the same messaging as if you attempted to phase a mithril / enruned box. It will resist the phase. I'll check to see if I can find a container soon to get that messaging.
Additionally, if a glyph trap is detected, it should be put into the cant_open_container?
Tgo01
07-25-2014, 06:18 PM
Additionally, if a glyph trap is detected, it should be put into the cant_open_container?
Probably, yes :p
Maerit
07-25-2014, 06:41 PM
Let's start with the basics: Getting the script to determine if a box has a glyph trap by casting 704 at it, because I'm not familiar with the messaging.
main_container = "pack" #Change to wherever your boxes are found.
cant_open_container = "greatcloak" #Change to wherever you want boxes that can't be opened.
GameObj.inv.each{|container|
if container.name =~ /#{main_container}/i
(dothistimeout "look in ##{container.id}", 10, /In .*? you see/i) if container.contents.nil?
container.contents.each{ |chest|
if chest.type == "box"
waitrt?
waitcastrt?
if chest.name =~ /enruned/ or chest.name =~ /mithril/
fput "put ##{chest.id} in my #{cant_open_container}"
else
fput "prep 704"
fput "cast at ##{chest.id}"
while line = get
if line =~ /resists the effects/
echo "This box has a glyph trap!"
fput "put ##{chest.id} in my #{cant_open_container}"
break
elsif line =~ /somewhat insubstantial|flickers in and out|becomes momentarily/
echo "No glyph trap on this box."
fput "put ##{chest.id} in my #{main_container}"
break
end
end
end
end
}
end
}
Fill in the variables with your own containers and fill in the capitalized parts there.
Once you have the messaging in there then fill your container with some boxes and run the script and see if it works.
This seems to be working for the phase test part. I didn't notice if it had mana checks, but that might be important.
Tgo01
07-25-2014, 07:39 PM
This seems to be working for the phase test part. I didn't notice if it had mana checks, but that might be important.
I should probably make it so it actually takes the box out of the container first too :p
I'll add some stuff when I get home. Find a glyph trapped box yet?
Tgo01
07-25-2014, 08:51 PM
main_container = "cloak" #Change to wherever your boxes are found.
cant_open_container = "backpack" #Change to wherever you want boxes that can't be opened.
use_704 = "yes" #Enter nil to not use 704 to check for glyph traps.
GameObj.inv.each{|container|
if container.name =~ /#{main_container}/i
(dothistimeout "look in ##{container.id}", 10, /In .*? you see/i) if container.contents.nil?
container.contents.each{ |chest|
if chest.type == "box"
waitrt?
waircastrt?
fput "get ##{chest.id}"
if chest.name =~ /enruned/ or chest.name =~ /mithril/
fput "put ##{chest.id} in my #{cant_open_container}"
else
if Spell[704].known? and use_704 == "yes"
echo "Waiting for mana." if !Spell[704].affordable?
Spell[704].cast(chest)
while line = get
if line =~ /MESSAGING FOR GLYPHED TRAP HERE/
echo "This box has a glyph trap!"
fput "put ##{chest.id} in my #{cant_open_container}"
break
elsif line =~ /MESSAGING FOR NO GLYPH TRAP/
echo "No glyph trap on this box."
fput "put ##{chest.id} in my #{main_container}"
break
end
end
end
end
end
}
end
}
The script should now get the box out of your container first, it should wait for mana and it now has a toggle option for 704.
Feel free to test this all out and get that glyph messaging.
Maerit
07-26-2014, 01:12 AM
main_container = "cloak" #Change to wherever your boxes are found.
cant_open_container = "backpack" #Change to wherever you want boxes that can't be opened.
use_704 = "yes" #Enter nil to not use 704 to check for glyph traps.
GameObj.inv.each{|container|
if container.name =~ /#{main_container}/i
(dothistimeout "look in ##{container.id}", 10, /In .*? you see/i) if container.contents.nil?
container.contents.each{ |chest|
if chest.type == "box"
waitrt?
waircastrt?
fput "get ##{chest.id}"
if chest.name =~ /enruned/ or chest.name =~ /mithril/
fput "put ##{chest.id} in my #{cant_open_container}"
else
if Spell[704].known? and use_704 == "yes"
echo "Waiting for mana." if !Spell[704].affordable?
Spell[704].cast(chest)
while line = get
if line =~ /MESSAGING FOR GLYPHED TRAP HERE/
echo "This box has a glyph trap!"
fput "put ##{chest.id} in my #{cant_open_container}"
break
elsif line =~ /MESSAGING FOR NO GLYPH TRAP/
echo "No glyph trap on this box."
fput "put ##{chest.id} in my #{main_container}"
break
end
end
end
end
end
}
end
}
The script should now get the box out of your container first, it should wait for mana and it now has a toggle option for 704.
Feel free to test this all out and get that glyph messaging.
Thanks! I found the messaging it's in the last code snippet I quoted:
if line =~ /resists the effects/
echo "This box has a glyph trap!"
fput "put ##{chest.id} in my #{cant_open_container}"
break
elsif line =~ /somewhat insubstantial|flickers in and out|becomes momentarily/
Tgo01
07-26-2014, 02:14 PM
main_container = "cloak" #Change to wherever your boxes are found.
cant_open_container = "backpack" #Change to wherever you want boxes that can't be opened.
use_704 = "yes" #Enter nil to not use 704 to check for glyph traps.
start = nil
cast_416 = nil
start = proc{
GameObj.inv.each{|container|
if container.name =~ /#{main_container}/i
(dothistimeout "look in ##{container.id}", 10, /In .*? you see/i) if container.contents.nil?
container.contents.each{ |chest|
if chest.type == "box"
waitrt?
waircastrt?
fput "get ##{chest.id}"
if chest.name =~ /enruned/ or chest.name =~ /mithril/
fput "put ##{chest.id} in my #{cant_open_container}"
else
if Spell[704].known? and use_704 == "yes"
echo "Waiting for mana." if !Spell[704].affordable?
Spell[704].cast(chest)
while line = get
if line =~ /resists the effects/
echo "This box has a glyph trap!"
fput "put ##{chest.id} in my #{cant_open_container}"
break
elsif line =~ /somewhat insubstantial|flickers in and out|becomes momentarily/
echo "No glyph trap on this box."
cast_416.call
break
end
end
else
cast_416.call
end
end
end
}
end
}
}
cast_416 = proc{
echo "Waiting for mana." if !Spell[402].affordable? and !Spell[402].active?
Spell[402].cast if !Spell[402].active?
echo "Waiting for mana." if !Spell[416].affordable?
wait_until { checkmana >= 16 }
waitrt?
waitcastrt?
fput "prep 416"
fput "cast at my #{GameObj.right_hand}"
while line = get
if line =~ /TRAP MESSAGING FOR TRAPS YOU WANT TO DISARM WITH 408/
echo "This has a trap on it I can disarm, it sure does!"
break
elsif line =~ /TRAP MESSAGING FOR TRAPS YOU DON'T WANT TO DISARM WITH 408/
echo "This has a trap on it I can't disarm, it does."
fput "put ##{chest.id} in my #{cant_open_container}"
break
elsif line =~ /MESSAGING FOR NO TRAPS HERE/
echo "No traps on this one, it sure doesn't!"
break
end
end
}
fput "stow right" if checkright != nil
fput "stow left" if checkleft != nil
start.call
This should cast 402 and cast 416 at boxes that pass the glyph trap test. Just fill in the messaging for the things capitalized there. The messagings can probably be found on Krakiipedia.
Buckwheet
07-26-2014, 04:25 PM
I see no dance moves.
Aluvius
07-26-2014, 04:29 PM
I see no dance moves.
I'm glad I wasn't the only one thinking about this from the thread title. :)
SHAFT
07-26-2014, 04:35 PM
I see no dance moves.
Remember poppin and lockin to Kurtis blow?
Maerit
07-26-2014, 11:21 PM
Hrmm, I modified the script with the messaging indicated and tested it, but it stops after phasing the box.
Also, if you phase a box successfully, you can't use 416 on the box until phase is removed (drop box twice will remove the phase, and put the box on the ground). That means some handling of a successful phase might be required.
Oh, and apparently some form of a jig perhaps? I'm sensing a theme...
Updated script:
main_container = "pack" #Change to wherever your boxes are found.
cant_open_container = "greatcloak" #Change to wherever you want boxes that can't be opened.
use_704 = "yes" #Enter nil to not use 704 to check for glyph traps.
start = nil
cast_416 = nil
start = proc{
GameObj.inv.each{|container|
if container.name =~ /#{main_container}/i
(dothistimeout "look in ##{container.id}", 10, /In .*? you see/i) if container.contents.nil?
container.contents.each{ |chest|
if chest.type == "box"
waitrt?
waitcastrt?
fput "get ##{chest.id}"
if chest.name =~ /enruned/ or chest.name =~ /mithril/
fput "put ##{chest.id} in my #{cant_open_container}"
else
if Spell[704].known? and use_704 == "yes"
echo "Waiting for mana." if !Spell[704].affordable?
Spell[704].cast(chest)
while line = get
if line =~ /resists the effects/
echo "This box has a glyph trap!"
fput "put ##{chest.id} in my #{cant_open_container}"
break
elsif line =~ /somewhat insubstantial|flickers in and out|becomes momentarily/
echo "No glyph trap on this box."
cast_416.call
break
end
end
else
cast_416.call
end
end
end
}
end
}
}
cast_416 = proc{
echo "Waiting for mana." if !Spell[402].affordable? and !Spell[402].active?
Spell[402].cast if !Spell[402].active?
echo "Waiting for mana." if !Spell[416].affordable?
wait_until { checkmana >= 16 }
waitrt?
waitcastrt?
fput "prep 416"
fput "cast at my #{GameObj.right_hand}"
while line = get
if line =~ /discolored oval ring around the outside|You can see a small crystal imbedded|you notice that the hinges have some springs|There appears to be a plate over the lock|/
echo "This has a trap on it I can disarm, it sure does!"
break
elsif line =~ /The scarab's surface is etched|You see a tiny sphere imbedded in the lock mechanism|you notice that the lock casing is coated with a rough|tiny vial placed just past the tumblers|you spy a small vial of fire-red liquid|You see a thin tube extending from the lock|you notice a pair of small metal rods|The inside chamber is lined/
echo "This has a trap on it I can't disarm, it does."
fput "put ##{chest.id} in my #{cant_open_container}"
break
elsif line =~ /You notice what appears to be a sharp sliver|you spy a small vial of liquid and a tiny hammer/
echo "No traps on this one, it sure doesn't!"
break
else
echo "No traps on this one, it sure doesn't!"
break
end
end
}
fput "stow right" if checkright != nil
fput "stow left" if checkleft != nil
start.call
Let me know if I added that final conditional "else" correctly since there is no additional messaging if the box has no trap. Also, should we build in the case for a failed 416 cast (vision is obscured) to recast 416 in a loop until a successful attempt is made?
Essio
07-26-2014, 11:53 PM
I've been wanting a script along these lines too, so I put one together last night.
;repo info epop
This only pops one box at a time but you could modify it or wrap it up in another script. I've only tested a handful of boxes so far, so expect bugs. For now it will make you ;unpause before disarming/unlocking so you can check if it's doing the right thing. Send me a log if it misbehaves.
Tgo01
07-27-2014, 12:41 AM
I've been wanting a script along these lines too, so I put one together last night.
;repo info epop
This only pops one box at a time but you could modify it or wrap it up in another script. I've only tested a handful of boxes so far, so expect bugs. For now it will make you ;unpause before disarming/unlocking so you can check if it's doing the right thing. Send me a log if it misbehaves.
Woot! Problem solved.
I was gonna add some funky dance moves to the script but now we just need to get Essio here to add them to his.
Maerit
07-28-2014, 06:41 PM
I've been wanting a script along these lines too, so I put one together last night.
;repo info epop
This only pops one box at a time but you could modify it or wrap it up in another script. I've only tested a handful of boxes so far, so expect bugs. For now it will make you ;unpause before disarming/unlocking so you can check if it's doing the right thing. Send me a log if it misbehaves.
I managed to wrap your script into the one Tgo01 provided to select boxes from within a primary container and move those that cannot be popped into a secondary container. This allows you to sort and attempt to pop all boxes in a specified container. I did find one trap bug. It didn't disarm an onyx scarab, but went straight into popping the lock with some... unfortunate consequences. I think I've added in that particular scarab now, but more testing to follow!
The reason was:
The scarab's surface is etched with tiny runes that seem to writhe as the light strikes them
does not match:
The scarab's shell is covered with spiky inward-curving protrusions which resemble fangs
Maerit
07-28-2014, 10:35 PM
I found an issue with the script detecting certain types of traps, so need some help fixing these cases:
/^Peering through the .*, you notice that the lock casing is coated with a rough, grainy substance, and a small bladder lies deflated between the tumblers of the lock.\.$/ => lambda {
echo 'Sulfur trap, stopping.'
fput "stow right"
stop = true
},
/^Peering through the .*, you notice that the hinges have some springs incorporated into the design in an unusual fashion\.$/ => lambda {
echo 'Springs trap, disarming.'
disarm = true
},
It doesn't seem to detect the trap in these cases leading to fatal circumstances...
Essio
07-29-2014, 06:07 AM
I uploaded a fix for the onyx scarab and sulfur traps. I'm not sure what's wrong with the springs trap message, do you have a log of it failing?
By the way, I'm not sure how fancy you're getting with your wrapper for going through a container, but you could toss something simple together as a separate script without having to modify epop. That way you can grab fixes without blowing away your own work. This seems to work from a quick test:
LOCKED_SACK = 'backpack' # get boxes from here
FAILED_SACK = 'backpack' # put unpoppable boxes here
OPENED_SACK = 'jacket' # put opened boxes here
exit unless locked_sack = GameObj.inv.find { |i| i.name =~ /(?:^| )#{LOCKED_SACK}/ }
exit unless failed_sack = GameObj.inv.find { |i| i.name =~ /(?:^| )#{FAILED_SACK}/ }
exit unless opened_sack = GameObj.inv.find { |i| i.name =~ /(?:^| )#{OPENED_SACK}/ }
dothistimeout "look in ##{locked_sack.id}", 5, /^In .* you see |^There is nothing in there\.$/
for box in locked_sack.contents.select { |i| i.type == 'box' && i.name !~ /(?:^| )(?:mithril|enruned) / }
fput 'stow right' if checkright
fput "get ##{box.id}"
start_script 'epop'
wait_while { running? 'epop' }
box = GameObj.right_hand
failed = dothis("look in ##{box.id}", /^In .* you see |^That is closed\.$/) == 'That is closed.'
fput "put ##{box.id} in ##{failed ? failed_sack.id : opened_sack.id}"
end
Maerit
07-29-2014, 12:46 PM
I uploaded a fix for the onyx scarab and sulfur traps. I'm not sure what's wrong with the springs trap message, do you have a log of it failing?
By the way, I'm not sure how fancy you're getting with your wrapper for going through a container, but you could toss something simple together as a separate script without having to modify epop. That way you can grab fixes without blowing away your own work. This seems to work from a quick test:
LOCKED_SACK = 'backpack' # get boxes from here
FAILED_SACK = 'backpack' # put unpoppable boxes here
OPENED_SACK = 'jacket' # put opened boxes here
exit unless locked_sack = GameObj.inv.find { |i| i.name =~ /(?:^| )#{LOCKED_SACK}/ }
exit unless failed_sack = GameObj.inv.find { |i| i.name =~ /(?:^| )#{FAILED_SACK}/ }
exit unless opened_sack = GameObj.inv.find { |i| i.name =~ /(?:^| )#{OPENED_SACK}/ }
dothistimeout "look in ##{locked_sack.id}", 5, /^In .* you see |^There is nothing in there\.$/
for box in locked_sack.contents.select { |i| i.type == 'box' && i.name !~ /(?:^| )(?:mithril|enruned) / }
fput 'stow right' if checkright
fput "get ##{box.id}"
start_script 'epop'
wait_while { running? 'epop' }
box = GameObj.right_hand
failed = dothis("look in ##{box.id}", /^In .* you see |^That is closed\.$/) == 'That is closed.'
fput "put ##{box.id} in ##{failed ? failed_sack.id : opened_sack.id}"
end
Awesome, I will take a look at that option! The wrapper is pretty basic. I just put the body of epop (only the logic which actually handles the boxes) inside the bag sorting piece of what Tgo01 had written originally, and it was working fine.
So, I don't actually know if the spring trap is working because I assumed it wouldn't work correctly based on the logic for the sulfur trap. Also, the blood red scarab traps detection failed. I think that the original scarab handler would only work for sky-blue and sea-green because the other 4 scarabs have slightly different messaging (though Krakiipedia strangely doesn't have the 416 messaging for all the scarabs).
Thanks for all your work! It's fun to test the script, even if I get blown up a bunch in the process =)
JackWhisper
07-29-2014, 01:05 PM
Any way you can configure this into TPick in a couple extra tabs? Maybe just for a waggler-only box opener section? Would make TPick that much more versatile@!
Maerit
07-29-2014, 06:31 PM
wait_while { running? 'epop' }
box = GameObj.right_hand
failed = dothis("look in ##{box.id}", /^In .* you see |^That is closed\.$/) == 'That is closed.'
fput "put ##{box.id} in ##{failed ? failed_sack.id : opened_sack.id}"
end
I can't get this section to work. The script just hangs after epop completes, and I have been trying to tinker with it to no avail. It says --- Lich: epop has exited., but I have to manually stop the script that runs epop for each box since it doesn't seem to know that epop has exited. Any suggestions?
Essio
07-30-2014, 01:35 AM
I can't get this section to work. The script just hangs after epop completes, and I have been trying to tinker with it to no avail. It says --- Lich: epop has exited., but I have to manually stop the script that runs epop for each box since it doesn't seem to know that epop has exited. Any suggestions?
Hmm, I'm not sure. Does it send the "look in #..." after epop finishes, and if so what do you get back from the game?
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.