Didnt make myself but here is a great bot and i quote
I ran this bot last night unattended. It ended up killing 340 mobs even to 2 levels below me. It did stop, but it didn't matter because I had died enough to break all my armor. I checked my combat backscroll and it was still attempting to fight even with broken armor. So the corpserun is working. 340 mobs was more than half of level 47 so I was quite pleased. Also woke up to a full inventory worth about 10-15g of misc crap and a few greens.
**Fixed problem with not attacking
**Fixed problem with running by targets
**Corpserun working
TODO:
GUI the variables
Create a safe point run that you'll run to in travelform right after rezzing
***CONFIGURE THE VARIABLES***
You will need to configure the following variables:
_KEY_ATTACK = "1" //Key to start normal attack
_KEY_CLAW = "2" //Key for claw
_KEY_BITE = "3" //Key for bite or rip
_KEY_CATFORM = "{F12}" //Key to enter catform
_KEY_HEALINGTOUCH = "2" //Key for healing touch
_KEY_TARGETSELF = "{F1}" //Not used install smartcast UI mod
_KEY_CLEARTARGET = "0" //Setup alias that does /script ClearTarget();
_KEY_SHADOWMELD = "9" //If you're a nightelf the key for shadowform
_KEY_MOW = "=" //Key for Mark of the Wild
shadowmeld = 1 //1 if you have shadowform
minhp = 1000 //minimum hps allowed after combat before casting HT
maxhp = 1819 //max num of hps
dangerhp = 700 //number of hps at which you will heal in combat
minmana = 1500 //minimum amount of mana before you will regen mana outside combat
htcost = 445 //cost of healing touch
catcost = 600 //cost to change into catform
If you are a nightelf you will use shadowmeld while regenning mana. This will also cast Mark of the Wild after every 10 rest periods.
There is one little bug that will cause you to run by your current target and loop back. I haven't been able to track this down, if you find it please let me know.
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Code:
----------------------------------------------------------------------------------
-- TinyToon version 1.3b -
< DRUID CATFORM EDITION >
-- based on Blizzbot 1.1 by n1ce
-- forceshock gamehacking-interpreter required!
-- please download from http://www.forceshock.net/
-- World of Warcraft 1.3.1
-- Forceshock Version 0.999+
-- ; CREDITS
-- ; original Bot (blizzbot v1.1) and some math by n1ce
-- ; All hacks and most of the math by Outlaw
-- ; A lot of bugfix info by paledim
-- ; US/EU 1.3.1 modification by n1ce
-- ; optimized combat by deeper (v1.2)
-- ; toon object by deeper (v1.2)
-- ; optimized engine by deeper (v1.2)
-- ; optimized for Forceshock 0.999 nice (v1.3)
-- ; druid catform by joreallean(v1.1)
-----------------------------------------------------
-- ; Extra fame goes too
-------------------------------------------------------------------------
-- ; catvir and brainiac2k for reversing WoW since the beginning :)
-------------------------------------------------------------------------
-- ; LICENSE
-------------------------------------------------------------------------
-- ; GNU GENERAL PUBLIC LICENSE
-- ; http://www.gnu.org/copyleft/gpl.html
-------------------------------------------------------------------------
-- CONSTANTS
_APPNAME = "TinyToon"
_VERSION = "1.3b"
_DATE = "20050329"
_FS_VERSION = 0.999
-- ; HOTKEY SETUP, CHANGE TO FIT YOUR NEEDS
_KEY_ATTACK = "1"
_KEY_CLAW = "2"
_KEY_BITE = "3"
_KEY_CATFORM = "{F12}"
_KEY_HEALINGTOUCH = "2"
_KEY_TARGETSELF = "{F1}"
_KEY_CLEARTARGET = "0"
_KEY_SHADOWMELD = "9"
_KEY_MOW = "="
shadowmeld = 1
minhp = 1000
maxhp = 2161
dangerhp = 700
minmana = 1500
htcost = 545
catcost = 550
buffcount = 0
healingbool = 0
---------------------------------------------------------------------------------
-- ; WoW functions by Outlaw
---------------------------------------------------------------------------------
function GetPlayerPtr(hWnd)
register = Asm.FastCall(hWnd,"0x46F4D0","0x10","0x818358",Asm.Ptr("9A1B98"),0)
return register.eax
end
---------------------------------------------------------------------------------
-- ; Player structure
---------------------------------------------------------------------------------
-- modified by deeper 20.02.2005 v1.2
toon = {}
toon.__index = toon
function toon.init(hWnd)
local t = {}
setmetatable(t,toon)
PrintConsole("Initializing Toon! [")
i = 1
while 1 do
-- ; Calculations to defeat DMA by Outlaw
PrintConsole(".")
baseptr = GetPlayerPtr(hWnd)
t.hWnd = hWnd
t.ts_Battleshout = 0
t.ptr_unit_struct = HexSub(baseptr,"8")
t.ptr_hitpoints = HexAdd(t.ptr_unit_struct,"1CE8")
t.ptr_mana = HexAdd(t.ptr_unit_struct,"1CEC")
t.ptr_maxmana = HexAdd(t.ptr_mana,"18")
t.ptr_maxhp = HexAdd(t.ptr_hitpoints,"18")
t.ptr_combo = HexAdd(t.ptr_unit_struct,"2CD1")
t.ptr_form = HexAdd(t.ptr_unit_struct,"1ECE")
t.ptr_current_xp = HexAdd(t.ptr_unit_struct,"21A8")
t.ptr_max_xp = HexAdd(t.ptr_unit_struct,"21AC")
t.ptr_alive = HexAdd(t.ptr_unit_struct,"1F2D")
t.ptr_rage = HexAdd(t.ptr_mana,"4")
t.ptr_energy = HexAdd(t.ptr_rage,"8")
t.ptr_facing = HexAdd(t.ptr_unit_struct,"93C")
t.ptr_internal_z = HexSub(t.ptr_facing,"4")
t.ptr_internal_y = HexSub(t.ptr_internal_z,"4")
t.ptr_internal_x = HexSub(t.ptr_internal_y,"4")
if ReadDword(hWnd,t.ptr_hitpoints) > 30 and ReadDword(hWnd,t.ptr_hitpoints) < 10000 and ReadFloat(hWnd,t.ptr_facing) > -1 and ReadFloat(hWnd,t.ptr_facing) < 7 then
PrintConsoleLine("] ready")
t:refresh()
break
else
i = i + 1
if i > 50 then
PrintConsoleLine("] Failed.")
PrintConsoleLine("Make sure you have logged your toon in!")
return nil
end
end
Sleep(100)
end
return t
end
function toon:refresh()
self.hp = ReadDword(self.hWnd,self.ptr_hitpoints)
self.mana = ReadDword(self.hWnd,self.ptr_mana)
self.maxmana = ReadDword(self.hWnd,self.ptr_maxmana)
self.maxhp = ReadDword(self.hWnd,self.ptr_maxhp)
self.energy = ReadDword(self.hWnd,self.ptr_energy)
self.rage = ReadDword(self.hWnd,self.ptr_rage)
self.combo = ReadByte(self.hWnd,self.ptr_combo)
self.form = ReadByte(self.hWnd,self.ptr_form)
self.TargetID = ReadDword(self.hWnd,"9ABFB8")
self.hoverID = ReadDword(self.hWnd,self.ptr_hover_id)
self.playerID = ReadDword(self.hWnd,"9A1B98")
self.xp = ReadDword(self.hWnd,self.ptr_current_xp)
self.maxxp = ReadDword(self.hWnd,self.ptr_max_xp)
self.alive = ReadByte(self.hWnd,self.ptr_alive)
self.x = ReadFloat(self.hWnd,self.ptr_internal_x)
self.y = ReadFloat(self.hWnd,self.ptr_internal_y)
self.z = ReadFloat(self.hWnd,self.ptr_internal_z)
self.facing = ReadFloat(self.hWnd,self.ptr_facing)
self.ptrAttacker = nil
self.hp_percent = 100 / self.maxhp * self.hp
self.mana_percent = 100 / self.maxmana * self.mana
end
function toon:GetAttackerPtr()
PrintConsole("looking up attacker ...")
ptr = nil
-- wait to make sure the server sends a Target
count = 100
while self.TargetID == 0 and count > 0 do
Sleep(1)
self.TargetID = ReadDword(hWnd,"9ABFB8")
count = count - 1
end
if self.TargetID ~= 0 then
ptr = NpcIDToPtr(hWnd,self.TargetID)
Npc = GetNpcData(hWnd,ptr)
if Npc.hp > 0 and Npc.hp <= 100 then
self.ptrAttacker = ptr
end
end
PrintConsoleLine(" done.")
return ptr
end
function toon:GetDistance(x,y)
return GetDistance(self.x,self.y,x,y)
end
function toon:setCorpseLoc()
self.corpsex = self.x
self.corpsey = self.y
end
function toon:GetCorpseLoc()
return self.corpsex,self.corpsey
end
function toon:GetLoc()
return self.x,self.y
end
---------------------------------------------------------------------------------
-- ; Npc handling
---------------------------------------------------------------------------------
function ResetNpcBuffer(hWnd)
WriteDword(hWnd,hook.clear,1)
Sleep(100)
end
function CreateNpcBuffer(hWnd,loops)
WriteDword(hWnd,hook.loops,loops)
end
function GetNpcBufferPtr()
return hook.npc_array
end
function GetLocOfNextNpcPtr(buffer,size)
return HexAdd(buffer,"4")
end
function IsNpcBufferReady(hWnd)
if ReadDword(hWnd,hook.loops) == 0 then
return 1
else
return 0
end
end
function GetNpcCount(hWnd)
return ReadDword(hWnd,hook.npc_count)
end
function WaitForNpcBuffer(hWnd) while IsNpcBufferReady(hWnd) ~= 1 do
Sleep(10)
end
end
function NpcIDToPtr(hWnd,sid)
CreateNpcBuffer(hWnd, 1000)
WaitForNpcBuffer(hWnd)
iNpcs = GetNpcCount(hWnd)
if iNpcs > 0 then
p = GetNpcBufferPtr()
ptr = ReadHex(hWnd,p)
while iNpcs ~= 0 do
Npc = GetNpcData(hWnd,ptr)
if Npc.id == sid then
return ptr
end
p = GetLocOfNextNpcPtr(p)
ptr = ReadHex(hWnd,p)
iNpcs = iNpcs - 1
end
end
return nil
end
---------------------------------------------------------------------------------
-- ; Npc structure
---------------------------------------------------------------------------------
function GetNpcData(hWnd,ptr)
Npc = {
ptr = ptr,
id = ReadDword(hWnd,HexAdd( ptr , "4C0")),
hp = ReadDword(hWnd,HexAdd( ptr , "354")),
level = ReadDword(hWnd,HexAdd( ptr , "548")),
faction = ReadDword(hWnd,HexAdd( ptr , "54C")),
x = ReadFloat(hWnd, HexAdd( ptr , "10")),
y = ReadFloat(hWnd, HexAdd( ptr , "14")),
z = ReadFloat(hWnd, HexAdd( ptr , "18")),
facing = ReadFloat(hWnd, ptr ,"1C"),
}
return Npc
end
---------------------------------------------------------------------------------
-- ; Hook
-- ; 12.2.2005 Redone by Outlaw
-- ; 23.2.2005 Redone by Outlaw
-- ; 4.3.2005 Redone by Outlaw
---------------------------------------------------------------------------------
function Sense_Hook(hWnd,hook)
h = hook
ret = HexAdd(h,"6")
-- ; .DATA
hook = {
clear = Asm.AllocateMemory(hWnd,4),
loops = Asm.AllocateMemory(hWnd,4),
npc_count = Asm.AllocateMemory(hWnd,4),
npc_array = Asm.AllocateMemory(hWnd,1024)
}
-- ; .CODE
asm = #ASM_START
; START
@sense_hack:
push ecx
push eax
cmp dword *(hook.clear),1
je @empty_data
cmp dword *(hook.loops),0
je @end
dec dword *(hook.loops)
add ecx,354h
cmp dword [ecx],64h
jg @end
cmp dword [ecx],1h
jl @end
add ecx,1F4h
cmp dword [ecx],1h
jl @end
cmp dword [ecx],50h
jg @end
sub ecx,548h
mov eax, &(hook.npc_array)
@check_if_new:
cmp dword [eax],0
je @add_npc
cmp dword [eax],ecx
je @end
add eax,4h
jmp @check_if_new
@add_npc:
mov dword [eax],ecx
inc dword *(hook.npc_count)
jmp @end
@empty_data:
mov eax, &(hook.npc_array)
mov dword *(hook.clear),0
mov dword *(hook.npc_count),0
mov dword *(hook.loops),0
@empty_loop:
cmp dword [eax],0
je @end
mov dword [eax],0
add eax,4h
jmp @empty_loop
@end:
pop eax
pop ecx
sub esp,40h
mov eax,dword [ecx+38h]
jmp dword &(ret)
; end
#ASM_END
code = Asm.AllocateMemory(hWnd,Asm.OpCodeSize(asm))
Asm.Write(hWnd,code,asm)
-- ; .HOOK
Asm.WriteJmp(hWnd,h,code,1)
return hook
end
---------------------------------------------------------------------------------
-- ; Helper functions
---------------------------------------------------------------------------------
function DebugMessage(message,line,debug)
if debug == 1 then
PrintConsole(message)
if line == 1 then PrintConsoleLine("")
end
end
end
function WaitForTargetID(hWnd,id,time)
PrintConsole("[+ Waiting for Target ID: "..IntToStr(id).." ...")
tn:refresh()
ohp = tn.hp
while tn.TargetID ~= id do
if time == 1 then
PrintConsoleLine(" time out]")
return 0
end
Sleep(10)
time = time - 1
tn:refresh()
if tn.hp < ohp then
PrintConsoleLine(" skipping]")
return 0
end
ohp = tn.hp
end
PrintConsoleLine(" ready]")
return 1
end
function WaitForTargetIsNotNull(hWnd,time)
PrintConsole("[+ Waiting until there is a Target ...")
tn:refresh()
ohp = tn.hp
while tn.TargetID == 0 do
if time == 1 then
PrintConsoleLine(" time out]")
return 0
end
Sleep(10)
time = time - 1
tn:refresh()
if tn.hp < ohp then
PrintConsoleLine(" skipping]")
return 0
end
ohp = tn.hp
end
PrintConsoleLine(" ready]")
return 1
end
function GetNpc(hWnd,cat,corpse,wpx,wpy,minl,maxl,rad,debug)
-- optimized by deeper v1.2
-- looksup a valid Npc, returns a Npc
-- cat: 0 return lowest range, ... (more to come)
-- corpse: 1 return corpses found, 0 dont
data = {}
i = 0
PrintConsoleLine("SCANNING FOR MOBS!")
CreateNpcBuffer(hWnd,2000)
WaitForNpcBuffer(hWnd)
iNpcs = GetNpcCount(hWnd)
if iNpcs > 0 then
p = GetNpcBufferPtr()
ptr = ReadHex(hWnd,p)
tn:refresh()
while iNpcs ~= 0 do
valid = 1
Npc = GetNpcData(hWnd,ptr)
DebugMessage(" scanning ... Npc HP% : "..IntToStr(Npc.hp).." range: "..IntToStr(GetDistance(tn.x,tn.y,Npc.x,Npc.y)).." level: "..IntToStr(Npc.level).." ID: "..IntToStr(Npc.id),1,debug)
-- is the Npc blacklisted?
n = blacklist_count
while n > 0 and valid == 1 do
if Blacklist[n] == Npc.id then
DebugMessage(" ... is blacklisted!",1,debug)
valid = 0
end
n = n - 1
end
-- is the Npc in the hunting Radius of the current Waypoint?
if GetDistance(wpx,wpy,Npc.x,Npc.y) > rad and valid == 1 then
DebugMessage(" ... is out of hunting radius!",1,debug)
valid = 0
end
-- is the Npc dead?
if Npc.hp == 0 and valid == 1 then
if corpse == 1 then
DebugMessage(" ... corpse found! ok.",1,debug)
return ptr
else
DebugMessage(" ... is dead!",1,debug)
valid = 0
end
end
-- does the Npc match the level requirements?
if (Npc.level < minl or Npc.level > maxl) and valid == 1 then
DebugMessage(" ... does not match level requirement!",1,debug)
valid = 0
end
-- is the Npc at full health?
if Npc.hp ~= 100 and valid == 1 then
DebugMessage(" ... is already fighting!",1,debug)
valid = 0
end
if Npc.id <= 0 or Npc.id >= 297000000 then
DebugMessage(" ... id not valid!",1,debug)
valid = 0
end
-- if everything was ok, add the Npc to our list for category checks ...
if valid == 1 then
DebugMessage(" ... adding to valid list!",1,debug)
data[i] = ptr
i = i + 1
end
p = GetLocOfNextNpcPtr(p)
ptr = ReadHex(hWnd,p)
iNpcs = iNpcs - 1
end
if i > 0 then
rNpc = GetNpcData(hWnd,data[i])
-- category 0 (closest range)
if cat == 0 then
PrintConsole(" Looking up nearest Npc ...")
while i > 0 do
i = i - 1
Npc = GetNpcData(hWnd,data[i])
if tn:GetDistance(Npc.x,Npc.y) < tn:GetDistance(rNpc.x,rNpc.y) then
rNpc = Npc
end
end
end
if cat == 1 then
-- other categories
end
ResetNpcBuffer(hWnd)
PrintConsoleLine(" found ID: "..IntToStr(rNpc.id))
return rNpc
else
ResetNpcBuffer(hWnd)
return nil
end
else
ResetNpcBuffer(hWnd)
return nil
end
ResetNpcBuffer(hWnd)
return nil
end
function XYtoFace(hWnd,x,y)
tn:refresh()
RealX = tn.x - x
RealY = tn.y - y
if RealX < 0 then
RealX = RealX * -1
end
if RealY < 0 then
RealY = RealY * -1
end
if x > tn.x and y > tn.y then
g = math.deg ( math.atan( RealY / RealX ) )
end
if x > tn.x and y < tn.y then
g = ( ( math.deg ( math.atan( RealY / RealX ) ) * - 1 ) + 90 ) + 270
end
if x < tn.x and y < tn.y then
g = math.deg ( math.atan( RealY / RealX ) ) + 180
end
if x < tn.x and y > tn.y then
g = ( ( math.deg ( math.atan( RealY / ( RealX ) ) ) * - 1 ) + 90 ) + 90
end
if g == nil then
return 0
end
return ( ( 2 * math.pi ) / 360 ) * g
end
function SpinPlayer(hWnd,Target)
tn:refresh()
-- ; 9.2.2005 - New improved spinning code by Outlaw
-- ; 13.2.2005 - Improved by n1ce
-- L
if tn.facing > Target then
L = ( ( 2 * math.pi ) - tn.facing ) + Target
else
L = Target - tn.facing
end
-- R
if tn.facing > Target then
R = tn.facing - Target
else
R = tn.facing + ( ( 2 * math.pi ) - Target )
end
if R < L then
if R > 2 then
PressKey("RIGHT",200)
else
PressKey("RIGHT",100)
end
else
if L > 2 then
PressKey("LEFT",200)
else
PressKey("LEFT",100)
end
end
end
function FaceXY(hWnd,x,y,acc)
spincheck = 0
while 1 do
Target = XYtoFace(hWnd,x,y)
-- PrintConsoleLine("facing: "..tn.facing.." Target: "..Target)
if ( tn.facing - acc/10) < Target and ( tn.facing + acc/10) > Target then
return 1
else
SpinPlayer(hWnd,Target)
end
if spincheck > 3 then
break
end
spincheck = spincheck + 1
end
end
function GetDistance(x1,y1,x2,y2)
-- returns distance of x1,y1 to x2,y2
return (math.sqrt((x1 - x2)^2 + (y1 - y2)^2))
end
function CorpseRun()
PrintConsoleLine("Your toon died! Attempting Corpserun.")
-- WriteNewLine(df, "["..(SinceTimeStamp(bottimer)/1000/60).."] Damnit! It looks like you died!")
tn:refresh()
tn:setCorpseLoc()
if tn.alive == 1 then
return 0
end
Sleep(2000)
while tn:GetDistance(tn:GetCorpseLoc()) < 5 do
PrintConsoleLine("Releasing Corpse.")
SendKeys(hWnd,"{ENTER}")
Sleep(100)
SendKeys(hWnd,"/script RepopMe();")
Sleep(100)
SendKeys(hWnd,"{ENTER}")
-- WriteNewLine(df, "["..(SinceTimeStamp(bottimer)/1000/60).."] Waiting for graveyard teleport...")
PrintConsoleLine("Waiting for graveyard teleport ...")
Sleep(2000)
tn:refresh()
end
-- wait 10 seconds for WoW loading new data from HDD etc.
Sleep(10000)
-- WriteNewLine(df, "["..(SinceTimeStamp(bottimer)/1000/60).."] Well, I made it to the graveyard after that nasty death...")
wp_cr_count = 0
while wp_cr_count < GetListItemCount(list_cr_y) do
walk_x = StrToFloat(GetListItemText(list_cr_x, wp_cr_count))
walk_y = StrToFloat(GetListItemText(list_cr_y,wp_cr_count))
PrintConsoleLine("Distance to corpse: "..tn:GetDistance(tn:GetCorpseLoc()))
PrintConsoleLine("["..(SinceTimeStamp(bottimer)/1000/60).."] Distance to corpse: "..tn:GetDistance(tn:GetCorpseLoc()))
if tn:GetDistance(tn:GetCorpseLoc()) < tn:GetDistance(walk_x,walk_y) then
break
end
PrintConsoleLine("Corpserun, next waypoint: "..IntToStr(wp_cr_count))
PrintConsoleLine("["..(SinceTimeStamp(bottimer)/1000/60).."] Still Corpse running. I am going to X: "..walk_x.." Y: "..walk_y)
MoveToXY(hWnd,walk_x,walk_y,15)
wp_cr_count = wp_cr_count + 1
end
PrintConsoleLine("Corpserun, next waypoint: your corpse.")
PrintConsoleLine("["..(SinceTimeStamp(bottimer)/1000/60).."] Next waypoint, your corpse! X: "..tn.corpsex.." Y: "..tn.corpsey)
MoveToXY(hWnd,tn.corpsex,tn.corpsey,9)
-- ; 3.25.05 - Check to see if were still dead. If so rez timer.
while tn.alive ~= 1 do
FocusWindow(hWnd)
Sleep(2000)
-- WriteNewLine(df, "["..(SinceTimeStamp(bottimer)/1000/60).."] Attempting to Rez in!")
SendKeys(hWnd,"{ENTER}")
Sleep(100)
SendKeys(hWnd,"/script RetrieveCorpse();")
Sleep(100)
SendKeys(hWnd,"{ENTER}")
Sleep(4000)
if tn.alive ~= 1 then
PrintConsoleLine(" Waiting on rez timer...")
Sleep(5000)
end
tn:refresh()
Sleep(5000)
SendKeys(hWnd,_KEY_SHADOWMELD)
end
rest(0.99)
return 0
end
function MoveToXY(hWnd,x,y,close)
-- ; Optimized movement code
-- ; improved by deeper 2005.02.20
if sitting == 1 then
sitting = 0
SendKeys(hWnd,"x")
end
PrintConsoleLine("MOVING TO LOCATION x: "..FloatToStr(x).." y: "..FloatToStr(y).." dist: "..IntToStr(GetDistance(x,y,tn.x,tn.y)))
t = GetTimeStamp()
FaceXY(hWnd,x,y,3)
s = GetTimeStamp()
tn:refresh()
oldx = tn.x
oldy = tn.y
oldhp = tn.hp
stuck = 0
HoldKey("UP")
while 1 do
Sleep(100)
tn:refresh()
if oldhp > tn.hp and tn:GetAttackerPtr() ~= nil then
PrintConsoleLine(" AMBUSH!")
return 0
end
oldhp = tn.hp
if tn:GetDistance(x,y) <= close then
PrintConsoleLine(" arrived at destinaton.")
ReleaseKey("UP")
return 1
else
if SinceTimeStamp(s) > Randomize(1354,2142) then
PrintConsoleLine(" distance to go: "..IntToStr(GetDistance(tn.x,tn.y,x,y)-close))
--evade code
if (GetDistance(tn.x,tn.y,oldx,oldy) < 3) then
ReleaseKey("UP")
PrintConsoleLine(" Toon stuck! Trying to evade.")
FaceXY(hWnd,x*-1,y*-1,3)
PressKey("UP",1000)
FaceXY(hWnd,x,y*-1,3)
HoldKey("UP")
end
FaceXY(hWnd,x,y,3)
s = GetTimeStamp()
oldx = tn.x
oldy = tn.y
end
end
if SinceTimeStamp(t) > 100000 then
PrintConsoleLine(" Can not reach location. Trying wacky maneuvers.")
ReleaseKey("UP")
HoldKey("DOWN")
Sleep(3000)
ReleaseKey("DOWN")
FaceXY(hWnd,x,y*-1,3)
HoldKey("UP")
Sleep(3000)
t = GetTimeStamp()
end
if stuck > 10 then
PrintConsoleLine(" OMG THAT WAS QUITE THE STICK")
return 0
end
end
end
function MoveToNpc(hWnd,ptr,unstoppable,close,debug)
-- ; Optimized movement code
-- ; improved by deeper 2005.02.20
if sitting == 1 then
sitting = 0
SendKeys(hWnd,"x")
end
Npc = GetNpcData(hWnd,ptr)
tn:refresh()
oldx = tn.x
oldy = tn.y
oldhp = tn.hp
DebugMessage("MOVE TO Npc id: "..IntToStr(Npc.id).." dist: "..IntToStr(GetDistance(tn.x,tn.y,Npc.x,Npc.y)),1,debug)
FaceXY(hWnd,Npc.x,Npc.y,3)
if GetDistance(tn.x,tn.y,Npc.x,Npc.y) < close then
return 1
end
t = GetTimeStamp()
s = GetTimeStamp()
HoldKey("UP")
while 1 do
Sleep(100)
Npc = GetNpcData(hWnd,ptr)
tn:refresh()
if oldhp > tn.hp and unstoppable == 0 then
PrintConsoleLine(" AMBUSH!")
return 0
end
oldhp = tn.hp
if GetDistance(tn.x,tn.y,Npc.x,Npc.y) < close then
DebugMessage(" arrived at Npc.",1,debug)
ReleaseKey("UP")
return 1
else
if SinceTimeStamp(s) > Randomize(854,1228) then
DebugMessage(" distance to go: "..IntToStr(GetDistance(tn.x,tn.y,Npc.x,Npc.y)-close),1,debug)
--evade code
if (GetDistance(tn.x,tn.y,oldx,oldy) < 3) then
ReleaseKey("UP")
DebugMessage(" Toon stuck! Trying to evade.",1,debug)
FaceXY(hWnd,Npc.x*-1,Npc.y*-1,3)
PressKey("UP",1000)
FaceXY(hWnd,Npc.x,Npc.y*-1,3)
HoldKey("UP")
end
if (Npc.hp < 100 and Npc.hp ~= 0) and unstoppable == 0 then
ReleaseKey("UP")
DebugMessage(" Npc is under attack, stopping!",1,debug)
return 0
end
if unstoppable == 1 then
ReleaseKey("UP")
end
Npc = GetNpcData(hWnd,ptr)
if (XYtoFace(hWnd,Npc.x,Npc.y) > 3) then
ReleaseKey("UP")
FaceXY(hWnd,Npc.x,Npc.y,3)
HoldKey("UP")
else
FaceXY(hWnd,Npc.x,Npc.y,3)
end
if unstoppable == 1 then
HoldKey("UP")
end
s = GetTimeStamp()
oldx = tn.x
oldy = tn.y
end
end
if SinceTimeStamp(t) > 25000 then
DebugMessage(" Can not reach Npc. Giving up.",1,debug)
Npc = GetNpcData(hWnd,ptr)
Blacklist[blacklist_count] = Npc.id
PrintConsoleLine(" blacklisting Npc id: "..Blacklist[blacklist_count])
blacklist_count = blacklist_count + 1
tn:refresh()
if tn.TargetID ~= 0 then
ClearTarget()
end
ReleaseKey("UP")
return 0
end
end
ReleaseKey("UP")
return 0
end
---------------------------------------------------------------------------------
-- ; The control window
---------------------------------------------------------------------------------
function window_open()
gui = OpenGui(_APPNAME,300,350)
Sleep(100)
-- ; Loot settings
AddFrame(gui,"Loot settings",0,0,300,60)
lb_loot = AddLabel(gui,"Size of the looting area:",7,15,290,15)
AddLabel(gui,"<< small",7,33,40,20)
sl_acu = AddSlider(gui,46,30,165,25,20,80)
AddLabel(gui,"big >>",210,33,50,20)
SetSliderStatus(sl_acu,60)
cb_skin = AddCheckBox(gui,"skin",245,33,49,15)
-- ; Area hunting settings
AddFrame(gui,"Area hunting settings",0,62,300,150)
lb_area = AddLabel(gui,"F6 add Corpserun WP. F7 add Hunting WP.",7,78,250,15)
list_cr_x = AddList(gui,7,94,143,50)
list_cr_y = AddList(gui,150,94,143,50)
list_x = AddList(gui,7,150,143,50)
list_y = AddList(gui,150,150,143,50)
lb_radius = AddLabel(gui,"Hunting radius :",7,223,80,15)
eb_radius = AddEditBox(gui,"64",84,220,30,20)
lb_level = AddLabel(gui,"Level range :",7,177+70,120,15)
eb_level_min = AddEditBox(gui,"1",84,174+70,30,20)
lb_leavel2 = AddLabel(gui," - ",125,177+70,20,15)
eb_level_max = AddEditBox(gui,"60",147,174+70,30,20)
-- ; Emergency settings
AddFrame(gui,"In case of an emergency settings",0,201+70,300,41)
lb_eg_key = AddLabel(gui,"Press key",7,219+70,60,15)
eb_eg_key = AddEditBox(gui,"9",60,217+70,15,20)
lb_eg_hp = AddLabel(gui,"if hp are under",81,219+70,80,15)
eb_eg_hp = AddEditBox(gui,"40",158,217+70,26,20)
lb_percent = AddLabel(gui,"percent.",190,219+70,80,15)
-- ; Buttons
save = AddButton(gui,"Save settings",2,246+70,75,25)
load = AddButton(gui,"Load settings",77,246+70,75,25)
lb_info = AddLabel(gui," Press F8 to start the bot.",152,251+70,150,15)
SetItemColor(lb_info,RGB(0,255,0),0)
ExitOnGuiClose(gui)
end
---------------------------------------------------------------------------------
-- ; WoW functions
---------------------------------------------------------------------------------
function ClearTarget()
SendKeys(hWnd,_KEY_CLEARTARGET)
end
---------------------------------------------------------------------------------
-- ; The loot function.
-- ; 16.2.2005 Improved by nice
---------------------------------------------------------------------------------
function loot(hWnd,id)
-- ; improved by deeper 2005.02.20
PrintConsoleLine("LOOTING!")
PrintConsoleLine(" Searching for corpse ID: "..IntToStr(id))
lx1,ly1,lx2,ly2 = GetWindowRect(hWnd)
slider = 100 - GetSliderStatus(sl_acu)
lx1 = lx1 + ( ( lx2 - lx1 ) /100 * slider )
ly1 = ly1 + ( ( ly2 - ly1 ) /100 * slider )
lx2 = lx2 - ( ( lx2 - lx1 ) /100 * slider )
ly2 = ly2 - ( ( ly2 - ly1 ) /100 * slider )
lootok = 0
Sleep(1500)
tn:refresh()
ohp = tn.hp
sy = ly1
while lx1 < lx2 do
while ly1 < ly2 do
ly1 = ly1 + 25
LeftClick(lx1,ly1,1)
tn:refresh()
if tn.hp < ohp then
PrintConsoleLine(" AMBUSH!")
return 0
end
ohp = tn.hp
if tn.TargetID == id then
HoldKey("SHIFT")
RightClick(lx1+5,ly1+5,1)
if WaitForTargetID(hWnd,id,300) == 0 then
ReleaseKey("SHIFT")
PrintConsoleLine(" Looting timeout, skipping.")
return 0
end
tn:refresh()
if tn.hp < ohp then
ReleaseKey("SHIFT")
PrintConsoleLine(" AMBUSH!")
return 0
end
ohp = tn.hp
PrintConsoleLine(" Npc corpse found ... looting.")
if WaitForTargetID(hWnd,0,300) == 0 then
ReleaseKey("SHIFT")
PrintConsoleLine(" Can't find corpse, skipping.")
return 0
end
tn:refresh()
if tn.hp < ohp then
ReleaseKey("SHIFT")
PrintConsoleLine(" AMBUSH!")
return 0
end
if GetCheckBoxState(cb_skin) == 1 then
PrintConsoleLine(" Npc corpse found ... skinning.")
Sleep(1000)
RightClick(lx1,ly1,1)
if WaitForTargetID(hWnd,0,300) == 0 then
ReleaseKey("SHIFT")
PrintConsoleLine(" Skinning timeout, skipping.")
ClearTarget()
return 0
end
end
PrintConsoleLine(" Npc corpse plundered.")
ReleaseKey("SHIFT")
PrintConsoleLine(" done.")
ClearTarget()
return 1
end
end
lx1 = lx1 + 25
ly1 = sy
end
tn:refresh()
if tn.TargetID ~= 0 then
ClearTarget()
end
PrintConsoleLine(" failed.")
return 0
end
---------------------------------------------------------------------------------
-- ; The resting is handled here.
-- ; Edit to fit your needs
---------------------------------------------------------------------------------
function rest(rate)
-- ; improved by deeper 2005.02.20
tn:refresh()
sitting = 0
oldhp = tn.hp
-- player died
if tn.alive == 0 then
PrintConsoleLine(" Player is dead!")
return 0
end
if tn.hp < minhp or healingbool > 0 then
healingbool = 0
PrintConsoleLine(" Resting to recover "..IntToStr(maxhp - tn.hp).." hit point(s).")
else
PrintConsoleLine("Don't need to rest.")
return 0
end
tn:refresh()
if tn.form == 1 then
SendKeys(hWnd,_KEY_CATFORM)
end
Sleep(1000)
if tn.hp < minhp then
SendKeys(hWnd,_KEY_HEALINGTOUCH)
Sleep(7000)
end
if buffcount == 10 then
SendKeys(hWnd,_KEY_MOW)
buffcount = 0
Sleep(2000)
else
buffcount = buffcount + 1
end
ClearTarget()
tn:refresh()
if tn.mana < minmana then
PrintConsoleLine(" Regening Mana...")
if shadowmeld == 1 then
SendKeys(hWnd,_KEY_SHADOWMELD)
end
while tn.mana < minmana do
oldhp = tn.hp
tn:refresh()
Sleep(2000)
if tn.alive == 0 then
break
end
if tn.hp < oldhp and tn:GetAttackerPtr() ~= nil then
SendKeys(hWnd,_KEY_CATFORM)
break
end
end
end
tn:refresh()
if tn.form == 0 then
SendKeys(hWnd,_KEY_CATFORM)
end
PrintConsoleLine("Resting done.")
return
end
---------------------------------------------------------------------------------
-- ; The actual fight happens here
-- ; Edit to fit your needs
---------------------------------------------------------------------------------
function fight(hWnd,ptr)
ReleaseKey("UP")
ReleaseKey("SHIFT")
PrintConsoleLine("FIGHT!")
tick = 0
count = 0
Npc = GetNpcData(hWnd,ptr)
tn:refresh()
oldhp = 0
oldNpchp = 0
oldNpcid = Npc.id
if tn.TargetID ~= 0 then
PrintConsoleLine(" clearing Target ...")
ClearTarget()
end
if WaitForTargetID(hWnd,0,100) == 0 then
return 0
end
PrintConsoleLine("Targeting NPC: "..IntToStr(Npc.id))
if tn.TargetID == 0 then
i = 0
while i < 3 and tn.TargetID == 0 do
PrintConsoleLine(" waiting for Target ...")
--SendKeys(hWnd, _KEY_ATTACK)
if i > 0 then
if GetDistance(tn.x,tn.y,Npc.x,Npc.y) < 30 then
MoveToNpc(hWnd,ptr,1,3,0)
else
PrintConsoleLine(" Npc no longer in range.")
return 0
end
end
FaceXY(hWnd,Npc.x,Npc.y,3)
if WaitForTargetIsNotNull(hWnd,100) == 1 then
break
end
tn:refresh()
Npc = GetNpcData(hWnd,ptr)
i = i + 1
end
if tn.TargetID == 0 then
Npc = GetNpcData(hWnd,ptr)
Blacklist[blacklist_count] = Npc.id
PrintConsoleLine(" blacklisting Npc id: "..Blacklist[blacklist_count])
blacklist_count = blacklist_count + 1
tn:refresh()
if tn.TargetID ~= 0 then
ClearTarget()
end
return 0
end
else
return 0
end
tn:refresh()
if (tn.TargetID) ~= Npc.id then
ptr = tn:GetAttackerPtr()
end
PrintConsoleLine(" fighting ...")
PrintConsoleLine(" Npc id: "..Npc.id..", level: "..Npc.level)
while 1 do
tn:refresh()
Npc = GetNpcData(hWnd,ptr)
if tn.alive == 0 then
PrintConsoleLine(" your toon died while fighting!")
break
end
if tn:GetDistance(Npc.x,Npc.y) < 2 then
PressKey("DOWN",300)
end
if tn:GetDistance(Npc.x,Npc.y) > 3 then
MoveToNpc(hWnd,ptr,1,3,0)
end
special = 0
if oldhp ~= tn.hp or oldNpchp ~= Npc.hp and oldNpcid == Npc.id then
PrintConsoleLine(" PLAYER HP%: "..IntToStr(tn.hp_percent).." Target HP%: "..IntToStr(Npc.hp).." ComboPoints: "..tn.combo)
end
if tn.energy >= 35 and tn.combo >= 5 then
SendKeys(hWnd,_KEY_BITE)
Sleep(200)
else
if tn.energy >= 40 then
SendKeys(hWnd,_KEY_CLAW)
Sleep(100)
end
end
if tn.hp <= dangerhp then
healingbool = 1
waitcount = 0
tn:refresh()
if tn.form == 1 then
SendKeys(hWnd,_KEY_CATFORM)
end
Sleep(1000)
while tn.mana < htcost do
tn:refresh()
if tn.alive == 0 then
break
end
Sleep(1000)
end
SendKeys(hWnd,_KEY_HEALINGTOUCH)
while tn.hp < dangerhp and tn.alive ~= 0 do
tn:refresh()
Sleep(1000)
waitcount = waitcount + 1
if waitcount > 12 then
waitcount = 0
break
end
end
tn:refresh()
if tn.form == 0 and tn.mana > catcost then
SendKeys(hWnd,_KEY_CATFORM)
else
while tn.mana < catcost do
tn:refresh()
if tn.alive == 0 then
break
end
Sleep(1000)
end
SendKeys(hWnd,_KEY_CATFORM)
end
Sleep(2000)
end
tn:refresh()
if Npc.hp == 0 or Npc.hp > 100 or tn.alive == 0 then
break
end
FaceXY(hWnd,Npc.x,Npc.y,3)
if Npc.hp == 100 then
if count > 10 and tn.hp == tn.maxhp then
PrintConsoleLine(" Can not damage this Target. I try to Get a new one!")
ClearTarget()
return 0
end
end
oldhp = tn.hp
oldNpchp = Npc.hp
count = count + 1
Sleep(Randomize(550,950))
end
if tn.alive == 0 then
return 0
end
PrintConsoleLine(" done.")
mobs_killed = mobs_killed + 1
SetWindowTitle(hWnd,_APPNAME.." | NpcS KILLED:["..IntToStr(mobs_killed).."]")
tn:refresh()
if tn.TargetID ~= 0 then
ClearTarget()
end
return oldNpcid
end
---------------------------------------------------------------------------------
-- ; MAIN LOOP
---------------------------------------------------------------------------------
if math.floor(GetVersion()*1000,3)/1000 >= _FS_VERSION then
OpenConsole()
SetConsoleTitle(_APPNAME.." Console")
Sleep(100)
Blacklist = {}
Blacklist[1] = "0"
blacklist_count = 1
earned_exp = 0
exp_last = 0
mobs_killed = 0
runbot = 0
PrintConsoleLine(_APPNAME.." STARTING UP! VERSION ".._VERSION.." / ".._DATE.." using ForceShock "..math.floor(GetVersion()*1000,3)/1000)
wow_ready = 0
while wow_ready == 0 do
PrintConsole("Waiting for World of Warcraft! [")
i = 1
while 1 do
PrintConsole(".")
hWnd = FindWindowByExe("WoW.exe")
if hWnd > 0 then
PrintConsoleLine("] ready")
wow_ready = 1
break
end
i = i + 1
if i > 10 then
PrintConsoleLine("] failed.")
PrintConsoleLine("Make sure World of Warcraft is running!")
break
end
Sleep(100)
end
if wow_ready == 0 then
Sleep(5000)
PrintConsoleLine("Retrying ...")
end
end
tn = toon.init(hWnd)
while tn == nil do
Sleep(5000)
PrintConsoleLine("Retrying ...")
tn = toon.init(hWnd)
end
PrintConsole("Installing hook ...")
hook = Sense_Hook(hWnd,"483FB3")
PrintConsoleLine(" ready")
PrintConsole("Opening control panel ...")
window_open()
PrintConsoleLine(" ready")
PrintConsoleLine(_APPNAME.." ".._VERSION.." ready.")
while 1 do -- start main loop
if IsButtonPressed(save) == 1 then
EraseRegistryDir("HKEY_CURRENT_USER","Software\\Blizzbot")
hWndX = FindWindowByTitle(_APPNAME.." Console")
x1,y1,x2,y2 = GetWindowRect(hWndX)
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","consoleX",x1)
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","consoleY",y1)
hWndX = FindWindowByTitle(_APPNAME)
x1,y1,x2,y2 = GetWindowRect(hWndX)
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","guiX",x1)
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","guiY",y1)
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","skin",GetCheckBoxState(cb_skin))
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","accuracy",GetSliderStatus(sl_acu))
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","radius",GetEditBoxText(eb_radius))
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","min_level",GetEditBoxText(eb_level_min))
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","max_level",GetEditBoxText(eb_level_max))
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","eg_key",GetEditBoxText(eb_eg_key))
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","eg_hp",GetEditBoxText(eb_eg_hp))
co = GetListItemCount(list_y) - 1
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wpcount",IntToStr(co))
while co ~= -1 do
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wpx"..IntToStr(co),GetListItemText(list_x, co))
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wpy"..IntToStr(co),GetListItemText(list_y, co))
co = co - 1
end
co = GetListItemCount(list_cr_y) - 1
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wp_cr_count",IntToStr(co))
while co ~= -1 do
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wp_cr_x"..IntToStr(co),GetListItemText(list_cr_x, co))
WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wp_cr_y"..IntToStr(co),GetListItemText(list_cr_y, co))
co = co - 1
end
PrintConsoleLine("Settings saved!")
end
if IsButtonPressed(load) == 1 then
ClearList(list_x)
ClearList(list_y)
ClearList(list_cr_x)
ClearList(list_cr_y)
hWndX = FindWindowByTitle(_APPNAME.." Console")
MoveWindow(hWndX,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","consoleX"),ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","consoleY"));
hWndX = FindWindowByTitle(_APPNAME)
MoveWindow(hWndX,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","guiX"),ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","guiY"));
SetCheckBoxState(cb_skin,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","skin"))
SetSliderStatus(sl_acu,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","accuracy"))
SetEditBoxText(eb_radius,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","radius"))
SetEditBoxText(eb_level_min,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","min_level"))
SetEditBoxText(eb_level_max,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","max_level"))
SetEditBoxText(eb_eg_key,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","eg_key"))
SetEditBoxText(eb_eg_hp,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","eg_hp"))
co = StrToInt(ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wpcount"))
a = 0
while a ~= co + 1 do
AddListItem(list_x,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wpx"..IntToStr(a)))
AddListItem(list_y,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wpy"..IntToStr(a)))
a = a + 1
end
co = StrToInt(ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wp_cr_count"))
a = 0
while a ~= co + 1 do
AddListItem(list_cr_x,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wp_cr_x"..IntToStr(a)))
AddListItem(list_cr_y,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","wp_cr_y"..IntToStr(a)))
a = a + 1
end
PrintConsoleLine("Settings loaded!")
end
if IsKeyPress("F6") == 1 and runbot == 0 then
tn:refresh()
AddListItem(list_cr_x,FloatToStr(tn.x))
AddListItem(list_cr_y,FloatToStr(tn.y))
PrintConsoleLine("Added coordinates X: "..FloatToStr(tn.x).." Y: "..FloatToStr(tn.y).." to the corpserun waypoint list.")
end
if IsKeyPress("F7") == 1 and runbot == 0 then
tn:refresh()
AddListItem(list_x,FloatToStr(tn.x))
AddListItem(list_y,FloatToStr(tn.y))
PrintConsoleLine("Added coordinates X: "..FloatToStr(tn.x).." Y: "..FloatToStr(tn.y).." to the hunting waypoint list.")
end
if IsKeyPress("F8") == 1 then
if GetListItemCount(list_y) > 0 then
DisableButton(load)
DisableButton(save)
runbot = 1
SetWindowTitle(hWnd,_APPNAME.." | NpcS KILLED:["..IntToStr(mobs_killed).."]")
PrintConsoleLine(_APPNAME.." has started his journey!")
else
PrintConsoleLine("Can't start, no way point(s) in list!")
end
end
if runbot == 1 then
tn:refresh()
FocusWindow(hWnd)
min_level = StrToInt(GetEditBoxText(eb_level_min))
max_level = StrToInt(GetEditBoxText(eb_level_max))
em_hp = StrToInt(GetEditBoxText(eb_eg_hp))
em_key = StrToInt(GetEditBoxText(eb_eg_key))
wp_count = 0
wp_max = GetListItemCount(list_y) - 1
rad = StrToInt(GetEditBoxText(eb_radius))
while wp_count ~= wp_max + 1 do
if tn.alive == 0 and GetListItemCount(list_cr_y) > 0 then
CorpseRun()
end
walk_x = StrToFloat(GetListItemText(list_x, wp_count))
walk_y = StrToFloat(GetListItemText(list_y,wp_count))
wp_count = wp_count + 1
id = 0
if MoveToXY(hWnd,walk_x,walk_y,10) ~= 0 then
Npc = GetNpc(hWnd,0,0,walk_x,walk_y,min_level,max_level,rad,0)
while Npc ~= nil do
id = 0
if MoveToNpc(hWnd,Npc.ptr,0,4,1) ~= 0 then
PrintConsoleLine("++ Npc in range, engaging ...")
id = fight(hWnd,Npc.ptr)
tn:refresh()
while tn:GetAttackerPtr() ~= nil do
PrintConsoleLine("++ fighting off ambushers!")
id = fight(hWnd,tn.ptrAttacker)
end
if tn.alive == 1 then
if id ~= 0 then
-- let the corpse fall
loot(hWnd,id)
else
PrintConsoleLine("++ fight cancelled.")
end
rest(1)
else
PrintConsoleLine("++ toon dead.")
break
end
else
-- under attack?
while tn:GetAttackerPtr() ~= nil do
PrintConsoleLine("++ fighting off ambushers!")
id = fight(hWnd,tn.ptrAttacker)
tn:refresh()
end
if tn.alive == 1 then
if id ~= 0 then
-- let the corpse fall
Sleep(500)
loot(hWnd,id)
else
PrintConsoleLine("++ fight cancelled.")
end
rest(1)
else
PrintConsoleLine("++ toon dead.")
break
end
end
Npc = GetNpc(hWnd,0,0,walk_x,walk_y,min_level,max_level,rad)
end -- while scan for mobs
else
-- under attack?
tn:refresh()
while tn:GetAttackerPtr() ~= nil do
PrintConsoleLine("++ fighting off ambushers!")
id = fight(hWnd,tn.ptrAttacker)
tn:refresh()
end
if tn.alive == 1 then
if id ~= 0 then
-- let the corpse fall
Sleep(500)
loot(hWnd,id)
else
PrintConsoleLine("++ fight cancelled.")
end
rest(1)
else
PrintConsoleLine("++ toon dead.")
break
end
end -- move to WP
end -- while walk waypoints
end -- end if runbot
Sleep(100)
end -- mail loop
Sleep(1)
else
MessageBox("Error","Your Forceshock version is\r\nto low for this script, you\r\nneed ".._FS_VERSION.." or higher!")
Exit()
end
---------------------------------------------------------------------------------
-- ; EOF
---------------------------------------------------------------------------------