PDA

View Full Version : Lich Steel Golem Hunter for Wizard



LilWizzy
08-28-2009, 05:32 PM
Some setup required but most is done easily. You will also need a spellup script of your own.


##### Steel Golems hunting script for Wizards
##### Starts from TSC
##### Thanks for all the help from Tillmen and Blueland!


def rest
while ((checkmana != maxmana) || (checkfried))
pause 100
end
gohunting
end

################################################
###### Global Variables to set ###########
################################################

$GEMCONTAINER = "backpack"
$LOOTCONTAINER = "backpack"
$ATTACKSTANCE = "advance"
$DEFENDSTANCE = "defensive"
$ATTACKRT = "4"
$LOOTHAND = "left"


################################################
########## Looting Definition ############
################################################

def loot
goodloot=["silver wand", "ring", "stickpin", "bracelet", "scroll", "vellum", "parchment", "diamond", "emerald", "onyx", "faenor-bloom", "star ruby", "wand", "aetherstone", "agate", "azurite", "beryl", "bloodjewel", "bloodstone", "bluerock", "caederine", "cordierite", "deathstone", "doomstone", "dreamstone", "eostone", "firestone", "galena", "geode", "hyacinth", "pyrite", "peridot", "rhimar", "riftshard", "riftstone", "rosepar", "wyrdshard", "spinel", "faenor", "blazestar", "despanal", "feystone", "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","gem","mother-of-pearl","lazuli", "jade", "ivory", "nugget"]
fput "loot"
badloot=[/heavy .*? orb/]
if RoomObj.loot and !(checkloot.to_a & goodloot).empty?
(0..RoomObj.loot.length).each do |x|
if goodloot.include?(RoomObj.loot[x].noun) and badloot.include?(RoomObj.loot[x].name)
elsif goodloot.include?(RoomObj.loot[x].noun)
fput "get ##{RoomObj.loot[x].id}"
fput "stow #{$LOOTHAND}"
end
end
end
pause 2
end

###############################################
######## Other Definitions ############
###############################################
def prehunt
start_script 'spellupscript'
pause 1
end

def bank
start_script 'go2', [ '400', '_disable_confirm_' ]
waitfor "First Elanith Bank, Teller"
pause 2
end

def gemshop
start_script 'go2', [ '298', '_disable_confirm_' ]
waitfor "A short distance to the east lies a broad intersection"
pause 2
multifput("store weapon", "go shop","remove my #{$GEMCONTAINER}","sell my #{$GEMCONTAINER}","wear my #{$GEMCONTAINER}","close my #{$GEMCONTAINER}")
end

def restplace
start_script 'go2', [ '228', '_disable_confirm_' ]
waitfor "Town Square Central"
pause 1
fput "sit"
pause 2
end

def stand
if !Char.standing?
fput "stand"
waitrt?
end
end

def huntinglocation
start_script 'go2', [ '7826', '_disable_confirm_' ]
waitfor "This intersection leads east, west, and south"
pause 2
end

def wander
##### You will need to set up your own badrooms #####
bad_rooms = []
pastfried=0
until pastfried >= 2 or dead? or checkmana <= 2
room = Room.current
begin
next_room = room.wayto.keys[rand(room.wayto.keys.length)]
end while bad_rooms.include?(next_room)
way = room.wayto[next_room]
if way.class == String
move(way)
else
way.call
end
if checkpcs or checkloot.include?("disk")
sleep 1
elsif RoomObj.npcs.find { |npc| npc.status == 'dead' }
elsif checknpcs and RoomObj.npcs.find { |npc| npc.status != 'dead'}
if checkmind(7)
pastfried=pastfried+1
end
until !checknpcs or dead? or !RoomObj.npcs.find { |npc| npc.status != 'dead'}
fput 'stance defensive'
attack
end
loot
end
end
end

def attack
stand
killroutine
end

def killroutine
stand
fput "target random"
$name = matchfind "You are now targeting a ?.", "Could not find a valid target."
$name = $name.split(' ')
$name = $name.last
if (checkmana > 4)
multifput("stance #{$ATTACKSTANCE}","prep 904","incant #{$name}")
pause $ATTACKRT
elsif (checkmana > 1)
multifput("stance #{$ATTACKSTANCE}","prep 901","incant #{$name}")
pause $ATTACKRT
else
restplace
end
end

def gohunting
stand
multifput("stance def","open my #{$LOOTCONTAINER}","ready weapon")
huntinglocation
wander
if dead?
fput "quit"
end
gemshop
bank
fput "deposit all"
restplace
## prehunt
rest
end

if checkroom "Town Square Central"
rest
else
gohunting
end