pabstblueribbon
06-20-2009, 02:13 PM
Alright. Big thanks to Vulvamancer/Danical first off, since most of the code is originally his code. Also thanks to Tillmen for helping me figure out the shortest route to a certain location using Go2.
As stated above, when complete this script will determine your current location, find the shortest route or eta to a herb cache (bench/whatever) look for the herb, if it cant find it there go to the nearest herbalist store, order the herb, eat it, etc etc. until you're healed.
Here's my issue.
I cant for the life of me figure out how we're pulling the order number from this line.
herb = herbs['majorwounds'][area][$times]
When later all that gets called on it to actually purchase the damn herb is:
fput "order #{herb}"
Here's the code for Vulva/Danical's version, Sixbits/Psighs altered it to work for with Tillmens lich. I know its looking at the array defined in herbs =
and I want to set up a table that says, okay, if my current room is foo then order number for this herbalist is $foo_herb_order_number. That I can take care of. But just where the FUCK would I put #{$foo_herb_order_number} in the herb = herbs['majorwounds'][area][$times] line...... heres the code.
=begin
Auto Teras Herb Healer v1.1
This is a little script Gnimble threw together for those in need of Teras herb consumption.
Modified by Sixbits/Psighs to work with Tillmen's version of lich.
ABSOLUTELY DO NOT RUN THIS WITH ANYTHING IN YOUR HANDS
=end
herbs = {
'minorwounds' => {
'head' => [ 'rose-marrow potion', 'semak\'s ale', '7' ],
'neck' => [ 'rose-marrow potion', 'semak\'s ale', '7' ],
'back' => [ 'basal moss', 'mama ale', '9' ],
'abs' => [ 'basal moss', 'mama ale', '9' ],
'chest' => [ 'basal moss', 'mama ale', '9' ],
'leye' => [ 'basal moss', 'mama ale', '9' ],
'reye' => [ 'basal moss', 'mama ale', '9' ],
'rarm' => [ 'ambrominas leaf', 'lost ale', '3' ],
'rhand' => [ 'ambrominas leaf', 'lost ale', '3' ],
'rleg' => [ 'ambrominas leaf', 'lost ale', '3' ],
'larm' => [ 'ambrominas leaf', 'lost ale', '3' ],
'lhand' => [ 'ambrominas leaf', 'lost ale', '3' ],
'lleg' => [ 'ambrominas leaf', 'lost ale', '3' ],
'nerves' => [ 'wolifrew lichen', 'orc\'s ale', '5' ]
},
'majorwounds' => {
'head' => [ 'aloeas stem', 'dark ale', '17' ],
'neck' => [ 'aloeas stem', 'dark ale', '17' ],
'back' => [ 'pothinir grass', 'aged ale', '19' ],
'abs' => [ 'pothinir grass', 'aged ale', '19' ],
'chest' => [ 'pothinir grass', 'aged ale', '19' ],
'reye' => [ 'pothinir grass', 'aged ale', '19' ],
'leye' => [ 'pothinir grass', 'aged ale', '19' ],
'rarm' => [ 'ephlox moss', 'golden ale', '13' ],
'rhand' => [ 'ephlox moss', 'golden ale', '13' ],
'rleg' => [ 'ephlox moss', 'golden ale', '13' ],
'larm' => [ 'ephlox moss', 'golden ale', '13' ],
'lhand' => [ 'ephlox moss', 'golden ale', '13' ],
'lleg' => [ 'ephlox moss', 'golden ale', '13' ],
'nerves' => [ 'bolmara potion', 'kenar\'s ale', '15' ]
},
'minorscars' => {
'head' => [ 'haphip root', 'agrak\'s ale', '25' ],
'neck' => [ 'haphip root', 'agrak\'s ale', '25' ],
'back' => [ 'talneo potion', 'gert\'s ale', '27' ],
'abs' => [ 'talneo potion', 'gert\'s ale', '27' ],
'chest' => [ 'talneo potion', 'gert\'s ale', '27' ],
'reye' => [ 'talneo potion', 'gert\'s ale', '27' ],
'leye' => [ 'talneo potion', 'gert\'s ale', '27' ],
'rarm' => [ 'cactacae spine', 'bearded ale', '21' ],
'rhand' => [ 'cactacae spine', 'bearded ale', '21' ],
'rleg' => [ 'cactacae spine', 'bearded ale', '21' ],
'larm' => [ 'cactacae spine', 'bearded ale', '21' ],
'lhand' => [ 'cactacae spine', 'bearded ale', '21' ],
'lleg' => [ 'cactacae spine', 'bearded ale', '21' ],
'nerves' => [ 'torban leaf', 'miner\'s ale', '23' ]
},
'majorscars' => {
'head' => [ 'brostheras potion', 'reaper\'s ale', '33' ],
'neck' => [ 'brostheras potion', 'reaper\'s ale', '33' ],
'back' => [ 'wingstem potion', 'wort\'s ale', '35' ],
'abs' => [ 'wingstem potion', 'wort\'s ale', '35' ],
'chest' => [ 'wingstem potion', 'wort\'s ale', '35' ],
'reye' => [ 'wingstem potion', 'wort\'s ale', '35' ],
'leye' => [ 'wingstem potion', 'wort\'s ale', '35' ],
'rarm' => [ 'calamia fruit', 'mad ale', '29' ],
'rhand' => [ 'calamia fruit', 'mad ale', '29' ],
'rleg' => [ 'calamia fruit', 'mad ale', '29' ],
'larm' => [ 'calamia fruit', 'mad ale', '29' ],
'lhand' => [ 'calamia fruit', 'mad ale', '29' ],
'lleg' => [ 'calamia fruit', 'mad ale', '29' ],
'nerves' => [ 'woth flower', 'draco\'s ale', '31' ]
},
'missing' => {
'reye' => [ 'cur-clover potion', 'Volcano vision ale', '37' ],
'leye' => [ 'cur-clover potion', 'Volcano vision ale', '37' ],
'rarm' => [ 'sovyn clove', 'Capt ale', '39' ],
'rhand' => [ 'sovyn clove', 'Capt ale', '39' ],
'rleg' => [ 'sovyn clove', 'Capt ale', '39' ],
'larm' => [ 'sovyn clove', 'Capt ale', '39' ],
'lhand' => [ 'sovyn clove', 'Capt ale', '39' ],
'lleg' => [ 'sovyn clove', 'Capt ale', '39' ]
}
}
def nomnom(herb)
fput "put #{checkright} on bench" if checkright !~ /#{herb.split.last}/ && checkright
fput "get #{herb}" if herb =~ /tincture|potion|ale/ && checkright !~ /#{herb.split.last}/
#herb =~ /tincture|potion|ale/ ? fput "drink my #{herb}" : fput "eat #{herb}"
if herb =~ /tincture|potion|ale/ then fput "drink my #{herb}" else fput "eat #{herb}" end
waitrt?
line = waitfor("You (remove|manage|take)", "not find", "were you referring", "Get what")
return $times += 1 if line =~ /not find|were you referring|Get what/
end
def purchase(herb)
start_script 'go2', [ '1838', '_disable_confirm_' ]
wait_while{running?('go2')}
fput "withdraw 2000 silver"
start_script 'go2', [ '1851', '_disable_confirm_' ]
wait_while{running?('go2')}
fput "order #{herb}"
fput "buy"
start_script 'go2', [ '1838', '_disable_confirm_' ]
wait_while{running?('go2')}
fput "depo all"
start_script 'go2', [ '1932', '_disable_confirm_' ]
wait_while{running?('go2')}
$times -= 1
end
unless checkroom("Dragonspine and Krodera")
fput "stand" if checksitting
start_script 'go2', [ '1932', '_disable_confirm_' ]
wait_while{running?('go2')}
end
for area in %w[head neck back abs chest reye leye rarm rhand rleg larm lhand lleg]
herb = [] ; $times = 0
while Wounds.send(area) >= 2
until Wounds.send(area) == 1 || herbs['majorwounds'][area][$times] =~ /\d+/
herb = herbs['majorwounds'][area][$times]
nomnom(herb)
end
fput "put #{checkright} on bench" if checkright
if Wounds.send(area) >= 2 && herbs['majorwounds'][area][$times] =~ /\d+/
herb = herbs['majorwounds'][area][$times]
purchase(herb)
next
end
end
$times = 0
while Wounds.send(area) == 1 && Scars.send(area) == 0
until Scars.send(area) >= 1 || herbs['minorwounds'][area][$times] =~ /\d+/
herb = herbs['minorwounds'][area][$times]
nomnom(herb)
end
fput "put #{checkright} on bench" if checkright
if Wounds.send(area) == 1 && Scars.send(area) == 0 && herbs['minorwounds'][area][$times] =~ /\d+/
herb = herbs['minorwounds'][area][$times]
purchase(herb)
next
end
end
$times = 0
while Scars.send(area) == 3 && area =~ /arm|leg|hand/
until Scars.send(area) < 3 || herbs['missing']['rarm'][$times] =~ /\d+/
herb = herbs['missing']['rarm'][$times]
nomnom(herb)
end
checkright if fput "put #{checkright} on bench"
if Scars.send(area) == 3 && area =~ /arm|leg|hand/ && herbs['missing']['rarm'][$times] =~ /\d+/
herb = herbs['missing']['rarm'][$times]
purchase(herb)
next
end
end
$times = 0
while Scars.send(area) == 3 && area =~ /eye/
until Scars.send(area) < 3 || herbs['missing']['reye'][$times] =~ /\d+/
herb = herbs['missing']['reye'][$times]
nomnom(herb)
end
checkright if fput "put #{checkright} on bench"
if Scars.send(area) == 3 && area =~ /eye/ && herbs['missing']['reye'][$times] =~ /\d+/
herb = herbs['missing']['reye'][$times]
purchase(herb)
next
end
end
$times = 0
while Scars.send(area) >= 2
until Scars.send(area) == 1 || herbs['majorscars'][area][$times] =~ /\d+/
herb = herbs['majorscars'][area][$times]
nomnom(herb)
end
checkright if fput "put #{checkright} on bench"
if Scars.send(area) >= 2 && herbs['majorscars'][area][$times] =~ /\d+/
herb = herbs['majorscars'][area][$times]
purchase(herb)
next
end
end
$times = 0
while Scars.send(area) == 1
until Scars.send(area) == 0 || herbs['minorscars'][area][$times] =~ /\d+/
herb = herbs['minorscars'][area][$times]
nomnom(herb)
end
checkright if fput "put #{checkright} on bench"
if Scars.send(area) == 1 && herbs['minorscars'][area][$times] =~ /\d+/
herb = herbs['minorscars'][area][$times]
purchase(herb)
next
end
end
end
unless checkroom("Golden Helm, Hearth Room")
start_script 'go2', [ '12506', '_disable_confirm_' ]
wait_while{running?('go2')}
end
As stated above, when complete this script will determine your current location, find the shortest route or eta to a herb cache (bench/whatever) look for the herb, if it cant find it there go to the nearest herbalist store, order the herb, eat it, etc etc. until you're healed.
Here's my issue.
I cant for the life of me figure out how we're pulling the order number from this line.
herb = herbs['majorwounds'][area][$times]
When later all that gets called on it to actually purchase the damn herb is:
fput "order #{herb}"
Here's the code for Vulva/Danical's version, Sixbits/Psighs altered it to work for with Tillmens lich. I know its looking at the array defined in herbs =
and I want to set up a table that says, okay, if my current room is foo then order number for this herbalist is $foo_herb_order_number. That I can take care of. But just where the FUCK would I put #{$foo_herb_order_number} in the herb = herbs['majorwounds'][area][$times] line...... heres the code.
=begin
Auto Teras Herb Healer v1.1
This is a little script Gnimble threw together for those in need of Teras herb consumption.
Modified by Sixbits/Psighs to work with Tillmen's version of lich.
ABSOLUTELY DO NOT RUN THIS WITH ANYTHING IN YOUR HANDS
=end
herbs = {
'minorwounds' => {
'head' => [ 'rose-marrow potion', 'semak\'s ale', '7' ],
'neck' => [ 'rose-marrow potion', 'semak\'s ale', '7' ],
'back' => [ 'basal moss', 'mama ale', '9' ],
'abs' => [ 'basal moss', 'mama ale', '9' ],
'chest' => [ 'basal moss', 'mama ale', '9' ],
'leye' => [ 'basal moss', 'mama ale', '9' ],
'reye' => [ 'basal moss', 'mama ale', '9' ],
'rarm' => [ 'ambrominas leaf', 'lost ale', '3' ],
'rhand' => [ 'ambrominas leaf', 'lost ale', '3' ],
'rleg' => [ 'ambrominas leaf', 'lost ale', '3' ],
'larm' => [ 'ambrominas leaf', 'lost ale', '3' ],
'lhand' => [ 'ambrominas leaf', 'lost ale', '3' ],
'lleg' => [ 'ambrominas leaf', 'lost ale', '3' ],
'nerves' => [ 'wolifrew lichen', 'orc\'s ale', '5' ]
},
'majorwounds' => {
'head' => [ 'aloeas stem', 'dark ale', '17' ],
'neck' => [ 'aloeas stem', 'dark ale', '17' ],
'back' => [ 'pothinir grass', 'aged ale', '19' ],
'abs' => [ 'pothinir grass', 'aged ale', '19' ],
'chest' => [ 'pothinir grass', 'aged ale', '19' ],
'reye' => [ 'pothinir grass', 'aged ale', '19' ],
'leye' => [ 'pothinir grass', 'aged ale', '19' ],
'rarm' => [ 'ephlox moss', 'golden ale', '13' ],
'rhand' => [ 'ephlox moss', 'golden ale', '13' ],
'rleg' => [ 'ephlox moss', 'golden ale', '13' ],
'larm' => [ 'ephlox moss', 'golden ale', '13' ],
'lhand' => [ 'ephlox moss', 'golden ale', '13' ],
'lleg' => [ 'ephlox moss', 'golden ale', '13' ],
'nerves' => [ 'bolmara potion', 'kenar\'s ale', '15' ]
},
'minorscars' => {
'head' => [ 'haphip root', 'agrak\'s ale', '25' ],
'neck' => [ 'haphip root', 'agrak\'s ale', '25' ],
'back' => [ 'talneo potion', 'gert\'s ale', '27' ],
'abs' => [ 'talneo potion', 'gert\'s ale', '27' ],
'chest' => [ 'talneo potion', 'gert\'s ale', '27' ],
'reye' => [ 'talneo potion', 'gert\'s ale', '27' ],
'leye' => [ 'talneo potion', 'gert\'s ale', '27' ],
'rarm' => [ 'cactacae spine', 'bearded ale', '21' ],
'rhand' => [ 'cactacae spine', 'bearded ale', '21' ],
'rleg' => [ 'cactacae spine', 'bearded ale', '21' ],
'larm' => [ 'cactacae spine', 'bearded ale', '21' ],
'lhand' => [ 'cactacae spine', 'bearded ale', '21' ],
'lleg' => [ 'cactacae spine', 'bearded ale', '21' ],
'nerves' => [ 'torban leaf', 'miner\'s ale', '23' ]
},
'majorscars' => {
'head' => [ 'brostheras potion', 'reaper\'s ale', '33' ],
'neck' => [ 'brostheras potion', 'reaper\'s ale', '33' ],
'back' => [ 'wingstem potion', 'wort\'s ale', '35' ],
'abs' => [ 'wingstem potion', 'wort\'s ale', '35' ],
'chest' => [ 'wingstem potion', 'wort\'s ale', '35' ],
'reye' => [ 'wingstem potion', 'wort\'s ale', '35' ],
'leye' => [ 'wingstem potion', 'wort\'s ale', '35' ],
'rarm' => [ 'calamia fruit', 'mad ale', '29' ],
'rhand' => [ 'calamia fruit', 'mad ale', '29' ],
'rleg' => [ 'calamia fruit', 'mad ale', '29' ],
'larm' => [ 'calamia fruit', 'mad ale', '29' ],
'lhand' => [ 'calamia fruit', 'mad ale', '29' ],
'lleg' => [ 'calamia fruit', 'mad ale', '29' ],
'nerves' => [ 'woth flower', 'draco\'s ale', '31' ]
},
'missing' => {
'reye' => [ 'cur-clover potion', 'Volcano vision ale', '37' ],
'leye' => [ 'cur-clover potion', 'Volcano vision ale', '37' ],
'rarm' => [ 'sovyn clove', 'Capt ale', '39' ],
'rhand' => [ 'sovyn clove', 'Capt ale', '39' ],
'rleg' => [ 'sovyn clove', 'Capt ale', '39' ],
'larm' => [ 'sovyn clove', 'Capt ale', '39' ],
'lhand' => [ 'sovyn clove', 'Capt ale', '39' ],
'lleg' => [ 'sovyn clove', 'Capt ale', '39' ]
}
}
def nomnom(herb)
fput "put #{checkright} on bench" if checkright !~ /#{herb.split.last}/ && checkright
fput "get #{herb}" if herb =~ /tincture|potion|ale/ && checkright !~ /#{herb.split.last}/
#herb =~ /tincture|potion|ale/ ? fput "drink my #{herb}" : fput "eat #{herb}"
if herb =~ /tincture|potion|ale/ then fput "drink my #{herb}" else fput "eat #{herb}" end
waitrt?
line = waitfor("You (remove|manage|take)", "not find", "were you referring", "Get what")
return $times += 1 if line =~ /not find|were you referring|Get what/
end
def purchase(herb)
start_script 'go2', [ '1838', '_disable_confirm_' ]
wait_while{running?('go2')}
fput "withdraw 2000 silver"
start_script 'go2', [ '1851', '_disable_confirm_' ]
wait_while{running?('go2')}
fput "order #{herb}"
fput "buy"
start_script 'go2', [ '1838', '_disable_confirm_' ]
wait_while{running?('go2')}
fput "depo all"
start_script 'go2', [ '1932', '_disable_confirm_' ]
wait_while{running?('go2')}
$times -= 1
end
unless checkroom("Dragonspine and Krodera")
fput "stand" if checksitting
start_script 'go2', [ '1932', '_disable_confirm_' ]
wait_while{running?('go2')}
end
for area in %w[head neck back abs chest reye leye rarm rhand rleg larm lhand lleg]
herb = [] ; $times = 0
while Wounds.send(area) >= 2
until Wounds.send(area) == 1 || herbs['majorwounds'][area][$times] =~ /\d+/
herb = herbs['majorwounds'][area][$times]
nomnom(herb)
end
fput "put #{checkright} on bench" if checkright
if Wounds.send(area) >= 2 && herbs['majorwounds'][area][$times] =~ /\d+/
herb = herbs['majorwounds'][area][$times]
purchase(herb)
next
end
end
$times = 0
while Wounds.send(area) == 1 && Scars.send(area) == 0
until Scars.send(area) >= 1 || herbs['minorwounds'][area][$times] =~ /\d+/
herb = herbs['minorwounds'][area][$times]
nomnom(herb)
end
fput "put #{checkright} on bench" if checkright
if Wounds.send(area) == 1 && Scars.send(area) == 0 && herbs['minorwounds'][area][$times] =~ /\d+/
herb = herbs['minorwounds'][area][$times]
purchase(herb)
next
end
end
$times = 0
while Scars.send(area) == 3 && area =~ /arm|leg|hand/
until Scars.send(area) < 3 || herbs['missing']['rarm'][$times] =~ /\d+/
herb = herbs['missing']['rarm'][$times]
nomnom(herb)
end
checkright if fput "put #{checkright} on bench"
if Scars.send(area) == 3 && area =~ /arm|leg|hand/ && herbs['missing']['rarm'][$times] =~ /\d+/
herb = herbs['missing']['rarm'][$times]
purchase(herb)
next
end
end
$times = 0
while Scars.send(area) == 3 && area =~ /eye/
until Scars.send(area) < 3 || herbs['missing']['reye'][$times] =~ /\d+/
herb = herbs['missing']['reye'][$times]
nomnom(herb)
end
checkright if fput "put #{checkright} on bench"
if Scars.send(area) == 3 && area =~ /eye/ && herbs['missing']['reye'][$times] =~ /\d+/
herb = herbs['missing']['reye'][$times]
purchase(herb)
next
end
end
$times = 0
while Scars.send(area) >= 2
until Scars.send(area) == 1 || herbs['majorscars'][area][$times] =~ /\d+/
herb = herbs['majorscars'][area][$times]
nomnom(herb)
end
checkright if fput "put #{checkright} on bench"
if Scars.send(area) >= 2 && herbs['majorscars'][area][$times] =~ /\d+/
herb = herbs['majorscars'][area][$times]
purchase(herb)
next
end
end
$times = 0
while Scars.send(area) == 1
until Scars.send(area) == 0 || herbs['minorscars'][area][$times] =~ /\d+/
herb = herbs['minorscars'][area][$times]
nomnom(herb)
end
checkright if fput "put #{checkright} on bench"
if Scars.send(area) == 1 && herbs['minorscars'][area][$times] =~ /\d+/
herb = herbs['minorscars'][area][$times]
purchase(herb)
next
end
end
end
unless checkroom("Golden Helm, Hearth Room")
start_script 'go2', [ '12506', '_disable_confirm_' ]
wait_while{running?('go2')}
end