Register for your free account! | Forgot your password?

You last visited: Today at 11:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



BlizzBot 0.9

Discussion on BlizzBot 0.9 within the WoW Exploits, Hacks, Tools & Macros forum part of the World of Warcraft category.

Reply
 
Old   #1
 
Lowfyr's Avatar
 
elite*gold: 235
The Black Market: 135/1/0
Join Date: Jul 2003
Posts: 16,562
Received Thanks: 17,758
thx@Dabladest for the update information

Version 0.8 was very buggy and not usable by a lot of people. 0.9 is greatly improved
This version should work for at least 90% of the people. The goal of 1.0 is 95+%.

Features:

Quote:
+ Find mobs directly in the memory (extremely improved).
+ Walking speed improved by 40%.
+ Spinning speed improved by 200%.
+ Looting is now up to 250% faster and should work all the time with accuracy of 50 or less.
+ Does not attack players any more.
+ Hunt mobs with a specific level or level range.
+ Way point system.
+ Blacklists npcs you can't attack after the first try.
+ Works with every melee class.
+ Walk to a npc, kill him and loot him.
+ Fight several npcs at once if your char can take the beating.
+ Calculates the offsets until the right ones are found.
+ Fixed all known bugs.


Notes:

+ Key 1 needs to be your attack key. Configure the fighting section and rest sections to fit your needs.

+ You need at least 1 way point in the list or F8 will not work.

+ Your mouse cursor is set to 0,0 at the beginning of each fight.


Usage:

1. Download a Firewall and an Antivirus scanner
1a. Scan your pc for trojans/viri, watch the firewall*

2. Download Forceshock here:

2a. Scan Forceshock exe with the Antivirus scanner*

3. Double click the Forceshock exe and restart your pc.
3a. Scan your pc for trojans/viri*
3b. Look at your firewall*
3c. This is needed so Forceshock can register *.fss files with itself.

4. Copy the code from this post into a *.fss file called Blizzbot0.9.fss

5. Start WoW in window mode.

6. Log a close combat class in.

7. Double click the Blizzbot0.9.fss file.

8. Walk to an open area.

9. Mark some waypoints using F7.

10. After the last waypoint press F8.

11. Scan your pc for trojans/viri, watch your firewall*

12. Post all bugs you find here.


* If you find any viri/trojan blame Forceshock for it even if you found them be for you installed it(lol).

Code:
---------------------------------------------------------------------------------- 
-- BlizzBot 0.9 - Blizzhackers open source community bot < close combat edition > 
---------------------------------------------------------------------------------- 
-- + World of Warcraft 1.2.1 4150 US             
-- + Forceshock Version 0.900+  
        
--&#59; CREDITS 
-----------------------------------------------------      
--&#59; Bot by n1ce 
--&#59; All hacks and math by Outlaw 
----------------------------------------------------- 

--&#59; Extra fame goes too 
-------------------------------------------------------------------------        
--&#59; catvir and brainiac2k for reversing WoW since the beginning :) 
------------------------------------------------------------------------- 

--------------------------------------------------------------------------------- 
--&#59; Calculations to defeat DMA 
--------------------------------------------------------------------------------- 
function calc_offsets(hWnd) 
  ptr_unit_struct = ReadDword(hWnd,"12E188") 
  ptr_hitpoints = HexAdd( IntToHex( ptr_unit_struct ),"C74") 
  ptr_mana = HexAdd( IntToHex( ptr_unit_struct ),"11F4") 
  ptr_maxmana = HexAdd( IntToHex( ptr_unit_struct ),"120C") 
  ptr_maxhp = HexAdd( IntToHex( ptr_unit_struct ),"1FAC") 
  ptr_hover_target_id = HexSub( IntToHex( ptr_unit_struct ),"11D8")  
  ptr_current_xp = HexAdd( IntToHex( ptr_unit_struct ),"16D0") 
  ptr_max_xp = HexAdd( IntToHex( ptr_unit_struct ),"16D4") 
  ptr_rage = HexAdd( ptr_mana,"4") 
  ptr_energy = HexAdd( ptr_rage,"8") 
  ptr_facing = HexAdd( IntToHex( ptr_unit_struct ),"93C") 
  ptr_internal_z = HexSub( ptr_facing,"4") 
  ptr_internal_y = HexSub( ptr_internal_z,"4") 
  ptr_internal_x = HexSub( ptr_internal_y,"4") 
end 

--------------------------------------------------------------------------------- 
--&#59; Player structure 
--------------------------------------------------------------------------------- 
function GetPlayerData(hWnd) 

  player = { 
   ptr = ptr_unit_struct, 
   hp = ReadDword(hWnd,ptr_hitpoints), 
   mana = ReadDword(hWnd,ptr_mana), 
   maxmana = ReadDword(hWnd,ptr_maxmana), 
   maxhp = ReadDword(hWnd,ptr_maxhp), 
   energy = ReadDword(hWnd,ptr_energy), 
   rage = ReadDword(hWnd,ptr_rage), 
   targetID = ReadDword(hWnd,"992AB8"), 
   hoverID = ReadDword(hWnd,ptr_hover_target_id), 
   playerID = ReadDword(hWnd,"989388"), 
   xp = ReadDword(hWnd,ptr_current_xp), 
   maxxp = ReadDword(hWnd,ptr_max_xp), 
   x = ReadFloat(hWnd, ptr_internal_x), 
   y = ReadFloat(hWnd,ptr_internal_y), 
   z = ReadFloat(hWnd,ptr_internal_z), 
   facing = ReadFloat(hWnd,ptr_facing) 
  } 
  return player 
end 

--------------------------------------------------------------------------------- 
--&#59; Helper functions 
--------------------------------------------------------------------------------- 
function SetTraceID(hWnd,npc_id) WriteDword(hWnd,"B21D34",npc_id)end 
function GetTraceID(hWnd) return ReadDword(hWnd,"B21D34") end 
function GetNpcPtr(hWnd) return ReadDword(hWnd,"B21D38") end 
function GetNpcID(hWnd) return ReadDword(hWnd,"B21D28") end 

--------------------------------------------------------------------------------- 
--&#59; Npc structure 
--------------------------------------------------------------------------------- 
function GetNpcData(hWnd,npc_id) 
 SetTraceID(hWnd,npc_id) 
 Sleep(1) 
  npc = { 
   ptr = ReadDword(hWnd,"B21D38"), 
   id = ReadDword(hWnd,"B21D28"), 
   hp = ReadDword(hWnd,"B21D24"), 
   level = ReadDword(hWnd,"B21D2C"), 
   faction = ReadDword(hWnd,"B21D30"), 
   x = ReadFloat(hWnd,"B21D14"), 
   y = ReadFloat(hWnd,"B21D18"), 
   z = ReadFloat(hWnd,"B21D1C"), 
   facing = ReadFloat(hWnd,"B21D20"), 
   range = 0 
  } 
  return npc 
end   

--------------------------------------------------------------------------------- 
--&#59; Hook 
--------------------------------------------------------------------------------- 

function Hook(hWnd) 
  [TSEARCH:hWnd,WriteOpCodes] 
   Poke 7D377F 90 90 90 90 90 90 90 90 51 50 81 
   Poke 7D378A C1 C0 04 00 00 8B 01 81 E9 C0 04 
   Poke 7D3795 00 00 39 05 88 93 98 00 74 78 83 
   Poke 7D37A0 3D 34 1D B2 00 01 74 10 39 05 34 
   Poke 7D37AB 1D B2 00 74 08 39 05 B8 2A 99 00 
   Poke 7D37B6 75 5F 89 0D 38 1D B2 00 83 C1 10 
   Poke 7D37C1 8B 01 A3 14 1D B2 00 83 C1 04 8B 
   Poke 7D37CC 01 A3 18 1D B2 00 83 C1 04 8B 01 
   Poke 7D37D7 A3 1C 1D B2 00 83 C1 04 8B 01 A3 
   Poke 7D37E2 20 1D B2 00 81 C1 38 03 00 00 8B 
   Poke 7D37ED 01 A3 24 1D B2 00 81 C1 6C 01 00 
   Poke 7D37F8 00 8B 01 A3 28 1D B2 00 81 C1 88 
   Poke 7D3803 00 00 00 8B 01 A3 2C 1D B2 00 83 
   Poke 7D380E C1 04 8B 01 A3 30 1D B2 00 58 59 
   Poke 7D3819 83 EC 40 8B 41 38 E9 F4 10 CB FF 
   Poke B21D14 00 00 00 00 00 00 00 00 00 00 00 
   Poke B21D1F 00 00 00 00 00 00 00 00 00 00 00 
   Poke B21D2A 00 00 00 00 00 00 00 00 00 00 00 
   Poke B21D35 00 00 00 00 00 00 00 
  [/TSEARCH] 
  WriteOpCodes(hWnd,"484913","E9,6F,EE,34,00,90") 
end 

function IsUnderAttack(hWnd) 
  player = GetPlayerData(hWnd) 
  if player.targetID > 0 then 
   if sitting == 1 then 
     sitting = 0 
     SendKeys(hWnd,"x") 
   end 
   PrintConsoleLine("Under attack, trying to fight the enemy off.") 
   id = fight(hWnd,player.targetID) 
   if id ~= 0 then loot(id) end 
   rest() 
   return 1 
  end 
  return 0 
end 

function sense_npc(hWnd,range,min_l,max_l) 
 save = {} 
 c = 0 
  PrintConsole("Searching for a suitable npc...") 
  Sleep(500) 
  t = GetTimeStamp() 
  while 1 do 
   SetTraceID(hWnd,1) 
   Sleep(1) 
    
   player = GetPlayerData(hWnd) 
   npc = GetNpcData(hWnd,GetNpcID(hWnd)) 
    
   n = blacklist_count 
   while n >= 1 do 
     if Blacklist[n] == npc.id then 
      n = -1 
     end 
     n = n - 1 
   end 
    
   if npc.level >= min_l and npc.level <= max_l and npc.id ~= nil and npc.id ~= 0 and npc.hp >= 1 and npc.hp <= 100 and n ~= -2 then 
     npc.range = math.sqrt( (player.x - npc.x)^2 + (player.y - npc.y)^2 + (player.z - npc.z)^2) 
     if npc.range <= range then 
      if c == 0 then 
        save = npc 
        c = 1 
      else 
        if npc.range < save.range then 
         save = npc 
        end 
      end 
     end 
   end 
   IsUnderAttack(hWnd) 
   if SinceTimeStamp(t) > 2000 then 
     return save 
   end 
  end 
  return nil 
