View Full Version : Hunting Script (PsiNet/Lich required!)
SpiffyJr
04-28-2008, 06:31 PM
Well, I was working on a nifty hunting script because I got tired of writing them for every new zone. I managed to take my bard from 20 to 32 in 14-15 days using this script and gained over 300,000 coins (didn't pickup boxes). With a little customization and setup this one should hunt just about anything. I have a swinger and wrote it with that in mind but with a few mana checks you could easily adapt this script for a pure (5 mins, give or take). The script is safest for swinger only critters and takes into account stance dancing and will continually attack as long as a critter is prone/stunned. You can setup a healing location and the script will run there to ask for healing (with random messages and customizable tip).
Warning: If someone is hiding and you enter the room it will assume no one is in there. That's how I got caught scripting so it is advisable to add a check before using this script. If you see Noctonix, kick him in the face for reporting me.
Script below.
*UPDATE* I returned to GS for a bit so I made a few updates to the script. It should run smoother and works with ambushing now.
SpiffyJr
04-28-2008, 06:31 PM
# SpiffyJr's last gift to GS players.
# The startup of a very advanced hunting script. Had Gemsone not been so tedious
# I probably never would have learned Ruby. Thank you GS!
# Timers
$timerInactive = $TIMEOUT_DURATION
$timerCheckSpells = $SPELL_CHECK_DURATION
$SPELL_CHECK_DURATION = 10.00;
# Initialize
$DEBUG_MODE = false # don't eanble unless you're me, and you're not me, so don't enable
$SCRIPT_NAME = "ultrahunt"
# Watch for saves us from the walk hangup
silence_me if !$DEBUG_MODE
# Timeout
$TIMEOUT_DURATION = 15
$TIMEOUT_MSG = $SCRIPT_NAME+"_TIMEOUT"
# Mind level to kill at
$XP_READY_TO_HUNT = 4
# Goto information
# DO NOT USE BRACKETS IN THE NAMES, it jacks up the script for some reason
# Hunting
$HUNTING_GOTO = "2214" # goto room # from psinet to get to your hunting location
$HUNTING_DESC = "This narrow room would be ideal for a surprise attack" # room description of the $HUNTING_GOTO
$HUNTING_NAME = "Burrows" # the area name of your hunting location. if you don't know, type ;e echo checkarea and copy-paste that here
$HUNTING_PREPARE_LIST = [ 'gird' ] # executed once you are in your hunting location (HUNTING LOCATIONS MUST BE FULLY MAPPED! FAILURE TO DO SO WILL HANG THIS SCRIPT!)
# Resting
$RESTING_GOTO = "1041"
$RESTING_DESC = "A small, shaded park fills an old vacant lot behind a row of buildings"
$RESTING_NAME = "Town Square"
$RESTING_GOTO_TO_RESTING_LOCATION = [ 'stow all' ] # executed to get you from the room # to your actual resting location (useful for unmapped areas and stowing weapons!)
$RESTING_TO_RESTING_GOTO = [ ] # these commands are executed to get you to a room # that PSINET GOTO recognizes from your resting spot (for my example, I was in a table, so out takes me to the room #)
# Healing
$HEALING_GOTO = "1000";
$HEALING_DESC = "Town Square Central"
$HEALING_NAME = "Town Square"
$HEALING_GOTO_TO_HEALING_LOCATION = [ ] # same as above
$HEALING_TO_HEALING_GOTO = [ ] # same as above
# Bank
$BANK_GOTO = "10512";
$BANK_DESC = "First Elanith Bank, Teller"
$BANK_NAME = "First Elanith Bank"
$BANK_GOTO_TO_TELLER = [ ] # get you from psinet room to teller (not needed if rooms are fully mapped)
$TELLER_TO_BANK_GOTO = [ ] # takes you from teller to psinet room (not needed if rooms are fully mapped)
# Pawnshop
$PAWN_GOTO = "10764"
$PAWN_DESC = "Kilron's Pawnshop, Front Room"
$PAWN_NAME = "Kilron's Pawnshop"
$PAWN_GOTO_TO_DEALER = [ ]
$DEALER_TO_PAWN_GOTO = [ ]
# Gemshop
$GEM_GOTO = "10783"
$GEM_DESC = "Gemcutter's, Front Room"
$GEM_NAME = "Gemcutter's"
$GEM_GOTO_TO_DEALER = [ ]
$GEM_DEALER_TO_GOTO = [ ]
# Timeout information
$GOTO_RETRIES = 3 # maximum tries the script will attempt to go to your destination, if this limit is reached the script will exit
$GOTO_TIMEOUT_DURATION = 60 # maximum time that the script will wait for you to reach your destination
$MOVE_DURATION = 0.50 # time in between custom movmemnt commands
# Auto-healing information
# I'm attempting to fool people by using an auto-healer
# It will go to your healing location of choice, ask for healing, wait for a certain amount of time
# If someone heals you, it will say a random response (definable), and give them a tip based on the wounds healed
# In order for this to work, you obviously need the amount of coins, and you can define the tip per wound rank below
$HEALING_REQUEST_RESPONSE = [
'Oy, I could use a touch of healing!',
'Some healing please?',
'Anyone care to take my wounds?',
'I\'m bleeding out here! Can someone heal me?',
'Spare some healing?',
'Anyone transferring wounds?'
]
$HEALING_THANKS_RESPONSE = [
'Thank you.',
'Thanks for the blood!',
'Ah, that\'s better.',
'Much better, thank you.',
'That hit the spot, much obliged',
'Much appreciated.'
]
$HEALING_TIP_PER_RANK = [
100, # rank 1
250, # rank 2
500 # rank 3
]
$HEALING_RETRIES = 3 # number of times to request healing
$HEALING_TIMEOUT = 20 # time in between requests for healing
# Attack information
$STANCE_ATTACK = 'offensive' # stance to attack when in full attack mode (guarded for casters)
$STANCE_GROUND_ATTACK = 'offensive' # stance to attack a creature when it's on the ground
$STANCE_DEFEND = 'defensive' # stance when defending
$ATTACK_DURATION = 3 # roundtime of each attack (hard roundtime!)
$ATTACK_SEQUENCE = [ 'hide', 'ambush' ] # commands to execute when you attack (prep 702, cast target will work)
$ATTACK_SEQUENCE_DELAY = 3 # time between sending the attack commands
$NUM_ATTACK_BEFORE_STANCING = 1 # number of times to attack before making a stance change (useful for slow hitting critters)
$LOOT_SCRIPT = "" # this script will be called to handle looting in the room (i use my ultraskin script for this), if set to "" it will just do a loot command
$LOOT_SCRIPT_DELAY = 0 # the time, in seconds, the above loot script takes to execute
$POST_KILL_SCRIPT = "" # this script will be called directly after a loot script (gathering arrows, etc)
$POST_KILL_SCRIPT_DELAY = 0
# Critter information
$MAX_CRITTERS = 1 # maximum number of critters in one room you will fight
$DEATH_STRING = "dies" # the string that occurs when the critter dies
# Spell information
$SPELL_REFRESH_LIST = [ 'sign of striking' ] # this list of spells will be kept on all the time (signs are good here)
$famcheck = Array.new
# definitions
def checkSpells()
if $timerCheckSpells == 0
refresh = false
waitrt?
$SPELL_REFRESH_LIST.each do |x|
if !checkspell(x)
refresh = true
fput x
end
end
if refresh
sleep 0.50
end
$timerCheckSpells = $SPELL_CHECK_DURATION
end
end
def doLocation(location)
location.each do |x|
fput x
sleep $MOVE_DURATION
end
end
def doGoto(goto, desc)
failed = true
(1...$GOTO_RETRIES).each do
fput "goto "+goto
if matchtimeout $GOTO_TIMEOUT_DURATION, desc
failed = false
break
end
end
if failed
echo "*** STATUS - Unable to complete goto. Script will exit"
exit
end
end
def doBankTransaction(amount)
echo "*** STATUS - Despositing coins" if $DEBUG_MODE
fput "deposit all"
if amount > 0
echo "*** STATUS - Withdrawing amount" if $DEBUG_MODE
fput "withdraw "+amount.to_s
end
end
# returns false on failure to get healed
def getHealed?
# calculate wound cost
echo "*** STATUS - Calculating healing cost" if $DEBUG_MODE
tip = 0
tip+= (Wounds.nerves)*($HEALING_TIP_PER_RANK[Wounds.nerves-1])
tip+= (Wounds.head)*($HEALING_TIP_PER_RANK[Wounds.head-1])
tip+= (Wounds.neck)*($HEALING_TIP_PER_RANK[Wounds.neck-1])
tip+= (Wounds.torso)*($HEALING_TIP_PER_RANK[Wounds.torso-1])
tip+= (Wounds.limbs)*($HEALING_TIP_PER_RANK[Wounds.limbs-1])
echo "*** STATUS - Moving to bank to withdraw tip" if $DEBUG_MODE
doGoto($BANK_GOTO, $BANK_DESC)
doLocation($BANK_GOTO_TO_TELLER)
doBankTransaction(tip)
doLocation($TELLER_TO_BANK_GOTO)
echo "*** STATUS - Moving to healing location" if $DEBUG_MODE
doGoto($HEALING_GOTO, $HEALING_DESC)
doLocation($HEALING_GOTO_TO_HEALING_LOCATION)
echo "*** STATUS - Requesting healing" if $DEBUG_MODE
failed = true
(1..$HEALING_RETRIES).each do |x|
#echo "*** STATUS - Trying to get healing, attempt #"+x.to_s+" of "+$HEALING_RETRIES if $DEBUG_MODE
fput "say "+$HEALING_REQUEST_RESPONSE[rand($HEALING_THANKS_RESPONSE.length)]
check = matchtimeout $HEALING_TIMEOUT, "meditates over you."
if check
send_to_script $SCRIPT_NAME, check
$name = matchfind "? meditates over you."
failed = false
break
end
end
if failed
echo "*** STATUS - Failed to receive healing" if $DEBUG_MODE
doLocation($HEALING_TO_HEALING_GOTO)
return false
end
echo "*** STATUS - Received healing, tipping and thanking" if $DEBUG_MODE
fput "give "+$name+" "+tip.to_s
fput "'::"+$name+" "+$HEALING_THANKS_RESPONSE[rand($HEALING_THANKS_RESPONSE.length)]
(1..$HEALING_RETRIES).each do |x|
sleep $HEALING_TIMEOUT
if !wounded?
break
end
end
doLocation($HEALING_TO_HEALING_GOTO)
return true
end
# has to be a better way to do this!
def wounded?
if [Wounds.head, Wounds.neck, Wounds.torso, Wounds.limbs, Wounds.nerves].max > 0
return true
end
return false
end
def checkNPC()
$famcheck = checknpcs
$famcheck.delete('mouse')
$famcheck.delete('halberd')
$famcheck.delete('falchion')
end
def checkAttackResult()
echo "*** STATUS - Checking attack result" if $DEBUG_MODE
# Check monster status
fput "look at "+$name
string = matchtimeout 1, "dead", $DEATH_STRING, "ground", "stunned", "calm", "Roundtime"
echo "*** STATUS - Got attack result "+string.to_s if $DEBUG_MODE
case string
when /#{$DEATH_STRING}/, /dead/
$hasStatus = true
$dead = true
when /stunned/
$hasStatus = true
$stunned = true
when /ground/
$hasStatus = true
$ground = true
$stunned = false
else
$dead = false
$ground = false
$stunned = false
end
echo "*** STATUS - Stunned = "+$stunned.to_s if $DEBUG_MODE
echo "*** STATUS - Ground = "+$ground.to_s if $DEBUG_MODE
echo "*** STATUS - Dead = "+$dead.to_s if $DEBUG_MODE
echo "*** STATUS - hasStatus = "+$hasStatus.to_s if $DEBUG_MODE
end
def verifyStatus()
if !$dead
echo "*** STATUS - Verifying critter status" if $DEBUG_MODE
fput "look"
string = matchtimeout 1, "appears dead", "lying", "stunned", "dead"
echo "*** STATUS - Got verify result "+string.to_s if $DEBUG_MODE
# Check monster status
case string
when /appears dead/
$dead = true
when /stunned/
$stunned = true
when /lying/
$ground = true
$stunned = false
$dead = false
else
$stunned = false
$ground = false
$hasStatus = false
end
echo "*** STATUS - Stunned = "+$stunned.to_s if $DEBUG_MODE
echo "*** STATUS - Ground = "+$ground.to_s if $DEBUG_MODE
echo "*** STATUS - Dead = "+$dead.to_s if $DEBUG_MODE
echo "*** STATUS - hasStatus = "+$hasStatus.to_s if $DEBUG_MODE
sleep 0.25
end
end
def attack(stance)
$timerInactive = $TIMEOUT_DURATION;
echo "*** STATUS - Attack with stance "+stance if $DEBUG_MODE
fput "stance "+stance
# I didn't use fput because sometimes it didn't recognize an attack as valid
# which really jacked things up. It took me FOREVER to figure out what the cause
# of that was.
(1..$NUM_ATTACK_BEFORE_STANCING).each do |num|
if !$dead
waitrt?
$ATTACK_SEQUENCE.each do |x|
waitrt?
put x
if !$ATTACK_SEQUENCE.empty?
echo "**** STATUS - Attack sequence delay of "+$ATTACK_SEQUENCE_DELAY.to_s+" seconds" if $DEBUG_MODE
sleep $ATTACK_SEQUENCE_DELAY
end
end
checkAttackResult()
if num < $NUM_ATTACK_BEFORE_STANCING
sleep $ATTACK_DURATION
end
end
end
end
def defend(stance)
$timerInactive = $TIMEOUT_DURATION;
echo "*** STATUS - Defend with stance "+stance if $DEBUG_MODE
fput "stance "+stance
end
def resetStatus()
$hasStatus = false
$dead = false
$stunned = false
$ground = false
sleep 0.50
end
$stunned = false
$ground = false
$dead = false
$hasStatus = false
timer = Thread.new {
loop {
if $timerInactive > 0
$timerInactive-= 1
else
$timerInactive = $TIMEOUT_DURATION
fput "look"
end
if $timerCheckSpells > 0
$timerCheckSpells-= 1
end
sleep 1
}
}
# Run forever
loop {
# Death check
if dead? or (health? < maxhealth*0.15)
fput "quit"
exit
end
# Stand check
if !checkstanding
fput "stand"
end
case checkarea
when $RESTING_NAME
if checkmind $XP_READY_TO_HUNT
# Cooldown
echo "*** STATUS - Mind full, resting 60 seconds" if $DEBUG_MODE
$timeout = 61
sleep 60
else
# Ready to hunt
doLocation($RESTING_TO_RESTING_GOTO)
doGoto($HUNTING_GOTO, $HUNTING_DESC)
doLocation($HUNTING_PREPARE_LIST)
end
when $HUNTING_NAME
if !checkfried and (health? > checkhealth*0.50)
# Check our spells
checkSpells()
# Walk until we find a critter by itself, then kill it
$timeout = $TIMEOUT_DURATION
until walk
line = script.gets
echo "*** STATUS - Walk returning "+line if $DEBUG_MODE
if $stormfront
waitfor("Obvious [A-z]+:")
sleep 0.15
end
end
echo "*** STATUS - Done walking "+line if $DEBUG_MODE
# Fix for the stupid walking hangup
if !matchtimeout 0.25, "You can't go there"
if !checkpcs.length
# Get critter name
fput "target random"
$name = matchfind "You are now targeting a ?.", "Could not find a valid target."
$name = $name.split(' ')
$name = $name.last
echo "*** STATUS - Targetting "+$name.to_s if $DEBUG_MODE
checkNPC() # refresh NPC list to ensure nothing walked in on us
echo "*** STATUS - Entering loop" if $DEBUG_MODE
while $famcheck.length <= $MAX_CRITTERS and !$famcheck.empty?
#$timeout = $TIMEOUT_DURATION
if $hasStatus
verifyStatus() # make sure they didn't unstun before we attack
if $dead
if $LOOT_SCRIPT == ""
fput "loot"
else
start_script($LOOT_SCRIPT);
sleep $LOOT_SCRIPT_DELAY
end
if $POST_KILL_SCRIPT == ""
fput "loot"
else
start_script($POST_KILL_SCRIPT);
sleep $POST_KILL_SCRIPT_DELAY
end
resetStatus()
else
if $stunned
attack($STANCE_ATTACK)
defend($STANCE_DEFEND)
elsif $ground
attack($STANCE_GROUND_ATTACK)
defend($STANCE_DEFEND)
end
end
else
echo "*** STATUS - Waiting for game input" if $DEBUG_MODE
line = script.gets
case line
when /at you/, /but fails in the/, /#{$DEATH_STRING}/, /helplessly/, /dead/, /limp/
attack($STANCE_ATTACK)
defend($STANCE_DEFEND)
else
echo "*** STATUS - Invalid command ("+line+"). Trying again." if $DEBUG_MODE
end
end
# update NPC list
echo "*** STATUS - Updating NPC list." if $DEBUG_MODE
checkNPC()
# check spells
echo "*** STATUS - Updating active spells." if $DEBUG_MODE
checkSpells()
# Clear out
#line = ''
#sleep 0.25
end
end
end
else
# Fried, go back
echo "*** STATUS - Fried or injured, returning to rest" if $DEBUG_MODE
# attempt to go get healing
if wounded?
echo "*** STATUS - You're wounded, let's get you healed" if $DEBUG_MODE
if getHealed?
echo "*** STATUS - Healing success!" if $DEBUG_MODE
end
else
# do the deposit bank money here (if we got healed, we already deposited everything)
fput "wealth"
if !(matchtimeout 1, "You have no silver coins with you.")
doLocation($RESTING_TO_RESTING_GOTO)
doGoto($BANK_GOTO, $BANK_DESC)
doLocation($BANK_GOTO_TO_TELLER)
doBankTransaction(0)
doLocation($TELLER_TO_BANK_GOTO)
end
end
doGoto($RESTING_GOTO, $RESTING_DESC)
doLocation($RESTING_GOTO_TO_RESTING_LOCATION)
end
else
# Unknown location
echo "*** STATUS - Invalid start location, attempting to move to rest location" if $DEBUG_MODE
doGoto($RESTING_GOTO, $RESTING_DESC)
doLocation($RESTING_GOTO_TO_RESTING_LOCATION)
end
}
SpiffyJr
04-28-2008, 06:32 PM
# UltraSkin Lich Edition by Kyle Spraggs
# Auto Looter, Skinner, Searcher, and Sorter
# 3/22/2008
Settings.load
silence_me
# Script setup
def setup()
toggle_echo; toggle_unique; toggle_echo
clear
echo "Okay, let's setup UltraSkin"
echo "Reply to the following questions by typing \";s to us <answer>\""
echo "There is no checking for those questions but if you mess up the script likely won't operate."
echo
echo "What is your GENERIC LOOT container?"
Settings["generic"] = unique_get
Settings.save
echo "What is your GEM LOOT container?"
Settings["gem"] = unique_get
Settings.save
echo "What is your WAND LOOT container?"
Settings["wand"] = unique_get
Settings.save
echo "What is your SCROLL LOOT container?"
Settings["scroll"] = unique_get
Settings.save
echo "What is your HERB LOOT container?"
Settings["herb"] = unique_get
Settings.save
echo "Skin corpses? (yes/no)"
Settings["autoskin"] = unique_get
Settings.save
if(Settings["autoskin"] =~ /yes/i)
echo "What is your SKIN LOOT container?"
Settings["skin"] = unique_get
Settings.save
echo "Use alternate weapon? (yes/no)"
Settings["usealternate"] = unique_get
Settings.save
else
Settings["usealternate"] = "no";
Settings.save
end
if(Settings["usealternate"] =~ /yes/i)
echo "What is your ALTERNATE WEAPON?"
Settings["alternate"] = unique_get
Settings.save
echo "What is your ALTERNATE WEAPON SHEATH?"
Settings["alternatesheath"] = unique_get
Settings.save
end
echo "Pickup boxes automatically (yes/no)?"
Settings["getbox"] = unique_get
Settings.save
if(Settings["getbox"] =~ /yes/i)
echo "What is your BOX LOOT container?"
Settings["box"] = unique_get
end
Settings.save
echo "Pickup alchemy components automatically (yes/no)?"
Settings["getalchemy"] = unique_get
Settings.save
if(Settings["getalchemy"] =~ /yes/i)
echo "What is your ALCHEMY LOOT container?"
Settings["alchemy"] = unique_get
end
Settings.save
echo "Auto close/open gem container? (yes/no)"
Settings["autoclose"] = unique_get
Settings.save
echo "If hands are full, stow which hand? (left/right)"
Settings["handsfull"] = unique_get
Settings.save
echo "What command should I use to get the stowed item?"
Settings["handsfullcommand"] = unique_get
Settings.save
echo "All done!"
exit
end
def grabLoot(name, container)
# check hands
if righthand? and lefthand?
$hadRight = 1
if(Settings["handsfull"] =~ /left/i)
fput "stow left"
else
fput "stow right"
end
end
fput "get "+name
fput "put my "+name+" in my "+container
waitfor "You put"
end
def diskLoot(name)
# check hands
echo "diskloot"
if righthand? and lefthand?
$hadRight = 1
if Settings["handsfull"] =~ /left/i
fput "stow left"
else
fput "stow right"
end
end
fput "get "+name
fput "put my "+name+" in disk"
if(matchtimeout 1, "You put")
return 1
end
return 0
end
#
# Gems
#
gemdb = [ "faenor-bloom", "star ruby", "aetherstone", "agate", "azurite", "beryl", "bloodjewel", "bloodstone", "bluerock", "caederine", "cordierite", "deathstone", "doomstone", "dreamstone", "eostone", "firestone", "galena", "geode", "hyacinth", "onyx", "pyrite", "peridot", "rhimar", "riftshard", "riftstone", "rosepar", "wyrdshard", "spinel", "shard", "faenor", "blazestar", "despanal", "feystone", "diamond", "emerald", "ruby", "pearl", "sapphire", "opal", "jacinth", "garnet", "moonstone", "topaz", "gem", "coral", "sunstone", "starstone", "quartz", "heliodor", "glimaerstone", "carbuncle", "turquoise", "chalcedony", "tourmaline", "obsidian", "zircon", "amethyst", "lapis", "amber" , "sphene" , "shell", "stone", "lapis" ]
#
# Herbs
#
herbdb = [ "leaf", "lichen", "grass", "root", "stem", "moss", "clove", "flower" ]
#
# Boxes
#
boxdb = [ "strongbox", "box", "chest", "coffer", "trunk" ]
#
# Scrolls
#
scrolldb = [ "paper", "vellum", "scroll", "parchment", "palimpset" ]
#
# Wands
#
wanddb = [ "wand", "rod" ]
#
# Alchemy components
#
alchemydb = [ "crystal", "core", "air", "fire", "water", "earth", "shard" ]
#
# All other loot
#
genericdb = [ "ring", "statue", "miniature", "figurine", "bracelet", "crystal", "amulet", "orb" ]
#
# Help text
#
$helpdata = <<ENDHELP
This script will skin, loot, search, and sort all skins/loot automatically into
respective containers. All options are configurable and can be set by calling
;a setup.
USAGE\: ;us <critter>
ENDHELP
if variable[1] =~ /\bhelp\b/i then respond($helpdata); exit end
if variable[1] =~ /setup/i then setup(); end
##
# START OF SCRIPT
##
$hadRight = 0;
start:
if(Settings["autoskin"] =~ /yes/i)
# do skinning
# alternate weapon
if Settings["usealternate"] =~ /yes/i
if righthand?
$hadRight = 1
if(Settings["handsfull"] =~ /left/i)
fput "stow left"
else
fput "stow right"
end
end
fput "get my #{Settings["alternate"]} from my #{Settings["alternatesheath"]}"
end
fput "kneel"
fput "skin #{variable[1]}"
skin = matchfind "yielding an ?.", "yielding a ?.", "You botched the job.", "You cannot skin"
skin = skin.split(" ");
fput "stand"
waitrt?
if !skin.empty?
if Settings["usealternate"] =~ /yes/i
fput "put my #{Settings["alternate"]} in my #{Settings["alternatesheath"]}"
elsif righthand? and lefthand?
$hadRight = 1
if(Settings["handsfull"] =~ /left/i)
fput "stow left"
else
fput "stow right"
end
end
fput "get #{skin[skin.length-1]}"
waitfor "You"
fput "put my #{skin[skin.length-1]} in my #{Settings["skin"]}"
waitfor "You put"
end
if Settings["usealternate"] =~ /yes/i and righthand?
fput "put my #{Settings["alternate"]} in my #{Settings["alternatesheath"]}"
waitfor "You put"
end
end
# do looting
fput "loot"
# setup loot
loot = checkloot
herbs = loot & herbdb
gems = loot & gemdb
scrolls = loot & scrolldb
wands = loot & wanddb
generic = loot & genericdb
alchemy = loot & alchemydb
box = loot & boxdb
# grab all loot
herbs.each do |x|
grabLoot(x, Settings["herb"])
end
if !gems.empty?
if Settings["autoclose"] =~ /yes/i
fput "open my "+Settings["gem"]
end
gems.each do |x|
grabLoot(x, Settings["gem"])
end
if Settings["autoclose"] =~ /yes/i
fput "close my "+Settings["gem"]
end
end
scrolls.each do |x|
grabLoot(x, Settings["scroll"])
end
wands.each do |x|
grabLoot(x, Settings["wand"])
end
generic.each do |x|
grabLoot(x, Settings["generic"])
end
if Settings["getalchemy"] =~ /yes/i
alchemy.each do |x|
grabLoot(x, Settings["alchemy"])
end
end
if Settings["getbox"] =~ /yes/i
box.each do |x|
if !diskLoot(x, Settings["box"])
grabLoot(x, Settings["box"])
end
end
end
if $hadRight == 1
fput Settings["handsfullcommand"]
end
Drunken Durfin
04-29-2008, 09:10 AM
Pulled out some of your code to replace my hackey lich utility scripts.
Thanks for posting, quite the GS oriented Ruby tutorial. Much appreciated.
SpiffyJr
04-29-2008, 10:29 AM
Very much welcome. Enjoy :D
100% Wool
04-29-2008, 01:25 PM
man. i'm impressed. my lich scripts have NEVER looked like this. they all looked like hi-tech looking wizard scripts with extensive matches.
totally wasn't using lich to its capabilities.
i can't understand what the heck is going on in these scripts.
I had some pretty extensive scripts too that autopicked for me and had ring-navv-recovery features and all that
how long did it take you to learn Ruby?
SpiffyJr
04-29-2008, 01:29 PM
I picked up the basics of Ruby in 2-3 days. I by no means know ALL of Ruby and would wager my Ruby knowledge is around 10% of total :D
BigWorm
04-29-2008, 02:56 PM
Nice stuff. Next time use the [code] tag to keep your code pretty.
SpiffyJr
12-01-2008, 12:30 AM
Bump for the new update.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.