View Full Version : Script issues.
Saurven
02-03-2012, 02:24 PM
So I'm thinking instead of going with an "accept and return" picking script, it would be better on the entire Shattered population if I just made a script to go along with UPickbot, since that's already the established kickass script.
My problem is writing a script to keep track of the boxes that are picked, and account for new boxes as they are being dropped.
Here are my questions:
Does .push work to add any new box ids into my $unpicked variable in
fput "look"
Gameobj.loot.each{|unpicked|} if unpicked.noun =~ /strongbox|box|coffer|chest|trunk/
$unpicked.push(unpicked.id.to_i)
Lastly, if I have one script constantly tracking the boxes, and starting/stopping my pick script on a per box basis, is there a way to push the boxes item id's from my tracking script to my picking script?
Going back to smacking my head against the keyboard. Ignore all ASDFNILKASKknjdfan oie/AIDSFJ in game, please.
Drunken Durfin
02-03-2012, 02:35 PM
So I'm thinking instead of going with an "accept and return" picking script...
I would love to see an accept and return picking script for Shattered. Shattered needs the variety and the Lich population would benefit from more code to hack apart and use in various other scripts that would utilize this action. Blessing scripts, loresinging scripts, imbed-bot scripts, etc. Give it a shot and see what you come up with.
Saurven
02-03-2012, 02:43 PM
I'll go that route. I'm gonna hafta rent space on the neon sign to advertise my end-user script for Landing hunter's bigshot, etc, but I'll see if I can come up with something functional and upload it on repo once I get my pick script to work with it worth a damn.
Saurven
02-03-2012, 03:45 PM
Ok, so I'm now trying to make the end-user script.
I want the script to inventory all containers, and check each of them for boxes. The boxes should be easy enough. Marking each container is proving to be a challenge, though.
fput "inv container"
if line =~ /You are wearing/ then |cont| = each./{[A-Z],[a-z]},/
Doesn't have a clue what the hell I am asking it to do. I'm not entirely sure I know what the hell I'm asking it to do there either. Any suggestion on this, or if it is even feasible?
Gibreficul
02-03-2012, 04:34 PM
Ok, so I'm now trying to make the end-user script.
I want the script to inventory all containers, and check each of them for boxes. The boxes should be easy enough. Marking each container is proving to be a challenge, though.
fput "inv container"
if line =~ /You are wearing/ then |cont| = each./{[A-Z],[a-z]},/
Doesn't have a clue what the hell I am asking it to do. I'm not entirely sure I know what the hell I'm asking it to do there either. Any suggestion on this, or if it is even feasible?
Copied straight from upickbot2.
$container = [] unless $container
contruns = 0
until !$container.empty?
break if contruns > 9
msg "upickbot2 grabbing container IDs"
done = false
action = proc{ |grab_this|
if grab_this =~ /You are wearing/i
$container = grab_this.scan(/a exist\=\"([\d]+)[^\.|,]/).flatten
grab_this;nil
elsif grab_this =~ /\<prompt time\=/
grab_this
done = true;nil
end
}
waitrt?
DownstreamHook.add('inv_cont', action)
status_tags
$_SERVER_.puts "inv cont"
t=Time.now
wait_until {done or t+3<Time.now}
DownstreamHook.remove('inv_cont')
status_tags
contruns += 1
end
How's that?
It builds a list of your container's ID#s. I like ID#s.
For the record, that's basically the same as what's in my library scripts, in the forge script, and anything else I've done that's "automated" and accesses your containers.
Saurven
02-03-2012, 04:58 PM
Thanks Gib. I didn't wanna filch through your scripts to steal everything for my script, so I was trying to figure out how to write it. I think I'll just go the easy route, though, since writing my own sucks balls.
For the record, I was testing how to work it and got as far as:
$sack.array = []
fput "inv cont"
line = get
if line = "You are wearing" then $sack.push = /Gamobj.cont.each/
echo "#{$sack.each}"
which just gave me [test: ]
Guess I still didn't give it anything to push into that array. Feh.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.