end 


function FaceXY(hWnd,x,y) 
  while 1 do 
  
  player = GetPlayerData(hWnd) 
  
  RealX = player.x - x 
  RealY = player.y - y 
  if RealX < 0 then RealX = RealX * -1 end 
  if RealY < 0 then RealY = RealY * -1 end 
  
  if x > player.x and y > player.y then 
   g = math.deg ( math.atan( RealY / RealX ) ) 
  end 
  if x > player.x and y < player.y then 
   g = ( ( math.deg ( math.atan( RealY / RealX ) ) * - 1 ) + 90 ) + 270 
  end 
  if x < player.x and y < player.y then 
   g = math.deg ( math.atan( RealY / RealX ) ) + 180 
  end 
  if x < player.x and y > player.y then 
   g = ( ( math.deg ( math.atan( RealY / ( RealX ) ) ) * - 1 ) + 90 ) + 90 
  end 
  
  if g == nil then 
   return 0 
  end 
  
  target = 6.22 / 360 * g 
  
  if ( player.facing - 0.05 ) < target and ( player.facing + 0.05 ) > target then 
   return 1 
  else 
  
   L = target - player.facing 
   if L < 0 then L = L * -1 end 
   if target > player.facing then 
     R = target - player.facing 
   else 
     R = ( 6.22 - player.facing ) + target  
   end 
  
   if R > L then 
     PressKey("RIGHT",20) 
   else 
     PressKey("LEFT",20)  
   end 
    
  end 
  end 
end 

function Move(hWnd,x,y) 
  if sitting == 1 then 
   sitting = 0 
   SendKeys(hWnd,"x") 
  end 
  PrintConsoleLine("Moving too: X: "..FloatToStr(x).." Y: "..FloatToStr(y)) 
  t = GetTimeStamp() 
  while 1 do 
  
  FaceXY(hWnd,x,y) 
  player = GetPlayerData(hWnd) 
  
  if ( player.x - 10 ) < x and ( player.x + 10 ) > x then 
   if ( player.y - 5 ) < y and ( player.y + 5 ) > y then 
     return 1 
   else 
     PressKey("UP",500) 
   end 
  else 
   PressKey("UP",500) 
  end 
  if IsUnderAttack(hWnd) == 1 then return 0 end  
  if SinceTimeStamp(t) > 25000 then 
   PrintConsoleLine("Can not reach location.") 
   return 0 
  end 
  end 
end 

function MoveToNpc(hWnd,id,unstopable) 

  if sitting == 1 then 
   sitting = 0 
   SendKeys(hWnd,"x") 
  end 
  
  t = GetTimeStamp() 
  while 1 do 
  
  npc = GetNpcData(hWnd,id) 
  player = GetPlayerData(hWnd) 
  
  FaceNpc(hWnd,npc.id) 
 
  if ( player.x - 4 ) < npc.x and ( player.x + 4 ) > npc.x then 
   if ( player.y - 2 ) < npc.y and ( player.y + 2 ) > npc.y then 
     return 1 
   else 
     PressKey("UP",500) 
   end 
  else 
   PressKey("UP",500) 
  end 
  if unstoppable == 0 then 
   if IsUnderAttack(hWnd) == 1 then return 0 end 
  end  
  if SinceTimeStamp(t) > 1000 then 
   return 0 
  end 
  end 
  return 0 
end 

function FaceNpc(hWnd,id) 
  while 1 do 
  
  player = GetPlayerData(hWnd) 
  npc = GetNpcData(hWnd,id) 
  RealX = player.x - npc.x 
  RealY = player.y - npc.y 
  if RealX < 0 then RealX = RealX * -1 end 
  if RealY < 0 then RealY = RealY * -1 end 
  
  if npc.x > player.x and npc.y > player.y then 
   g = math.deg ( math.atan( RealY / RealX ) ) 
  end 
  if npc.x > player.x and npc.y < player.y then 
   g = ( ( math.deg ( math.atan( RealY / RealX ) ) * - 1 ) + 90 ) + 270 
  end 
  if npc.x < player.x and npc.y < player.y then 
   g = math.deg ( math.atan( RealY / RealX ) ) + 180 
  end 
  if npc.x < player.x and npc.y > player.y then 
   g = ( ( math.deg ( math.atan( RealY / ( RealX ) ) ) * - 1 ) + 90 ) + 90 
  end 
  
  if g == nil then 
   return 0 
  end 
  
  target = 6.22 / 360 * g 
  
  if ( player.facing - 0.05 ) < target and ( player.facing + 0.05 ) > target then 
   return 1 
  else 
  
   L = target - player.facing 
   if L < 0 then L = L * -1 end 
   if target > player.facing then 
     R = target - player.facing 
   else 
     R = ( 6.22 - player.facing ) + target  
   end 
  
   if R > L then 
     PressKey("RIGHT",20) 
   else 
     PressKey("LEFT",20)  
   end 
    
  end 
  end 
end 


--------------------------------------------------------------------------------- 
--&#59; The control window 
--------------------------------------------------------------------------------- 
function window_open() 
  gui = OpenGui("Blizzbot 0.9 < close combat edition >",300,280) 
  --&#59; Loot settings 
  AddFrame(gui,"Loot settings",0,0,300,60) 
  lb_loot = AddLabel(gui,"Enter the area where you wish to scan for loot",7,15,225,15) 
  AddLabel(gui,"1x,1y:",7,33,30,15) 
  eb_x1 = AddEditBox(gui,"200",37,32,30,20) 
  eb_y1 = AddEditBox(gui,"244",67,32,30,20) 
  
  AddLabel(gui,"2x,2y:",105,33,30,15) 
  eb_x2 = AddEditBox(gui,"650",137,32,30,20) 
  eb_y2 = AddEditBox(gui,"431",167,32,30,20) 
  
  AddLabel(gui,"accuracy: ",205,33,49,15) 
  eb_acu = AddEditBox(gui,"50",254,32,30,20) 
  
  --&#59; Area hunting settings 
  AddFrame(gui,"Area hunting settings",0,62,300,187) 
  lb_area = AddLabel(gui,"Press F7 to store your current location.",7,78,250,15) 
  list_x = AddList(gui,7,94,143,100) 
  list_y = AddList(gui,150,94,143,100) 
  lb_radius = AddLabel(gui,"Hunting radius :",7,204,80,15) 
  eb_radius = AddEditBox(gui,"32",84,201,30,20) 
  lb_radius = AddLabel(gui,"Search for mob (times) :",120,204,120,15) 
  eb_sense_times = AddEditBox(gui,"5",235,201,30,20) 
  
  lb_level = AddLabel(gui,"Level range :",7,228,120,15) 
  eb_level_min = AddEditBox(gui,"1",84,225,30,20) 
  lb_leavel2 = AddLabel(gui," - ",125,228,20,15) 
  eb_level_max = AddEditBox(gui,"60",147,225,30,20) 
  
  save = AddButton(gui,"Save settings",2,253,75,25) 
  load = AddButton(gui,"Load settings",77,253,75,25) 
  lb_info = AddLabel(gui,"   Press F8 to start the bot.",152,258,150,15) 
  SetItemColor(lb_info,RGB(0,255,0),0) 

  ExitOnGuiClose(gui) 
end 

--------------------------------------------------------------------------------- 
--&#59; WoW functions 
--------------------------------------------------------------------------------- 
function ClearTarget() 
  SendKeys(hWnd,"{ENTER}") 
  SendKeys(hWnd,"/script ClearTarget();") 
  SendKeys(hWnd,"{ENTER}") 
end 

--------------------------------------------------------------------------------- 
--&#59; The loot function. Brute force now :P 
--------------------------------------------------------------------------------- 
function loot() 
  lx1 = StrToInt(GetEditBoxText(eb_x1)) 
  ly1 = StrToInt(GetEditBoxText(eb_y1)) 
  lx2 = StrToInt(GetEditBoxText(eb_x2)) 
  ly2 = StrToInt(GetEditBoxText(eb_y2)) 
  player = GetPlayerData(hWnd) 
  ohp = player.hp 
  savey = ly1 
  HoldKey("SHIFT") 
  while lx1 < lx2 do 
   while ly1 < ly2 do 
     ly1 = ly1 + ( StrToInt(GetEditBoxText(eb_acu)) / 10 ) 
     SetCursorPos(lx1,ly1) 
     Sleep(1) 
     RightClick(lx1,ly1,1) 
     player = GetPlayerData(hWnd) 
     if player.hp < ohp then 
      ClearTarget() 
      Sleep(1000) 
      if IsUnderAttack(hWnd) == 1 then return 0 end 
     end 
   end 
   lx1 = lx1 + StrToInt(GetEditBoxText(eb_acu)) 
   ly1 = savey 
  end 
  player = GetPlayerData(hWnd) 
  if player.targetID ~= 0 then 
   ClearTarget() 
  end 
  ReleaseKey("SHIFT") 
return 0 
end 
--------------------------------------------------------------------------------- 
--&#59; The resting is handled here. 
--&#59; Edit to fit your needs 
--------------------------------------------------------------------------------- 
function rest() 
  player = GetPlayerData(hWnd) 
  sitting = 0 
  oldhp = player.hp 
  if player.hp ~= player.maxhp then PrintConsoleLine("Resting to recover "..IntToStr(player.maxhp - player.hp).." hits points.") end 
  while player.hp ~= player.maxhp do 
  player = GetPlayerData(hWnd) 
   if player.hp < oldhp then 
     SendKeys(hWnd,"x") 
     sitting = 0 
   end 
    
   if sitting == 0 then 
     SendKeys(hWnd,"x") 
     sitting = 1 
   end 
    
   if player.hp == player.maxhp then break end 
  if IsUnderAttack(hWnd) == 1 then return 0 end  
  Sleep(1) 
  end 
  
  if sitting == 1 then 
   sitting = 0 
   SendKeys(hWnd,"x") 
   PrintConsoleLine("Resting done.")  
  else 
   PrintConsoleLine("Don't need to rest.")       
  end 

