From 06945f37261066bae543669b7b3f0ed0884ba6dc Mon Sep 17 00:00:00 2001 From: Virtuousin <74260855+Virtuousin@users.noreply.github.com> Date: Tue, 10 Nov 2020 13:29:46 -0500 Subject: [PATCH 1/4] Update alchemy.lic Remove info[:rank].to_i != 10 in line 766 and info[:rank].to_i != 5 unless they have more significance. Causes endless loops at ranks 5/10. Add/Modify at elsif statment line 789 to pause for trading tasks without vouchers. --- alchemy.lic | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/alchemy.lic b/alchemy.lic index 01abf58..577e8e7 100644 --- a/alchemy.lic +++ b/alchemy.lic @@ -763,7 +763,7 @@ do_administrator = proc { end elsif (info[:task] == 'promotion') if type != 'alchemy' or info[:rank].to_i != 5 or (gld.call['potions'][:rank].to_i >= 2 and gld.call['trinkets'][:rank].to_i >= 2) - if type != 'alchemy' or info[:rank].to_i != 10 or (gld.call['potions'][:rank].to_i >= 3 and gld.call['trinkets'][:rank].to_i >= 3) + if type != 'alchemy' or (gld.call['potions'][:rank].to_i >= 3 and gld.call['trinkets'][:rank].to_i >= 3) if room_id = where_is.call("#{Char.prof.downcase} alchemy guildmaster").first start_script 'go2', [ room_id.to_s ] wait_while { running?('go2') } @@ -788,7 +788,12 @@ do_administrator = proc { did_something = true elsif info[:task] == "gather alchemy ingredients for the guild's supply" invalid_gld.call - dothistimeout "ask #{GameObj.npcs.last.noun} about trade #{type}", 10, /^#{GameObj.npcs.last.noun} .*?, "/ + gldTrade = dothistimeout "ask #{GameObj.npcs.last.noun} about trade #{type}", 10, /^#{GameObj.npcs.last.noun} .*?, "/ + if gldTrade =~ /You will need to wait [0-9]+ minutes before trading in another task.|Come back in about [0-9]+ minutes if you want another task/ + pauseTime = $1.to_i + 0.5 + echo "Waiting #{pauseTime} minutes to request next task." + pause "#{pauseTime}m" + end did_something = true end end From ce43aadeb8cb9bea469f7fa233e20c2c3e693adc Mon Sep 17 00:00:00 2001 From: Virtuousin <74260855+Virtuousin@users.noreply.github.com> Date: Tue, 10 Nov 2020 13:33:36 -0500 Subject: [PATCH 2/4] Update alchemy.lic --- alchemy.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alchemy.lic b/alchemy.lic index 577e8e7..85927d7 100644 --- a/alchemy.lic +++ b/alchemy.lic @@ -762,7 +762,7 @@ do_administrator = proc { did_something = true end elsif (info[:task] == 'promotion') - if type != 'alchemy' or info[:rank].to_i != 5 or (gld.call['potions'][:rank].to_i >= 2 and gld.call['trinkets'][:rank].to_i >= 2) + if type != 'alchemy' or (gld.call['potions'][:rank].to_i >= 2 and gld.call['trinkets'][:rank].to_i >= 2) if type != 'alchemy' or (gld.call['potions'][:rank].to_i >= 3 and gld.call['trinkets'][:rank].to_i >= 3) if room_id = where_is.call("#{Char.prof.downcase} alchemy guildmaster").first start_script 'go2', [ room_id.to_s ] From 3f91eef622bd8466446c083c99e65d10d59fb303 Mon Sep 17 00:00:00 2001 From: Virtuousin <74260855+Virtuousin@users.noreply.github.com> Date: Wed, 11 Nov 2020 12:14:56 -0500 Subject: [PATCH 3/4] Update alchemy.lic restored the 10 and 5 rank portions of the if statements (still creates a loop but I haven't investigated the fix) Moved the wait logic under 'no task' instead of under 'go gather ingredients' section. Added if statements for the particular capture group. --- alchemy.lic | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/alchemy.lic b/alchemy.lic index 85927d7..a8dadc2 100644 --- a/alchemy.lic +++ b/alchemy.lic @@ -757,13 +757,23 @@ do_administrator = proc { next if (type =~ /potions|trinkets/) and (info[:rank] == gld.call['alchemy'][:rank]) if info[:task] == 'no task' result = dothistimeout "ask #{GameObj.npcs.last.noun} about training #{type}", 10, /^#{GameObj.npcs.last.noun} .*?, "/ - invalid_gld.call + invalid_gld.call + if result =~ /You will need to wait ([0-9]+) minutes before trading in another task.|Come back in about ([0-9]+) minutes if you want another task/ + if $1 != nil + waitTime = $1.to_i + elsif $2 != nil + waitTime = $2.to_i + end + pauseTime = waitTime + 0.5 + respond "Waiting #{pauseTime} minutes to request next task." + pause "#{pauseTime}m" + end unless result =~ /your general alchemy skills are not quite up to snuff/ did_something = true end elsif (info[:task] == 'promotion') - if type != 'alchemy' or (gld.call['potions'][:rank].to_i >= 2 and gld.call['trinkets'][:rank].to_i >= 2) - if type != 'alchemy' or (gld.call['potions'][:rank].to_i >= 3 and gld.call['trinkets'][:rank].to_i >= 3) + if type != 'alchemy' or info[:rank].to_i != 5 or (gld.call['potions'][:rank].to_i >= 2 and gld.call['trinkets'][:rank].to_i >= 2) + if type != 'alchemy' or info[:rank].to_i != 10 or (gld.call['potions'][:rank].to_i >= 3 and gld.call['trinkets'][:rank].to_i >= 3) if room_id = where_is.call("#{Char.prof.downcase} alchemy guildmaster").first start_script 'go2', [ room_id.to_s ] wait_while { running?('go2') } @@ -788,12 +798,7 @@ do_administrator = proc { did_something = true elsif info[:task] == "gather alchemy ingredients for the guild's supply" invalid_gld.call - gldTrade = dothistimeout "ask #{GameObj.npcs.last.noun} about trade #{type}", 10, /^#{GameObj.npcs.last.noun} .*?, "/ - if gldTrade =~ /You will need to wait [0-9]+ minutes before trading in another task.|Come back in about [0-9]+ minutes if you want another task/ - pauseTime = $1.to_i + 0.5 - echo "Waiting #{pauseTime} minutes to request next task." - pause "#{pauseTime}m" - end + dothistimeout "ask #{GameObj.npcs.last.noun} about trade #{type}", 10, /^#{GameObj.npcs.last.noun} .*?, "/ did_something = true end end From 1102bcde784769112a9c902b7d4963e3a98a8140 Mon Sep 17 00:00:00 2001 From: Virtuousin <74260855+Virtuousin@users.noreply.github.com> Date: Wed, 11 Nov 2020 15:05:19 -0500 Subject: [PATCH 4/4] Update alchemy.lic Fixed a logic issue and updated the placement of the regexes for matching the wait timer. --- alchemy.lic | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/alchemy.lic b/alchemy.lic index a8dadc2..da65cfd 100644 --- a/alchemy.lic +++ b/alchemy.lic @@ -758,15 +758,11 @@ do_administrator = proc { if info[:task] == 'no task' result = dothistimeout "ask #{GameObj.npcs.last.noun} about training #{type}", 10, /^#{GameObj.npcs.last.noun} .*?, "/ invalid_gld.call - if result =~ /You will need to wait ([0-9]+) minutes before trading in another task.|Come back in about ([0-9]+) minutes if you want another task/ - if $1 != nil - waitTime = $1.to_i - elsif $2 != nil - waitTime = $2.to_i - end - pauseTime = waitTime + 0.5 + if result =~ /Come back in about ([0-9]+) minutes if you want another task/ + pauseTime = $1.to_i + 0.5 + pauseTimeS = pauseTime*60 respond "Waiting #{pauseTime} minutes to request next task." - pause "#{pauseTime}m" + sleep pauseTimeS end unless result =~ /your general alchemy skills are not quite up to snuff/ did_something = true @@ -798,7 +794,13 @@ do_administrator = proc { did_something = true elsif info[:task] == "gather alchemy ingredients for the guild's supply" invalid_gld.call - dothistimeout "ask #{GameObj.npcs.last.noun} about trade #{type}", 10, /^#{GameObj.npcs.last.noun} .*?, "/ + result = dothistimeout "ask #{GameObj.npcs.last.noun} about trade #{type}", 10, /^#{GameObj.npcs.last.noun} .*?, "/ + if result =~ /You will need to wait ([0-9]+) minutes before trading in another task/ + pauseTime = $1.to_i + 0.5 + pauseTimeS = pauseTime*60 + respond "Waiting #{pauseTime} minutes to request next task." + sleep pauseTimeS + end did_something = true end end