PDA

View Full Version : Boost Gem (Bounty Boost)



Haldrik
12-08-2015, 08:18 PM
Heyo,

I wrote up a little script that will cycle through bounties using BOUNTY BOOST until you hit an uncut diamond/ruby/emerald.

It's on the repo as ";repo download boostgem".

I've only tested in the Landing but added some code to hopefully make it work in the other areas. I'm out of bounty boosts so any further testing would be appreciated.

Enjoy!



=begin

For use with bounty boost.

v.01 by Kalros

=end

echo "You must activate your bounty boost via BOOST BOUNTY"
sleep 1

start_script 'go2', [ 'advguild' ]
wait_while { running?('go2') }

$gemtask = false
$uncut = false

start_exec_script( <<-eos
while(line = get);
break unless running?('boost');
$gemtask = true if line =~ /The local gem dealer, .*, has an order/;
$uncut = true if line =~ /in purchasing an uncut (diamond|ruby|emerald)/;
end;
eos
)

while line = get
npc = GameObj.npcs.find { |t| t.name =~ /taskmaster/i }
fput "ask ##{npc.id} about bounty"
sleep 0.2
if $gemtask == false
fput "ask ##{npc.id} about removal"
fput "ask ##{npc.id} about removal"
sleep 5
else
start_script 'go2', [ 'gemshop' ]
wait_while { running?('go2') }
npc = GameObj.npcs.find { |t| t.name =~ /(dealer|zirconia|kahlyr|tanz|diam|areac)/i }
fput "ask ##{npc.id} for bounty"
sleep 0.2
if $uncut == true
break
else
$gemtask == false
start_script 'go2', [ 'advguild' ]
wait_while { running?('go2') }
end
end
end

gilchristr
01-02-2017, 07:04 PM
This is a good script, but I desire a new derivative script (gemboostcolor) to obtain bounties for any pearl, blue sapphire, pink sapphire, or black opal.

Has anyone done it, or would it be trivial for someone else to modify the boostgem (it is not a trivial thing for me...)

Gelston
01-02-2017, 07:05 PM
I thought that dude had come back at first, then I saw 2015.

Haldrik
01-02-2017, 07:23 PM
This is a good script, but I desire a new derivative script (gemboostcolor) to obtain bounties for any pearl, blue sapphire, pink sapphire, or black opal.

Has anyone done it, or would it be trivial for someone else to modify the boostgem (it is not a trivial thing for me...)

Yeah it's fairly easy to do. Just change this section.

$uncut = true if line =~ /in purchasing an uncut (diamond|ruby|emerald)/;

To something like:

$uncut = true if line =~ /in purchasing.+(pearl|blue sapphire|pink sapphire|black opal)/;

gilchristr
01-02-2017, 08:11 PM
Is that period after purchaisng supposed to be there?

And, if I want it to stop on any of diamond/emerald/ruby/pearl/blue sapphire/pink spphire/black opal), then replace:

$uncut = true if line =~ /in purchasing an uncut (diamond|ruby|emerald)/;

With:

$uncut = true if line =~ /in purchasing.+(diamond|ruby|emerald|pearl|blue sapphire|pink sapphire|black opal)/;


Thanks!

Donquix
01-02-2017, 10:03 PM
In regular expressions an unescaped period is the wildcard character, plus means match the last character (or group of characters) once or more. so .+ = match at least one, or many, of anything

an escaped (literal) period would be preceded by a backslash, that's why you'll see a lot of match strings in scripts end with: \.
or in bracket grouping like: [.]

What you have should work, but it would also match on the non-uncut diamonds/rubies/emeralds (sylvarrends and the like), if you just wanted the uncut types you could do:

/in purchasing.+(uncut (diamond|ruby|emerald)|pearl|blue sapphire|pink sapphire|black opal)/

would just do uncut.

http://rubular.com/ is a super useful site where you can put in your example strings to match, and your regular expression, and see if it's working as you expect.

Gnomad
01-02-2017, 10:21 PM
Also, the less you ask .+ or .* to do, or if you can avoid using them all together, your regexp will be that much more efficient.

If you're running a lich script that seems surprisingly slow and it isn't trying to find a place to send you (zzherb, etc.) then it's probably a poorly written regexp.

gilchristr
01-09-2017, 09:24 PM
Thanks, this seems to have worked:

replace:

$uncut = true if line =~ /in purchasing an uncut (diamond|ruby|emerald)/;

With:

$uncut = true if line =~ /in purchasing.+(diamond|emerald|pearl|blue sapphire|pink sapphire|black opal|uncut ruby)/;

gilchristr
01-09-2017, 09:43 PM
Just noticed the text I posted has the word "ruby", but the gem dealer guy might say "rubies", so maybe this is better:

replace:

$uncut = true if line =~ /in purchasing an uncut (diamond|ruby|emerald)/;

With:

$uncut = true if line =~ /in purchasing.+(uncut|pearl|blue sapphire|pink sapphire|black opal)/;

Haldrik
01-09-2017, 11:44 PM
Just noticed the text I posted has the word "ruby", but the gem dealer guy might say "rubies", so maybe this is better:

replace:

$uncut = true if line =~ /in purchasing an uncut (diamond|ruby|emerald)/;

With:

$uncut = true if line =~ /in purchasing.+(uncut|pearl|blue sapphire|pink sapphire|black opal)/;

The words can change depending on the gemshop. This is the landing.

Zirconia says, "Ah, so you're from the Adventurer's Guild? Yes, I do have a task for you. I've recently received several orders from customers interested in purchasing an uncut ruby. Unfortunately, I do not have quite enough inventory on hand to meet this demand. I'd like for you to go round up 10 of them for me. You can SELL them to me as you find them."


Also, the less you ask .+ or .* to do, or if you can avoid using them all together, your regexp will be that much more efficient.

If you're running a lich script that seems surprisingly slow and it isn't trying to find a place to send you (zzherb, etc.) then it's probably a poorly written regexp.

Definitely true. In this case I didn't have the exact capture and boost gem can't run long term. I should have an updated version that includes herbs, I might dig it up if I remember when I get home.