return    
end 
--------------------------------------------------------------------------------- 
--&#59; The actual fight happens here 
--&#59; Edit to fit your needs 
--------------------------------------------------------------------------------- 
function fight(hWnd,id) 

  SetCursorPos(0,0) 
  MoveToNpc(hWnd,id,1) 
  FaceNpc(hWnd,id) 
  SendKeys(hWnd,"1") 
  Sleep(250) 
  
  player = GetPlayerData(hWnd) 

  if player.targetID == 0 then 
   Blacklist[blacklist_count] = npc.id 
   PrintConsoleLine("Blacklisted NPC: "..Blacklist[blacklist_count]) 
   blacklist_count = blacklist_count + 1 
   return 0 
  end 
  
  tick = 0 
  count = 0 
  player = GetPlayerData(hWnd) 
  npc = GetNpcData(hWnd,player.targetID)  
  
  oldhp = player.hp 
  oldnpchp = npc.hp 
  oldnpcid = player.targetID 
  
  PrintConsoleLine("--------INITIATING FIGHT--------") 
  while 1 do 
   player = GetPlayerData(hWnd) 
   if player.targetID == 0 then break end 
   npc = GetNpcData(hWnd,player.targetID) 

   if npc.hp == 0 or npc.hp > 100 then break end 
   Sleep(Randomize(120,570)) 
    
   MoveToNpc(hWnd,npc.id,1) 
   FaceNpc(hWnd,npc.id) 
    
   if player.rage >= 150 and SinceTimeStamp(tick) > 1500 then 
     SendKeys(hWnd,"2") 
     tick = GetTimeStamp() 
   end 
   if oldhp ~= player.hp or oldnpchp ~= npc.hp and oldnpcid == npc.id then 
     PrintConsoleLine("PLAYER HP: "..IntToStr(player.hp).." TARGET HP: "..IntToStr(npc.hp)) 
   end 
   if npc.hp == 100 then 
     if count > 100 and player.hp == player.maxhp then 
      PrintConsoleLine("Can not damage this target. I try to get a new one!") 
      ClearTarget() 
      return 0 
     end  
   end 
   oldhp = player.hp 
   oldnpchp = npc.hp 
   count = count + 1 
  end 
  
  
  PrintConsoleLine("-----------FIGHT OVER-----------") 
  
  mobs_killed = mobs_killed + 1 
  
  SetWindowTitle(hWnd,"Blizzbot 0.9 < close combat edition > | NPCS KILLED:["..IntToStr(mobs_killed).."]") 
  return oldnpcid 
end 

--------------------------------------------------------------------------------- 
--&#59; MAIN LOOP 
--------------------------------------------------------------------------------- 

if GetVersion() > 0.900 then 
  OpenConsole() 
  SetConsoleTitle("Blizzbot 0.9 < close combat edition >") 
  Blacklist = {} 
  Blacklist[1] = "0" 
  blacklist_count = 1 
  earned_exp = 0 
  exp_last = 0 
  mobs_killed = 0 
  runbot = 0 
  wait_for_wow = 1 
  PrintConsoleLine("-------------------------------------") 
  PrintConsole("Waiting for World of Warcraft....") 
  i = 1 
  while wait_for_wow == 1 do 
   hWnd = FindWindowByExe("WoW.exe") 
   if hWnd > 0 then 
     wait_for_wow = 0 
   end 
     i = i + 1 
     if i > 100 then MessageBox("Blizzbot 0.9 FATAL ERROR!","World of Warcraft not found!") Exit() end 
   Sleep(10) 
  end 
  PrintConsoleLine(" ok") 
  PrintConsole("Calculating WoW offsets..........") 
  i = 1 
  while 1 do 

   calc_offsets(hWnd) 
   player = GetPlayerData(hWnd) 
   if player.hp > 30 and player.hp < 10000 and player.facing > -1 and player.facing < 7 then 
     break 
   else 
     ClearConsole() 
     PrintConsoleLine("-------------------------------------") 
     PrintConsoleLine("Waiting for World of Warcraft.... ok") 
     PrintConsole("Calculating WoW offsets..... try["..IntToStr(i).."]") 
     i = i + 1 
     if i > 25 then MessageBox("Blizzbot 0.9 FATAL ERROR!","Make sure you execute Blizzbot after you logged your toon in!") Exit() end 
   end 
   Sleep(100) 
  end  
  PrintConsoleLine(" ok") 
  PrintConsole("Installing hook..................") 
  Hook(hWnd) 
  PrintConsoleLine(" ok") 
  PrintConsoleLine("Opening control panel ..") 
  window_open() 
  PrintConsoleLine("Waiting for user input ..") 
  PrintConsoleLine("-------------------------------------") 
  while 1 do 
  
   if IsButtonPressed(save) == 1 then 
     EraseRegistryDir("HKEY_CURRENT_USER","Software\\Blizzbot") 
     WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","1x",GetEditBoxText(eb_x1)) 
     WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","1y",GetEditBoxText(eb_y1)) 
     WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","2x",GetEditBoxText(eb_x2)) 
     WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","2y",GetEditBoxText(eb_y2)) 
     WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","accuracy",GetEditBoxText(eb_acu)) 
     
     WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","radius",GetEditBoxText(eb_radius)) 
     WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","search",GetEditBoxText(eb_sense_times)) 
     WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","min_level",GetEditBoxText(eb_level_min)) 
     WriteRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","max_level",GetEditBoxText(eb_level_max)) 
     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 
     PrintConsoleLine("Settings saved!") 
   end 
    
   if IsButtonPressed(load) == 1 then 
     ClearList(list_x) 
     ClearList(list_y) 
     
     SetEditBoxText(eb_x1,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","1x")) 
     SetEditBoxText(eb_y1,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","1y")) 
     SetEditBoxText(eb_x2,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","2x")) 
     SetEditBoxText(eb_y2,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","2y")) 
     SetEditBoxText(eb_acu,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","accuracy")) 
     
     SetEditBoxText(eb_radius,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","radius")) 
     SetEditBoxText(eb_sense_times,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","search")) 
     
     SetEditBoxText(eb_level_min,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","min_level")) 
     SetEditBoxText(eb_level_max,ReadRegistryKey("HKEY_CURRENT_USER","Software\\Blizzbot","max_level")) 
     
     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 
     PrintConsoleLine("Settings loaded!") 
   end 
    
   if IsKeyPressed("F7") == 1 and runbot == 0 then 
    player = GetPlayerData(hWnd) 
    AddListItem(list_x,FloatToStr(player.x)) 
    AddListItem(list_y,FloatToStr(player.y)) 
    PrintConsoleLine("Added coordinates X: "..FloatToStr(player.x).." Y: "..FloatToStr(player.y).." to the waypoint list.") 
   end 

   if IsKeyPressed("F8") == 1 then     
    if GetListItemCount(list_y) > 0 then  
     x1 = StrToFloat(GetEditBoxText(eb_ax1)) 
     y1 = StrToFloat(GetEditBoxText(eb_ay1)) 
             
     x2 = StrToFloat(GetEditBoxText(eb_ax2)) 
     y2 = StrToFloat(GetEditBoxText(eb_ay2)) 
           
     runbot = 1 
     SetWindowTitle(hWnd,"Blizzbot 0.9 < close combat edition > | NPCS KILLED:["..IntToStr(mobs_killed).."]") 
     PrintConsoleLine("BlizzBot < close combat edition > has started his journey!") 
     else 
      PrintConsoleLine("Can't start, no way point(s) in list!") 
     end 
    end 
  
   if runbot == 1 then 
     
     player = GetPlayerData(hWnd) 
     FocusWindow(hWnd) 
     
     min_level = StrToInt(GetEditBoxText(eb_level_min)) 
     max_level = StrToInt(GetEditBoxText(eb_level_max)) 
     
     wp_count = GetListItemCount(list_y) - 1 
     rad = StrToInt(GetEditBoxText(eb_radius)) 
     while wp_count ~= -1 do 
      walk_x = StrToFloat(GetListItemText(list_x, wp_count)) 
      walk_y = StrToFloat(GetListItemText(list_y  ,wp_count)) 
      wp_count = wp_count - 1 
       
      if Move(hWnd,walk_x,walk_y) ~= 0 then    
        times = StrToInt(GetEditBoxText(eb_sense_times)) 
        while times ~= 0 do 
         npc = sense_npc(hWnd,rad,min_level,max_level) 
         if npc.id ~= nil then 
           if npc.hp >= 1 and npc.hp <= 100 then 
            PrintConsoleLine(" found!") 
            PrintConsoleLine("Moving to NPC: "..IntToStr(npc.id).." X: "..FloatToStr(npc.x).." Y:"..FloatToStr(npc.y)) 
            i = 0 
            while i < 25 do 
              there = MoveToNpc(hWnd,npc.id,0) 
              i = i + 1 
            end 

            if there ~= 0 then 
               id = fight(hWnd,npc.id) 
               if id ~= 0 then loot(id) end 
               Move(hWnd,walk_x,walk_y) 
               rest() 
               times = StrToInt(GetEditBoxText(eb_sense_times)) 
            end 
             
           else 
            PrintConsoleLine("This is no npc! skipping!") 
           end 
         else 
            PrintConsoleLine(" no valid npc found!") 
         end 
        times = times - 1 
        end -- while sense 
      end --end if movecheck 
     end -- while walk  
   end -- end if runbot 
    
   Sleep(100) 
   end 
   Sleep(1) 
else 
  MessageBox("Error","Your Forceshock version is\r\n to low for this script") 
  Exit() 
end 
--------------------------------------------------------------------------------- 
--&#59; EOF 
---------------------------------------------------------------------------------
Lowfyr is offline  
Old 02/06/2005, 14:55   #2
 
elite*gold: 0
Join Date: Feb 2005
Posts: 607
Received Thanks: 7
realy nice ;D thx lwy
Trazer is offline  
Old 02/06/2005, 21:26   #3
 
Lowfyr's Avatar
 
elite*gold: 235
The Black Market: 135/1/0
Join Date: Jul 2003
Posts: 16,562
Received Thanks: 17,758
not bad :>
Lowfyr is offline  
Old 02/08/2005, 19:52   #4
 
elite*gold: 0
Join Date: Jan 2005
Posts: 39
Received Thanks: 0
I would stay away from this for now. The author admitted himself that .8 has major bugs and will be redoing everything from scractch. Also there are conflicting reports that forceshock the program you need to use along with this script has hidden viruses. Use with caution.
G00DFe77a is offline  
Old 02/09/2005, 16:10   #5
 
Lowfyr's Avatar
 
elite*gold: 235
The Black Market: 135/1/0
Join Date: Jul 2003
Posts: 16,562
Received Thanks: 17,758
#updated
Lowfyr is offline  
Old 02/09/2005, 16:48   #6
 
elite*gold: 0
Join Date: Nov 2004
Posts: 15
Received Thanks: 12
@itburnz
Ich glaube nicht, dass Outlaw sich die Mühe machen wird.
oder meinst Du jetzt rein hilfestellungsmässig ?
Dabladest is offline  
Old 02/11/2005, 22:24   #7
 
elite*gold: 0
Join Date: Jan 2005
Posts: 39
Received Thanks: 0
Two new versions of this bot for warlock and rogue made by tomit12

Warlock Version

Code:
----------------------------------------------------------------------------------
-- *BlizzBot 0.9c - Blizzhackers open source community bot < close combat edition >
----------------------------------------------------------------------------------
-- *+ World of Warcraft 1.2.1 4150 US * * * * * * * * * * * * 
-- *+ Forceshock Version 0.900+ * 
 * * * * * * * 
--; CREDITS
----------------------------------------------------- * * * * * 
--; Bot by n1ce
--; All hacks and math by Outlaw
-----------------------------------------------------

--; Extra fame goes too
------------------------------------------------------------------------- * * * * * * * 
--; catvir and brainiac2k for reversing WoW since the beginning :)
-------------------------------------------------------------------------

---------------------------------------------------------------------------------
--; Calculations to defeat DMA
---------------------------------------------------------------------------------
function calc_offsets(hWnd)
 * ptr_unit_struct = ReadDword(hWnd,"12E188")
 * ptr_hitpoints = HexAdd( IntToHex( ptr_unit_struct ),"C74")
 * ptr_mana = HexAdd( IntToHex( ptr_unit_struct ),"11F4")
 * ptr_maxmana = HexAdd( IntToHex( ptr_unit_struct ),"120C")
 * ptr_maxhp = HexAdd( IntToHex( ptr_unit_struct ),"1FAC")
 * ptr_hover_target_id = HexSub( IntToHex( ptr_unit_struct ),"11D8") * 
 * ptr_current_xp = HexAdd( IntToHex( ptr_unit_struct ),"16D0")
 * ptr_max_xp = HexAdd( IntToHex( ptr_unit_struct ),"16D4")
 * ptr_rage = HexAdd( ptr_mana,"4")
 * ptr_energy = *HexAdd( ptr_rage,"8")
 * ptr_facing = HexAdd( IntToHex( ptr_unit_struct ),"93C")
 * ptr_internal_z = HexSub( ptr_facing,"4")
 * ptr_internal_y = HexSub( ptr_internal_z,"4")
 * ptr_internal_x = HexSub( ptr_internal_y,"4")
end

---------------------------------------------------------------------------------
--; Player structure
---------------------------------------------------------------------------------
function GetPlayerData(hWnd)

 * player = {
 * * ptr = ptr_unit_struct,
 * * *hp = ReadDword(hWnd,ptr_hitpoints),
 * * *mana = ReadDword(hWnd,ptr_mana),
 * * *maxmana = ReadDword(hWnd,ptr_maxmana),
 * * *maxhp = ReadDword(hWnd,ptr_maxhp),
 * * *energy = ReadDword(hWnd,ptr_energy),
 * * *rage = ReadDword(hWnd,ptr_rage),
 * * *targetID = ReadDword(hWnd,"992AB8"),
 * * *hoverID = ReadDword(hWnd,ptr_hover_target_id),
 * * *playerID = ReadDword(hWnd,"989388"),
 * * *xp = ReadDword(hWnd,ptr_current_xp),
 * * *maxxp = ReadDword(hWnd,ptr_max_xp),
 * * *x = ReadFloat(hWnd, ptr_internal_x),
 * * *y = ReadFloat(hWnd,ptr_internal_y),
 * * *z = ReadFloat(hWnd,ptr_internal_z),
 * * *facing = ReadFloat(hWnd,ptr_facing)
 * }
 * return player
end

---------------------------------------------------------------------------------
--; Helper functions
---------------------------------------------------------------------------------
function SetTraceID(hWnd,npc_id) WriteDword(hWnd,"B21D34",npc_id)end
function GetTraceID(hWnd) return ReadDword(hWnd,"B21D34") end
function GetNpcPtr(hWnd) return ReadDword(hWnd,"B21D38") end
function GetNpcID(hWnd) return ReadDword(hWnd,"B21D28") end

---------------------------------------------------------------------------------
--; Npc structure
---------------------------------------------------------------------------------
function GetNpcData(hWnd,npc_id)
 *SetTraceID(hWnd,npc_id)
 *Sleep(1)
 * npc = {
 * * *ptr = ReadDword(hWnd,"B21D38"),
 * * *id = ReadDword(hWnd,"B21D28"),
 * * *hp = ReadDword(hWnd,"B21D24"),
 * * *level = ReadDword(hWnd,"B21D2C"),
 * * *faction = ReadDword(hWnd,"B21D30"),
 * * *x = ReadFloat(hWnd,"B21D14"),
 * * *y = ReadFloat(hWnd,"B21D18"),
 * * *z = ReadFloat(hWnd,"B21D1C"),
 * * *facing = ReadFloat(hWnd,"B21D20"),
 * * *range = 0
 * }
 * return npc
end

---------------------------------------------------------------------------------
--; Hook
---------------------------------------------------------------------------------

function Hook(hWnd)
 * [TSEARCH:hWnd,WriteOpCodes]
 * * *Poke 7D377F 90 90 90 90 90 90 90 90 51 50 81
 * * *Poke 7D378A C1 C0 04 00 00 8B 01 81 E9 C0 04
 * * *Poke 7D3795 00 00 39 05 88 93 98 00 74 78 83
 * * *Poke 7D37A0 3D 34 1D B2 00 01 74 10 39 05 34
 * * *Poke 7D37AB 1D B2 00 74 08 39 05 B8 2A 99 00
 * * *Poke 7D37B6 75 5F 89 0D 38 1D B2 00 83 C1 10
 * * *Poke 7D37C1 8B 01 A3 14 1D B2 00 83 C1 04 8B
 * * *Poke 7D37CC 01 A3 18 1D B2 00 83 C1 04 8B 01
 * * *Poke 7D37D7 A3 1C 1D B2 00 83 C1 04 8B 01 A3
 * * *Poke 7D37E2 20 1D B2 00 81 C1 38 03 00 00 8B
 * * *Poke 7D37ED 01 A3 24 1D B2 00 81 C1 6C 01 00
 * * *Poke 7D37F8 00 8B 01 A3 28 1D B2 00 81 C1 88
 * * *Poke 7D3803 00 00 00 8B 01 A3 2C 1D B2 00 83
 * * *Poke 7D380E C1 04 8B 01 A3 30 1D B2 00 58 59
 * * *Poke 7D3819 83 EC 40 8B 41 38 E9 F4 10 CB FF
 * * *Poke B21D14 00 00 00 00 00 00 00 00 00 00 00
 * * *Poke B21D1F 00 00 00 00 00 00 00 00 00 00 00
 * * *Poke B21D2A 00 00 00 00 00 00 00 00 00 00 00
 * * *Poke B21D35 00 00 00 00 00 00 00
 * [/TSEARCH]
 * WriteOpCodes(hWnd,"484913","E9,6F,EE,34,00,90")
end

function IsUnderAttack(hWnd)
 * player = GetPlayerData(hWnd)
 * if player.targetID > 0 then
 * * *if sitting == 1 then
 * * * * sitting = 0
 * * * * SendKeys(hWnd,"x")
 * * *end
 * * *PrintConsoleLine("Under attack, trying to fight the enemy off.")
 * * *id = fight2(hWnd,player.targetID)
 * * *--; if id ~= 0 then loot(id) end
 * * *rest()
 * * *return 1
 * end
 * return 0
end

function sense_npc(hWnd,range,min_l,max_l)
 *save = {}
 *c = 0
 * PrintConsole("Searching for a suitable npc...")
 * Sleep(500)
 * t = GetTimeStamp()
 * while 1 do
 * * *SetTraceID(hWnd,1)
 * * *Sleep(1)
 * * 
 * * *player = GetPlayerData(hWnd)
 * * *npc = GetNpcData(hWnd,GetNpcID(hWnd))
 * * 
 * * *n = blacklist_count
 * * *while n >= 1 do
 * * * * if Blacklist[n] == npc.id then
 * * * * * *n = -1
 * * * * end
 * * * * n = n - 1
 * * *end
 * * 
 * * *if npc.level >= min_l and npc.level <= max_l and npc.id ~= nil and npc.id ~= 0 and npc.hp >= 1 and npc.hp <= 100 and n ~= -2 then
 * * * * npc.range = math.sqrt( (player.x *- npc.x)^2 + (player.y - npc.y)^2 + (player.z - npc.z)^2)
 * * * * if npc.range <= range then
 * * * * * *if c == 0 then
 * * * * * * * save = npc
 * * * * * * * c = 1
 * * * * * *else
 * * * * * * * if npc.range < save.range then
 * * * * * * * * *save = npc
 * * * * * * * end
 * * * * * *end
 * * * * end
 * * *end
 * * *IsUnderAttack(hWnd)
 * * *if SinceTimeStamp(t) > 3000 then
 * * * * return save
 * * *end
 * end
 * return nil
end


function FaceXY(hWnd,x,y)
 * while 1 do
 * 
 * player = GetPlayerData(hWnd)
 * 
 * RealX = player.x - x
 * RealY = player.y - y
 * if RealX < 0 then RealX = RealX ** -1 end
 * if RealY < 0 then RealY = RealY ** -1 end
 * 
 * if x > player.x and y > player.y then
 * * *g = math.deg ( math.atan( RealY / RealX ) )
 * end
 * if x > player.x and y < player.y then
 * * *g = ( ( math.deg ( math.atan( RealY / *RealX *) ) * - 1 ) + 90 ) + 270
 * end
 * if x < player.x and y < player.y then
 * * *g = math.deg ( math.atan( RealY / RealX ) ) + 180
 * end
 * if x < player.x and y > player.y then
 * * *g = ( ( math.deg ( math.atan( RealY */ ( RealX ) ) ) * - 1 ) + 90 ) + 90
 * end
 * 
 * if g == nil then
 * * *return 0
 * end
 * 
 * target = 6.22 / 360 ** g
 * 
 * if ( player.facing - 0.05 ) < target and ( player.facing + 0.05 ) > target then
 * * *return 1
 * else
 * 
 * * *--; New improved spinning code by Outlaw
 * * *--; 9.2.2005
 * * 
 * * *-- L
 * * *if player.facing > target then
 * * * * L = ( 6.22 - player.facing ) + target * 
 * * *else
 * * * * L = target - player.facing
 * * *end
 * * 
 * * *-- R
 * * *if player.facing > target then
 * * * * R = target - player.facing
 * * *else
 * * * * R = ( 6.22 - player.facing ) + target * 
 * * *end
 * * *if R < 0 then R = R * -1 end
 * * *if L < 0 then L = L * -1 end
 * * 
 * * *if R < L then
 * * * * PressKey("RIGHT",20)
 * * *else
 * * * * PressKey("LEFT",20) * 
 * * *end
 * * 
 * end
 * end
end

function Move(hWnd,x,y)
 * --; Experimental code to make movment more human
 * if sitting == 1 then
 * * *sitting = 0
 * * *SendKeys(hWnd,"x")
 * end
 * 
 * PrintConsoleLine("Moving too: X: "..FloatToStr(x).." Y: "..FloatToStr(y))
 * t = GetTimeStamp()
 * FaceXY(hWnd,x,y)
 * 
 * while 1 do
 * s = GetTimeStamp()
 * player = GetPlayerData(hWnd)
 * 
 * range = math.sqrt( (player.x *- x)^2 + (player.y - y)^2)
 * 
 * if range < 5 then
 * * *return 1
 * else
 * * *if SinceTimeStamp(s) > Randomize(1982,2467) then
 * * * * FaceXY(hWnd,x,y)
 * * * * t = GetTimeStamp()
 * * *end

 * * 
 * * *PressKey("UP",500)
 * end
 * 
 * if IsUnderAttack(hWnd) == 1 then return 0 end * 
 * if SinceTimeStamp(t) > 25000 then
 * * *PrintConsoleLine("Can not reach location.")
 * * *return 0
 * end
 * end
end

function MoveToNpc(hWnd,id,unstopable,close)
 * --; Experimental code to make movment more human
 * if sitting == 1 then
 * * *sitting = 0
 * * *SendKeys(hWnd,"x")
 * end
 * s = GetTimeStamp()
 * t = GetTimeStamp()
 * while 1 do

 * * *npc = GetNpcData(hWnd,id)
 * * *player = GetPlayerData(hWnd)
 * * 
 * * npc.range = math.sqrt( (player.x *- npc.x)^2 + (player.y - npc.y)^2 + (player.z - npc.z)^2)
 * 
 * * if npc.range < close then
 * * * * return 1
 * * *else
 * * * * if SinceTimeStamp(s) > Randomize(896,1678) then
 * * * * * *FaceNpc(hWnd,npc.id)
 * * * * * *t = GetTimeStamp()
 * * * * end
 * * * * PressKey("UP",500)
 * * *end
 * * 
 * * *if unstoppable == 0 then
 * * * * if IsUnderAttack(hWnd) == 1 then return 0 end
 * * *end * 
 * * *if SinceTimeStamp(t) > 10000 then
 * * * * return 0
 * * *end
 * end
 * return 0
end

function FaceNpc(hWnd,id)
 * while 1 do
 * 
 * player = GetPlayerData(hWnd)
 * npc = GetNpcData(hWnd,id)
 * RealX = player.x - npc.x
 * RealY = player.y - npc.y
 * if RealX < 0 then RealX = RealX ** -1 end
 * if RealY < 0 then RealY = RealY ** -1 end
 * 
 * if npc.x > player.x and npc.y > player.y then
 * * *g = math.deg ( math.atan( RealY / RealX ) )
 * end
 * if npc.x > player.x and npc.y < player.y then
 * * *g = ( ( math.deg ( math.atan( RealY / *RealX *) ) * - 1 ) + 90 ) + 270
 * end
 * if npc.x < player.x and npc.y < player.y then
 * * *g = math.deg ( math.atan( RealY / RealX ) ) + 180
 * end
 * if npc.x < player.x and npc.y > player.y then
 * * *g = ( ( math.deg ( math.atan( RealY */ ( RealX ) ) ) * - 1 ) + 90 ) + 90
 * end
 * 
 * if g == nil then
 * * *return 0
 * end
 * 
 * target = 6.22 / 360 ** g
 * 
 * if ( player.facing - 0.05 ) < target and ( player.facing + 0.05 ) > target then
 * * *return 1
 * else
 * 
 * * *--; New improved spinning code by Outlaw
 * * *--; 9.2.2005
 * * 
 * * *-- L
 * * *if player.facing > target then
 * * * * L = ( 6.22 - player.facing ) + target * 
 * * *else
 * * * * L = target - player.facing
 * * *end
 * * 
 * * *-- R
 * * *if player.facing > target then
 * * * * R = target - player.facing
 * * *else
 * * * * R = ( 6.22 - player.facing ) + target * 
 * * *end
 * * *if R < 0 then R = R * -1 end
 * * *if L < 0 then L = L * -1 end
 * * 
 * * 
 * * *if R < L then
 * * * * PressKey("RIGHT",20)
 * * *else
 * * * * PressKey("LEFT",20) * 
 * * *end
 * * 
 * end
 * end
end


---------------------------------------------------------------------------------
--; The control window
---------------------------------------------------------------------------------
function window_open()
 * gui = OpenGui("Blizzbot 0.9c < close combat edition >",300,280)
 * --; Loot settings
 * AddFrame(gui,"Loot settings",0,0,300,60)
 * lb_loot = AddLabel(gui,"Enter the area where you wish to scan for loot",7,15,225,15)
 * AddLabel(gui,"1x,1y:",7,33,30,15)
 * eb_x1 = AddEditBox(gui,"200",37,32,30,20)
 * eb_y1 = AddEditBox(gui,"244",67,32,30,20)
 * 
 * AddLabel(gui,"2x,2y:",105,33,30,15)
 * eb_x2 = AddEditBox(gui,"650",137,32,30,20)
 * eb_y2 = AddEditBox(gui,"431",167,32,30,20)
 * 
 * AddLabel(gui,"accuracy: ",205,33,49,15)
 * eb_acu = AddEditBox(gui,"75",254,32,30,20)
 * 
 * --; Area hunting settings
 * AddFrame(gui,"Area hunting settings",0,62,300,187)
 * lb_area = AddLabel(gui,"Press F7 to store your current location.",7,78,250,15)
 * list_x = AddList(gui,7,94,143,100)
 * list_y = AddList(gui,150,94,143,100)
 * lb_radius = AddLabel(gui,"Hunting radius :",7,204,80,15)
 * eb_radius = AddEditBox(gui,"32",84,201,30,20)
 * lb_radius = AddLabel(gui,"Search for mob (times) :",120,204,120,15)
 * eb_sense_times = AddEditBox(gui,"5",235,201,30,20)
 * 
 * lb_level = AddLabel(gui,"Level range :",7,228,120,15)
 * eb_level_min = AddEditBox(gui,"1",84,225,30,20)
 * lb_leavel2 = AddLabel(gui," - ",125,228,20,15)
 * eb_level_max = AddEditBox(gui,"60",147,225,30,20)
 * 
 * save = AddButton(gui,"Save settings",2,253,75,25)
 * load = AddButton(gui,"Load settings",77,253,75,25)
 * lb_info = AddLabel(gui," * * *Press F8 to start the bot.",152,258,150,15)
 * SetItemColor(lb_info,RGB(0,255,0),0)

 * ExitOnGuiClose(gui)
end

---------------------------------------------------------------------------------
--; WoW functions
---------------------------------------------------------------------------------
function ClearTarget()
 * SendKeys(hWnd,"{ENTER}")
 * SendKeys(hWnd,"/script ClearTarget();")
 * SendKeys(hWnd,"{ENTER}")
end


---------------------------------------------------------------------------------
--; The resting is handled here.
--; Edit to fit your needs
---------------------------------------------------------------------------------
function rest()
 * player = GetPlayerData(hWnd)
 * sitting = 0
 * oldhp = player.hp
 * oldmana = player.mana
 * 
 * --; HP Resting
 * if player.hp ~= player.maxhp then
 * * *PrintConsoleLine("Resting to recover "..IntToStr(player.maxhp - player.hp).." hit points.")
 * else
 * * *PrintConsoleLine("Don't need to rest.") * * 
 * * *return 0
 * end
 * while player.hp ~= player.maxhp do
 * * *player = GetPlayerData(hWnd)
 * 
 * * *--; Enter some resting code here
 * * *--; Make sure you set sitting to 1 if you eat/drink something.
 * * 
 * * *--; Example (A is your eat/drink key):
 * * 
 * * *--; if sitting == 0 then
 * * *--; * *SendKeys(hWnd,"A")
 * * *--; * *sitting = 1
 * * *--; end
 * * 
 * * *if player.hp == player.maxhp then break end
 * * *if IsUnderAttack(hWnd) == 1 then return 0 end * 
 * 
 * * *Sleep(1)
 * end
 * 
 * --; Mana Resting
 * if player.mana ~= player.maxmana then
 * * *PrintConsoleLine("Resting to recover "..IntToStr(player.maxmana - player.mana).." mana.")
 * else
 * * *PrintConsoleLine("Don't need to rest.") * * 
 * * *return 0
 * end
 * while player.mana ~= player.maxmana do
 * * *player = GetPlayerData(hWnd)
 * 
 * * *--; Enter some resting code here
 * * *--; Make sure you set sitting to 1 if you eat/drink something.
 * * 
 * * *--; Example (A is your eat/drink key):
 * * 
 * * *--; if sitting == 0 then
 * * *--; * *SendKeys(hWnd,"A")
 * * *--; * *sitting = 1
 * * *--; end
 * * 
 * * *if player.mana == player.maxmana then break end
 * * *if IsUnderAttack(hWnd) == 1 then return 0 end * 
 * 
 * * *Sleep(1)
 * end
 * 
 * if sitting == 1 then
 * * *sitting = 0
 * * *SendKeys(hWnd,"x")
 * end
 * 
 * PrintConsoleLine("Resting done.") * 
return * * * 
end
---------------------------------------------------------------------------------
--; This is if you have adds or get attacked while resting.
--; Edit to fit your needs
---------------------------------------------------------------------------------
function fight2(hWnd,id)

 * MoveToNpc(hWnd,id,1,5)
 * FaceNpc(hWnd,id)
 * SendKeys(hWnd,"1")
 * Sleep(250)
 * 
 * player = GetPlayerData(hWnd)
 * 
 * if player.targetID == 0 then
 * * *Blacklist[blacklist_count] = npc.id
 * * *PrintConsoleLine("Blacklisted NPC: "..Blacklist[blacklist_count])
 * * *blacklist_count = blacklist_count + 1
 * * *return 0
 * end
 * 
 * tick = 0
 * count = 0
 * player = GetPlayerData(hWnd)
 * npc = GetNpcData(hWnd,player.targetID) * 
 * 
 * oldhp = player.hp
 * oldmana = player.mana
 * oldnpchp = npc.hp
 * oldnpcid = player.targetID
 * 
 * PrintConsoleLine("--------INITIATING FIGHT--------")
 * while 1 do
 * * *player = GetPlayerData(hWnd)
 * * *if player.targetID == 0 then break end
 * * *npc = GetNpcData(hWnd,player.targetID)

 * * *if npc.hp == 0 or npc.hp > 100 then break end
 * * *Sleep(Randomize(120,570))
 * * 
 * * *MoveToNpc(hWnd,npc.id,1,5)
 * * *FaceNpc(hWnd,npc.id)
 * * 
-------------------------------------------------------------------------------------
--; Potion code. This will use an HP potion when low on life.
--; Change the SendKeys number to match your hotkey.
-------------------------------------------------------------------------------------
 * * *percent = 50
 * * *if player.hp < ( player.hp / 4 ) * percent then
 * * * * SendKeys(hWnd,"6")
 * * *end * * * 
------------------------------------------------------------------------------------- * * 

-------------------------------------------------------------------------------------
--; This casts Shadowbolt. I have it set up to chain cast it on adds.
-------------------------------------------------------------------------------------
 * * *if npc.hp <= 100 and SinceTimeStamp(tick) > 1500 then
 * * * * SendKeys(hWnd,"2")
 * * * * tick = GetTimeStamp()
 * * *end
 * * 
 * * *if oldhp ~= player.hp or oldnpchp ~= npc.hp and oldnpcid == npc.id then
 * * * * PrintConsoleLine("PLAYER HP: "..IntToStr(player.hp).." TARGET HP: "..IntToStr(npc.hp))
 * * *end
 * * *if npc.hp == 100 then
 * * * * if count > 100 and player.hp == player.maxhp then
 * * * * * *PrintConsoleLine("Can not damage this target. I try to get a new one!")
 * * * * * *ClearTarget()
 * * * * * *return 0
 * * * * end * 
 * * *end
 * * *oldhp = player.hp
 * * *oldmana = player.mana
 * * *oldnpchp = npc.hp
 * * *count = count + 1
 * end
 * 
 * 
 * PrintConsoleLine("-----------FIGHT OVER-----------")
 * 
 * mobs_killed = mobs_killed + 1
 * 
 * SetWindowTitle(hWnd,"Blizzbot 0.9c < close combat edition > | NPCS KILLED:["..IntToStr(mobs_killed).."]")
 * return oldnpcid
end
---------------------------------------------------------------------------------
--; This is the normal fight code.
--; Edit to fit your needs.
---------------------------------------------------------------------------------
function fight(hWnd,id)

 * MoveToNpc(hWnd,id,1,5)
 * FaceNpc(hWnd,id)
 * SendKeys(hWnd,"1")
 * Sleep(250)
 * 
 * player = GetPlayerData(hWnd)
 * 
 * if player.targetID == 0 then
 * * *Blacklist[blacklist_count] = npc.id
 * * *PrintConsoleLine("Blacklisted NPC: "..Blacklist[blacklist_count])
 * * *blacklist_count = blacklist_count + 1
 * * *return 0
 * end
 * 
 * tick = 0
 * count = 0
 * player = GetPlayerData(hWnd)
 * npc = GetNpcData(hWnd,player.targetID) * 
 * 
 * oldhp = player.hp
 * oldmana = player.mana
 * oldnpchp = npc.hp
 * oldnpcid = player.targetID
 * 
 * PrintConsoleLine("--------INITIATING FIGHT--------")
 * while 1 do
 * * *player = GetPlayerData(hWnd)
 * * *if player.targetID == 0 then break end
 * * *npc = GetNpcData(hWnd,player.targetID)

 * * *if npc.hp == 0 or npc.hp > 100 then break end
 * * *Sleep(Randomize(120,570))
 * * 
 * * *MoveToNpc(hWnd,npc.id,1,5)
 * * *FaceNpc(hWnd,npc.id)
 * * 
-------------------------------------------------------------------------------------
--; Potion code. This will use an HP potion when low on life.
--; Change the SendKeys number to match your hotkey.
-------------------------------------------------------------------------------------
 * * *percent = 50
 * * *if player.hp < ( player.hp / 4 ) * percent then
 * * * * SendKeys(hWnd,"6")
 * * *end * * * 
------------------------------------------------------------------------------------- * * 

-------------------------------------------------------------------------------------
--; The next several blocks are for casting various spells. For me, I have it set up
--; to cast Corruption at full mana, Immolate right after it, then slap the mob with
--; a Shadowbolt at about 50% mob hp. Follow the instructions for each, and change
--; the SendKeys line for each to match your hotkey number.
-------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------
--; This is for casting Corruption at full mana. Adjust the number after player.mana
--; to whatever your FULL mana number is.
-------------------------------------------------------------------------------------
 * * *if player.mana >= 512 and SinceTimeStamp(tick) > 1500 then
 * * * * SendKeys(hWnd,"3")
 * * * * tick = GetTimeStamp()
 * * *end
-------------------------------------------------------------------------------------
--; This block is for casting Immolate after Corruption. Adjust the number after
--; "player.mana ==" to the exact amount of mana you have after casting Corruption.
-------------------------------------------------------------------------------------
 * * *if player.mana == 477 and SinceTimeStamp(tick) > 1500 then
 * * * * SendKeys(hWnd,"4")
 * * * * tick = GetTimeStamp()
 * * *end
-------------------------------------------------------------------------------------
--; Casts a Curse. I have mine set for Curse of Agony, but any will work. Change the
--; player.mana number to the exact amount of mana you have after casting Immolate.
-------------------------------------------------------------------------------------
 * * *if player.mana == 432 and SinceTimeStamp(tick) > 1500 then
 * * * * SendKeys(hWnd,"5")
 * * * * tick = GetTimeStamp()
 * * *end
-------------------------------------------------------------------------------------
--; This casts Shadowbolt. I have it set up to cast it once at about 50% mob hp
--; unless the mobs HP is great than 30%, then it will cast until it is below 30%.
-------------------------------------------------------------------------------------
 * * *if (npc.hp >= 30 and npc.hp <= 50) and SinceTimeStamp(tick) > 1500 then
 * * * * SendKeys(hWnd,"2")
 * * * * tick = GetTimeStamp()
 * * *end
 * * 
 * * *if oldhp ~= player.hp or oldnpchp ~= npc.hp and oldnpcid == npc.id then
 * * * * PrintConsoleLine("PLAYER HP: "..IntToStr(player.hp).." TARGET HP: "..IntToStr(npc.hp))
 * * *end
 * * *if npc.hp == 100 then
 * * * * if count > 100 and player.hp == player.maxhp then
 * * * * * *PrintConsoleLine("Can not damage this target. I try to get a new one!")
 * * * * * *ClearTarget()
 * * * * * *return 0
 * * * * end * 
 * * *end
 * * *oldhp = player.hp
 * * *oldmana = player.mana
 * * *oldnpchp = npc.hp
 * * *count = count + 1
 * end
 * 
 * 
 * PrintConsoleLine("-----------FIGHT OVER-----------")
 * 
 * mobs_killed = mobs_killed + 1
 * 
 * SetWindowTitle(hWnd,"Blizzbot 0.9c < close combat edition > | NPCS KILLED:["..IntToStr(mobs_killed).."]")
 * return oldnpcid
end

---------------------------------------------------------------------------------
--; MAIN LOOP
---------------------------------------------------------------------------------

if GetVersion() > 0.900 then
 * OpenConsole()
 * SetConsoleTitle("Blizzbot 0.9c < close combat edition >")
 * Blacklist = {}
 * Blacklist[1] = "0"
 * blacklist_count = 1
 * earned_exp = 0
 * exp_last = 0
 * mobs_killed = 0
 * runbot = 0
 * wait_for_wow = 1
 * PrintConsoleLine("-------------------------------------")
 * PrintConsole("Waiting for World of Warcraft....")
 * i = 1
 * while wait_for_wow == 1 do
 * * *hWnd = FindWindowByExe("WoW.exe")
 * * *if hWnd > 0 then
 * * * * wait_for_wow = 0
 * * *end
 * * * * i = i + 1
 * * * * if i > 100 then MessageBox("Blizzbot 0.9c FATAL ERROR!","World of Warcraft not found!") Exit() end
 * * *Sleep(10)
 * end
 * PrintConsoleLine(" ok")
 * PrintConsole("Calculating WoW offsets..........")
 * i = 1
 * while 1 do

 * * *calc_offsets(hWnd)
 * * *player = GetPlayerData(hWnd)
 * * *if player.hp > 30 and player.hp < 10000 and player.facing > -1 and player.facing < 7 then
 * * * * break
 * * *else
 * * * * ClearConsole()
 * * * * PrintConsoleLine("-------------------------------------")
 * * * * PrintConsoleLine("Waiting for World of Warcraft.... ok")
 * * * * PrintConsole("Calculating WoW offsets..... try["..IntToStr(i).."]")
 * * * * 
 * * * * i = i + 1
 * * * * if i > 25 then MessageBox("Blizzbot 0.9c FATAL ERROR!","Make sure you execute Blizzbot after you logged your toon in!") Exit() end
 * * *end
 * * *Sleep(100)
 * end * 
 * PrintConsoleLine(" ok")
 * PrintConsole("Installing hook..................")
 * Hook(hWnd)
 * PrintConsoleLine(" ok")
 * PrintConsoleLine("Opening control panel ..")
 * window_open()
 * PrintConsoleLine("Waiting for user input ..")
 * PrintConsoleLine("-------------------------------------")
 * while 1 do
 * 
 * * *if IsButtonPressed(save) == 1 then
 * * * * EraseRegistryDir("HKEY_CURRENT_USER","Software\Blizzbot")
 * * * * WriteRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","1x",GetEditBoxText(eb_x1))
 * * * * WriteRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","1y",GetEditBoxText(eb_y1))
 * * * * WriteRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","2x",GetEditBoxText(eb_x2))
 * * * * WriteRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","2y",GetEditBoxText(eb_y2))
 * * * * WriteRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","accuracy",GetEditBoxText(eb_acu))
 * * * * 
 * * * * WriteRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","radius",GetEditBoxText(eb_radius))
 * * * * WriteRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","search",GetEditBoxText(eb_sense_times))
 * * * * WriteRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","min_level",GetEditBoxText(eb_level_min))
 * * * * WriteRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","max_level",GetEditBoxText(eb_level_max))
 * * * * 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
 * * * * PrintConsoleLine("Settings saved!")
 * * *end
 * * 
 * * *if IsButtonPressed(load) == 1 then
 * * * * ClearList(list_x)
 * * * * ClearList(list_y)
 * * * * 
 * * * * SetEditBoxText(eb_x1,ReadRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","1x"))
 * * * * SetEditBoxText(eb_y1,ReadRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","1y"))
 * * * * SetEditBoxText(eb_x2,ReadRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","2x"))
 * * * * SetEditBoxText(eb_y2,ReadRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","2y"))
 * * * * SetEditBoxText(eb_acu,ReadRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","accuracy"))
 * * * * 
 * * * * SetEditBoxText(eb_radius,ReadRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","radius"))
 * * * * SetEditBoxText(eb_sense_times,ReadRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","search"))
 * * * * 
 * * * * SetEditBoxText(eb_level_min,ReadRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","min_level"))
 * * * * SetEditBoxText(eb_level_max,ReadRegistryKey("HKEY_CURRENT_USER","Software\Blizzbot","max_level"))
 * * * * 
 * * * * 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
 * * * * PrintConsoleLine("Settings loaded!")
 * * *end
 * * 
 * * if IsKeyPressed("F7") == 1 and runbot == 0 then
 * * * *player = GetPlayerData(hWnd)
 * * * *AddListItem(list_x,FloatToStr(player.x))
 * * * *AddListItem(list_y,FloatToStr(player.y))
 * * * *PrintConsoleLine("Added coordinates X: "..FloatToStr(player.x).." Y: "..FloatToStr(player.y).." to the waypoint list.")
 * * end

 * * if IsKeyPressed("F8") == 1 then * * * * 
 * * * *if GetListItemCount(list_y) > 0 then * 
 * * * * x1 = StrToFloat(GetEditBoxText(eb_ax1))
 * * * * y1 = StrToFloat(GetEditBoxText(eb_ay1))
 * * * * * * * * * * * 
 * * * * x2 = StrToFloat(GetEditBoxText(eb_ax2))
 * * * * y2 = StrToFloat(GetEditBoxText(eb_ay2))
 * * * * * * * * * * 
 * * * * runbot = 1
 * * * * SetWindowTitle(hWnd,"Blizzbot 0.9c < close combat edition > | NPCS KILLED:["..IntToStr(mobs_killed).."]")
 * * * * PrintConsoleLine("BlizzBot < close combat edition > *has started his journey!")
 * * * * else
 * * * * * *PrintConsoleLine("Can't start, no way point(s) in list!")
 * * * * end
 * * * end
 * 
 * * *if runbot == 1 then
 * * * * 
 * * * * player = GetPlayerData(hWnd)
 * * * * FocusWindow(hWnd)
 * * * * 
 * * * * min_level = StrToInt(GetEditBoxText(eb_level_min))
 * * * * max_level = StrToInt(GetEditBoxText(eb_level_max))
 * * * * 
 * * * * wp_count = GetListItemCount(list_y) - 1
 * * * * rad = StrToInt(GetEditBoxText(eb_radius))
 * * * * while wp_count ~= -1 do
 * * * * * *walk_x = StrToFloat(GetListItemText(list_x, wp_count))
 * * * * * *walk_y = StrToFloat(GetListItemText(list_y * ,wp_count))
 * * * * * *wp_count = wp_count - 1
 * * * * * 
 * * * * * *if Move(hWnd,walk_x,walk_y) ~= 0 then * * 
 * * * * * * * times = StrToInt(GetEditBoxText(eb_sense_times))
 * * * * * * * while times ~= 0 do
 * * * * * * * * *npc = sense_npc(hWnd,rad,min_level,max_level)
 * * * * * * * * *player = GetPlayerData(hWnd)
 * * * * * * * * *if npc.id ~= nil then
 * * * * * * * * * * if npc.hp >= 1 and npc.hp <= 100 then
 * * * * * * * * * * * *if npc.level >= min_level and npc.level <= max_level then
 * * * * * * * * * * * * * PrintConsoleLine(" found!")
 * * * * * * * * * * * * * PrintConsoleLine("Moving to NPC: "..IntToStr(npc.id).." Level: "..IntToStr(npc.level).." Range: "..FloatToStr(npc.range).." X: "..FloatToStr(npc.x).." Y:"..FloatToStr(npc.y))
 * * * * * * * * * * * * * i = 0
 * * * * * * * * * * * * * while i < 3 do
 * * * * * * * * * * * * * * *there = MoveToNpc(hWnd,npc.id,0,5)
 * * * * * * * * * * * * * * *i = i + 1
 * * * * * * * * * * * * * end
 * * * * * * * * * * * * * if npc.hp >= 1 and npc.hp <= 100 then
 * * * * * * * * * * * * * * *if npc.id ~= nil and npc.id < 297000000 then
 * * * * * * * * * * * * * * * * if there ~= 0 then
 * * * * * * * * * * * * * * * * * * * PrintConsoleLine("Npc in range, engaging..")
 * * * * * * * * * * * * * * * * * * * id = fight(hWnd,npc.id)
 * * * * * * * * * --; if id ~= 0 then loot(id) end
 * * * * * * * * * * * * * * * * * * * Move(hWnd,walk_x,walk_y)
 * * * * * * * * * * * * * * * * * * * rest()
 * * * * * * * * * * * * * * * * * * * times = StrToInt(GetEditBoxText(eb_sense_times))
 * * * * * * * * * * * * * * * * else
 * * * * * * * * * * * * * * * * * *PrintConsoleLine("Npc no longer found in memory, skipping.")
 * * * * * * * * * * * * * * * * end
 * * * * * * * * * * * * * * *else
 * * * * * * * * * * * * * * * * PrintConsoleLine("Npc no longer found in memory, skipping.")
 * * * * * * * * * * * * * * *end
 * * * * * * * * * * * * * else
 * * * * * * * * * * * * * * *PrintConsoleLine("Npc no longer found in memory, skipping.")
 * * * * * * * * * * * * * end
 * * * * * * * * * * * *else
 * * * * * * * * * * * * * PrintConsoleLine(" no valid npc found!")
 * * * * * * * * * * * *end
 * * * * * * * * * * else
 * * * * * * * * * * * *PrintConsoleLine(" no valid npc found!")
 * * * * * * * * * * end
 * * * * * * * * *else
 * * * * * * * * * * PrintConsoleLine(" no valid npc found!")
 * * * * * * * * *end
 * * * * * * * times = times - 1
 * * * * * * * end -- while sense
 * * * * * *end --end if movecheck
 * * * * end -- while walk * 
 * * *end -- end if runbot
 * * 
 * * *Sleep(100)
 * * *end
 * * *Sleep(1)
else
 * MessageBox("Error","Your Forceshock version is\r\n to low for this script")
 * Exit()
end
---------------------------------------------------------------------------------
--; EOF
---------------------------------------------------------------------------------
Basically, I have it set up with the idea that you have a Voidwalker (other pets might work, but you will be in melee range so unless they get enough aggro they may not work). It runs to the mob and smacks it with your weapon. It then casts Corruption, then Immolate, then casts a Curse and starts to melee.

Your pet should be set on defensive so he attacks right when the mob attacks you. That's why the Voidwalker is handy, good taunt

If you get an add (your pet will turn on this instantly), it will start chain casting ShadowBolt to take out the add. Usually, the Shadowbolt casts slow enough that the VW can keep aggro pretty well.

Read through the code for instructions, especially the area for fighting. You WILL have to change mana numbers, and probably hotkeys too. You'll also have to edit those numbers for each level. It also screws up if some friendly mage comes and int buffs you and throws a monkey wrench in the shit.

The reasons I did it like this are these:

A) I'm a noob and don't know any ways to do it better. I applied logic, common sense and a little input from Nice to edit his bot to make it work with my Warlock. I have no other programming / scripting experience (yet).

B) Because I'm a noob, I didn't know how to make it do certain things only a certain number of times per battle. Without specifying a mana amount, it will just chain cast things like Corruption over and over again. Not only is this unnecessary, but also unwanted and a complete waste of mana. This is the only way I could figure out to get it to not only cast a variety of spells, but not waste mana while doing it.

I've tried to comment the stuff I changed as much as I can. If you have more than 2 brain cells to rub together you can probably edit the original (or my version) enough to make it suit your Warlock (or other class).

I'm well aware the changes I've made could be cleaned up A LOT. I simply did what I could to make it work for me. I didn't want to be spoon fed all the answers because I would like to actually learn something. I only posted this in case someone might be interested in using it, or can clean it up...help each other learn so to speak

About the pet - Typically, by the time you're done regening HP and Mana, your pet is also full as well. However in the future, at least for the Voidwalker, I had planned to edit this to use the Voidwalkers Gather Shadows ability.

Rogue Version

Code:
----------------------------------------------------------------------------------
-- *BlizzBot 0.9c - Blizzhackers open source community bot < close combat edition >
----------------------------------------------------------------------------------
-- *+ World of Warcraft 1.2.1 4150 US * * * * * * * * * * * * 
-- *+ Forceshock Version 0.900+ * 
 * * * * * * * 
--; CREDITS
----------------------------------------------------- * * * * * 
--; Bot by n1ce
--; All hacks and math by Outlaw
-----------------------------------------------------

--; Extra fame goes too
------------------------------------------------------------------------- * * * * * * * 
--; catvir and brainiac2k for reversing WoW since the beginning :)
-------------------------------------------------------------------------

---------------------------------------------------------------------------------
--; Calculations to defeat DMA
---------------------------------------------------------------------------------
function calc_offsets(hWnd)
 * ptr_unit_struct = ReadDword(hWnd,"12E188")
 * ptr_hitpoints = HexAdd( IntToHex( ptr_unit_struct ),"C74")
 * ptr_mana = HexAdd( IntToHex( ptr_unit_struct ),"11F4")
 * ptr_maxmana = HexAdd( IntToHex( ptr_unit_struct ),"120C")
 * ptr_maxhp = HexAdd( IntToHex( ptr_unit_struct ),"1FAC")
 * ptr_hover_target_id = HexSub( IntToHex( ptr_unit_struct ),"11D8") * 
 * ptr_current_xp = HexAdd( IntToHex( ptr_unit_struct ),"16D0")
 * ptr_max_xp = HexAdd( IntToHex( ptr_unit_struct ),"16D4")
 * ptr_rage = HexAdd( ptr_mana,"4")
 * ptr_energy = *HexAdd( ptr_rage,"8")
 * ptr_facing = HexAdd( IntToHex( ptr_unit_struct ),"93C")
 * ptr_internal_z = HexSub( ptr_facing,"4")
 * ptr_internal_y = HexSub( ptr_internal_z,"4")
 * ptr_internal_x = HexSub( ptr_internal_y,"4")
end

---------------------------------------------------------------------------------
--; Player structure
---------------------------------------------------------------------------------
function GetPlayerData(hWnd)

 * player = {
 * * ptr = ptr_unit_struct,
 * * *hp = ReadDword(hWnd,ptr_hitpoints),
 * * *mana = ReadDword(hWnd,ptr_mana),
 * * *maxmana = ReadDword(hWnd,ptr_maxmana),
 * * *maxhp = ReadDword(hWnd,ptr_maxhp),
 * * *energy = ReadDword(hWnd,ptr_energy),
 * * *rage = ReadDword(hWnd,ptr_rage),
 * * *targetID = ReadDword(hWnd,"992AB8"),
 * * *hoverID = ReadDword(hWnd,ptr_hover_target_id),
 * * *playerID = ReadDword(hWnd,"989388"),
 * * *xp = ReadDword(hWnd,ptr_current_xp),
 * * *maxxp = ReadDword(hWnd,ptr_max_xp),
 * * *x = ReadFloat(hWnd, ptr_internal_x),
 * * *y = ReadFloat(hWnd,ptr_internal_y),
 * * *z = ReadFloat(hWnd,ptr_internal_z),
 * * *facing = ReadFloat(hWnd,ptr_facing)
 * }
 * return player
end

---------------------------------------------------------------------------------
--; Helper functions
---------------------------------------------------------------------------------
function SetTraceID(hWnd,npc_id) WriteDword(hWnd,"B21D34",npc_id)end
function GetTraceID(hWnd) return ReadDword(hWnd,"B21D34") end
function GetNpcPtr(hWnd) return ReadDword(hWnd,"B21D38") end
function GetNpcID(hWnd) return ReadDword(hWnd,"B21D28") end

---------------------------------------------------------------------------------
--; Npc structure
---------------------------------------------------------------------------------
function GetNpcData(hWnd,npc_id)
 *SetTraceID(hWnd,npc_id)
 *Sleep(1)
 * npc = {
 * * *ptr = ReadDword(hWnd,"B21D38"),
 * * *id = ReadDword(hWnd,"B21D28"),
 * * *hp = ReadDword(hWnd,"B21D24"),
 * * *level = ReadDword(hWnd,"B21D2C"),
 * * *faction = ReadDword(hWnd,"B21D30"),
 * * *x = ReadFloat(hWnd,"B21D14"),
 * * *y = ReadFloat(hWnd,"B21D18"),
 * * *z = ReadFloat(hWnd,"B21D1C"),
 * * *facing = ReadFloat(hWnd,"B21D20"),
 * * *range = 0
 * }
 * return npc
end * 

---------------------------------------------------------------------------------
--; Hook
---------------------------------------------------------------------------------

function Hook(hWnd)
 * [TSEARCH:hWnd,WriteOpCodes]
 * * *Poke 7D377F 90 90 90 90 90 90 90 90 51 50 81
 * * *Poke 7D378A C1 C0 04 00 00 8B 01 81 E9 C0 04
 * * *Poke 7D3795 00 00 39 05 88 93 98 00 74 78 83
 * * *Poke 7D37A0 3D 34 1D B2 00 01 74 10 39 05 34
 * * *Poke 7D37AB 1D B2 00 74 08 39 05 B8 2A 99 00
 * * *Poke 7D37B6 75 5F 89 0D 38 1D B2 00 83 C1 10
 * * *Poke 7D37C1 8B 01 A3 14 1D B2 00 83 C1 04 8B
 * * *Poke 7D37CC 01 A3 18 1D B2 00 83 C1 04 8B 01
 * * *Poke 7D37D7 A3 1C 1D B2 00 83 C1 04 8B 01 A3
 * * *Poke 7D37E2 20 1D B2 00 81 C1 38 03 00 00 8B
 * * *Poke 7D37ED 01 A3 24 1D B2 00 81 C1 6C 01 00
 * * *Poke 7D37F8 00 8B 01 A3 28 1D B2 00 81 C1 88
 * * *Poke 7D3803 00 00 00 8B 01 A3 2C 1D B2 00 83
 * * *Poke 7D380E C1 04 8B 01 A3 30 1D B2 00 58 59
 * * *Poke 7D3819 83 EC 40 8B 41 38 E9 F4 10 CB FF
 * * *Poke B21D14 00 00 00 00 00 00 00 00 00 00 00
 * * *Poke B21D1F 00 00 00 00 00 00 00 00 00 00 00
 * * *Poke B21D2A 00 00 00 00 00 00 00 00 00 00 00
 * * *Poke B21D35 00 00 00 00 00 00 00
 * [/TSEARCH]
 * WriteOpCodes(hWnd,"484913","E9,6F,EE,34,00,90")
end

function IsUnderAttack(hWnd)
 * player = GetPlayerData(hWnd)
 * if player.targetID > 0 then
 * * *if sitting == 1 then
 * * * * sitting = 0
 * * * * SendKeys(hWnd,"x")
 * * *end
 * * *PrintConsoleLine("Under attack, trying to fight the enemy off.")
 * * *id = fight(hWnd,player.targetID)
 * * *--; if id ~= 0 then loot(id) end
 * * *rest()
 * * *return 1
 * end
 * return 0
end

function sense_npc(hWnd,range,min_l,max_l)
 *save = {}
 *c = 0
 * PrintConsole("Searching for a suitable npc...")
 * Sleep(500)
 * t = GetTimeStamp()
 * while 1 do
 * * *SetTraceID(hWnd,1)
 * * *Sleep(1)
 * * 
 * * *player = GetPlayerData(hWnd)
 * * *npc = GetNpcData(hWnd,GetNpcID(hWnd))
 * * 
 * * *n = blacklist_count
 * * *while n >= 1 do
 * * * * if Blacklist[n] == npc.id then
 * * * * * *n = -1
 * * * * end
 * * * * n = n - 1
 * * *end
 * * 
 * * *if npc.level >= min_l and npc.level <= max_l and npc.id ~= nil and npc.id ~= 0 and npc.hp >= 1 and npc.hp <= 100 and n ~= -2 then
 * * * * npc.range = math.sqrt( (player.x *- npc.x)^2 + (player.y - npc.y)^2 + (player.z - npc.z)^2)
 * * * * if npc.range <= range then
 * * * * * *if c == 0 then
 * * * * * * * save = npc
 * * * * * * * c = 1
 * * * * * *else
 * * * * * * * if npc.range < save.range then
* * * * *
G00DFe77a is offline  
Old 02/13/2005, 19:58   #8
 
elite*gold: 0
Join Date: Feb 2005
Posts: 4
Received Thanks: 0
ok if i get it right this bot finds monsters to kill that fit to ur lvl ?
or do u have to put in a place for the bot to kill them ***** *** monsters

and the codes u posted is that a preset for the bot ? plz tell me
sonoko is offline  
Old 02/14/2005, 10:10   #9
 
Lowfyr's Avatar
 
elite*gold: 235
The Black Market: 135/1/0
Join Date: Jul 2003
Posts: 16,562
Received Thanks: 17,758
naja ob er damit kohle machen wird? ich mein das tool is ja gerade so für powergamer ausgelegt, wenns wirklich was taugt isses eh demnächst gecracked

habs nun noch nicht getestet
Lowfyr is offline  
Old 02/14/2005, 11:57   #10
 
elite*gold: 0
Join Date: Feb 2005
Posts: 4
Received Thanks: 0
can i please get an awnser ?
sonoko is offline  
Old 02/14/2005, 12:07   #11
 
Lowfyr's Avatar
 
elite*gold: 235
The Black Market: 135/1/0
Join Date: Jul 2003
Posts: 16,562
Received Thanks: 17,758
Quote:
Originally posted by sonoko@Feb 13 2005, 19:58
or do u have to put in a place for the bot to kill them ***** *** monsters
yes, it's not like l2walker
Lowfyr is offline  
Old 02/14/2005, 13:07   #12
 
elite*gold: 0
Join Date: Feb 2005
Posts: 4
Received Thanks: 0
oh ok thnx ^^
sonoko is offline  
Old 02/14/2005, 22:43   #13
 
elite*gold: 0
Join Date: Feb 2005
Posts: 2
Received Thanks: 0
What do i have to edit in the code to get my mage to cast over and over again ? Right now he will just cast 1 time then just stand there.
skinnyzaz is offline  
Old 02/15/2005, 10:09   #14
 
elite*gold: 0
Join Date: Nov 2004
Posts: 140
Received Thanks: 0
geht bei mir ned so richtig, der char läuft zwar zum festgelegter position aber sobald er eine creatur sieht, attackiert er nur 1mal und läuft weiter.....

P.s. wie kann ich machen, dass mein char zur position x,y läuft ?? ...ohne /goto funktion in cosmos... ?
gundala is offline  
Old 02/15/2005, 19:37   #15
 
Lowfyr's Avatar
 
elite*gold: 235
The Black Market: 135/1/0
Join Date: Jul 2003
Posts: 16,562
Received Thanks: 17,758
versuchs mal mit der neuen version, ist pinned

check out the new version (pinned topics)
Lowfyr is offline  
Reply


Similar Threads Similar Threads
recoded blizzbot 1.5 for rogues /v1.5 -update!
07/10/2006 - World of Warcraft - 48 Replies
ich hoffe damit wären die nervtötenden bugs behoben, hf jungs ;) recoded blizzbot for rouges /v1.5 - by langweiler - better performance - fast binds with macros ( no &"%§&%"§ key typing ) - starting bot when you are dead - automaticly walking if you are in the near of ANY corpse wp - changed registry entries / less detectable - never changes window titles / less detectable
Shaman code for blizzbot
03/19/2005 - World of Warcraft - 0 Replies
Can someone show me how to put in a little simple coding to get my shaman to work with blizzbot 1.0rc4? I just want to tell it to use windfury every 5 minutes, use lightning shield every 2 minutes maybe (if possible whenever it runs out), and cast self heal when <50% hp Thanks
How to recast with blizzbot
02/25/2005 - World of Warcraft - 0 Replies
Does anyone know how you could program the blizzbot to keep attacking over and over. I use a mage and I can put a spell in slot 1 but it will only cast the spell once. So if there was a way to loop the attacking on slot 1 i could just recast over and over, Does anyone know what I would have to change to do that ?



All times are GMT +2. The time now is 11:21.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.