Blizzhackers

Home of the Dupe since 2001

* Login   * Register    * FAQ    * Search

Join us on IRC: #bh@irc.synirc.net (or Mibbit Web IRC)


MuleFactory


It is currently Wed Jul 30, 2014 10:03 am


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1024 posts ]  Go to page 1, 2, 3, 4, 5 ... 69  Next
Author Message
 Post subject: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 5:04 pm 
 
User
User

Joined: Thu Jun 07, 2012 5:03 pm
Dank cellar Gold Farming Bot
22/06/2012

Donation only version:

- option menu
- garbage lvl 60 item
- double sellers
- tome of secret fixed
- gems fixex
- restart game if proble or on timer
- global timer to shutdown the bot after x min
- custom bind for spell
- mod selection : allitem - onyblue commoditis - onlygold



coming soon :
improved door detection
log file
save profile
change bot config while running
Other classes
17/06 add space press to prevent game creation bug and limit.
Implemented :
- Repair
- Collect blue , gems
- Unfill inv
- 2 Merchents Random
- Random 10 min rest ( 1/25 chance)
- Random Click, Move
- Random Sleep
- No more possible lock ( i think :p)
- No rare, ( rare act 1 = crap)

the bot will not sell the items in these slot :
Image

Required

- you need radius of course to make this work well. i'm running with 2 +8 items. 238 gf

- 800x600 (code for document/diablo3/diablo3pref.ini replace these line) :
DisplayModeFlags "0"
DisplayModeWindowMode "1"
DisplayModeWinLeft "208"
DisplayModeWinTop "135"
DisplayModeWinWidth "808"
DisplayModeWinHeight "627"
DisplayModeUIOptWidth "800"
DisplayModeUIOptHeight "600"
DisplayModeWidth "800"
DisplayModeHeight "600"
DisplayModeRefreshRate "75"
DisplayModeBitDepth "32"
Gamma "1.000000"
MipOffset "1"
ShadowQuality "0"
PhysicsQuality "0"
ClutterQuality "0"
Vsync "0"
Letterbox "0"
Antialiasing "0"
LowFX "1"

- I put every graphic config low
- Bind MOVE (not move/interact) to MIDDLE mouse button (sorry, I forgot to mention that)
- A well stuff follower ( i use enchantress with max cc dont take the bump !! )
- this spells and runes :
Image

- Teleport on Z key
- SHIELD ON A
- ARMOR ON E
- TELEPORT TO TOWN ON T

After you get the checkpoint, leave the game and run bot. ( checkpoint from legacy of cain : explore the cellar quest.)


Code with a lot of random stuff :
Opt('MouseCoordMode', 0)
Opt('PixelCoordMode', 0)
Opt('SendKeyDelay', 50); Default speed
HotKeySet('{END}', 'Quit')
HotKeySet('{F10}', 'Pause')
Global $Paused
Global $DebugOn = True

$Amethyst = 0xA56DF1
$Ruby = 0xFA8078
$Emerald = 0x51965B
$Topaz = 0xFFFF59
$Left = 64
$Top = 42
$Right = 720
$Bottom = 519
$Color = 0xFFFF00 ;rare color code
$Color2 = 0x6969FF ;blue color code
$Color3 = 0xBF642F ;legendary color code
$Color4 = 0x00FF00 ;SET color

;bot starts paused. press f10 to start.
Pause()

WinActivate('Diablo III')
While 1
   If WinActive('Diablo III') Then
      ;start
     Send("{Space}") ; get rid of any pesky banner
      Send("{Space}") ; get rid of any pesky banner
     checkResume()
      Sleep(Random(500,900))
      Click(134, 255) ;resume
     checkInGame()
      Sleep(Random(500,2000)) ;load
     openSpell()
     $repair = PixelSearch(569,39,597,84,0xFFF000) ;searches top right screen for yellow of broken armor
      If((Not @error ) Or (CheckInv() == 1)) Then
         InvRepair()
      Else
       Send('e')
       Sleep(40)
       Teleport()
       Sleep(40)
       Send('a')
       Sleep(40)
       $yellow = PixelSearch(643, 109, 698, 163, 0xF5CD37, 10)
       If Not @error Then
         Move(66,435)
         Move(134, 249)
         Sleep(Random(1000,1200))
         $blue = PixelSearch(430, 132, 602, 267, 0x5D80DB, 10)
         If Not @error Then
            DEBUG("Cave FOUNDED")
            MouseClick("left", $blue[0], $blue[1])
            Sleep(2000)
         EndIf
         Sleep(500)
         Move(126, 494)
         openSpell()
         Move(219, 282) ;in pos
         Click(349, 595) ;choose hydra
         Click(220, 174) ;cast hydra
         MouseClickDrag ( "right", Random(85,89), Random(169,173) , Random(258,262), Random(104,108), Random(9,12))
         MouseClickDrag ( "right", Random(85,89), Random(169,173) , Random(258,262), Random(104,108), Random(9,12))
         Shoot(161, 128)
         Sleep(500)
         Move(223, 113)
         Sleep(500)
         Move(291, 565)
         Sleep(500)
         Move(305, 227)
         Sleep(500)
         FindItem()
         $death = PixelSearch(285, 491, 308, 508, 0x2C0100,2)
         If @error Then
            $repair = PixelSearch(569,39,597,84,0xFFF000) ;searches top right screen for yellow of broken armor
            If((Not @error ) Or (CheckInv() == 1)) Then
              InvRepair()
            Else
              Sleep(500)
              Send("t")
              Sleep(Random(8000,8500))
              Send("{ESCAPE}") ;opens menu
              Sleep(Random(1000,1200))
              Click(407, 345) ;leave
              Sleep(Random(2000,2200))
            EndIf
         Else
            DEBUG("DEAD")
            Sleep(Random(500,600))
            Send("{ESCAPE}") ;opens menu
            Sleep(Random(1000,1200))
            Click(407, 345) ;leave
            Sleep(Random(12000,13000))
         EndIf
       Else
         $repair = PixelSearch(569,39,597,84,0xFFF000) ;searches top right screen for yellow of broken armor
         If((Not @error ) Or (CheckInv() == 1)) Then
              InvRepair()
         Else
            Move(338, 160)
            Sleep(Random(500,600))
            Send("{ESCAPE}") ;opens menu
            Sleep(Random(1000,1200))
            Click(407, 345) ;leave
            Sleep(Random(12000,13000))
         EndIf
       EndIf
     EndIf
   EndIf
WEnd

Func Move($x, $y)
   
   MouseClick('middle', Random($x - 3, $x + 3), Random($y - 3, $y + 3), 1, Random(0, 1))
   Sleep(Random(1500,1800))

EndFunc   ;==>Move

Func checkResume()
   Local $check = 0
   If Random(1,50,1) ==20 Then
     DEBUG("REST +-5min")
     Sleep(Random (250000,350000))
   EndIf
   While $check == 0
   $resume = PixelSearch(63, 255, 83, 269, 0x2C0100,10)
     If Not @error Then
       $check = 1
       DEBUG("RESUME")
     Else
       Sleep(100)         
     EndIf
   WEnd
EndFunc
Func checkInGame()
   Local $check = 0
   While $check == 0
   $inGame = PixelSearch(488, 591, 502, 610, 0x192864,10)
     If Not @error Then
       $check = 1
       DEBUG("InGame")
     Else
       Sleep(100)         
     EndIf
   WEnd
EndFunc

Func Shoot($x, $y)
   MouseClick('right', $x, $y, Random(280,340))
   Sleep(Random(100, 200))
EndFunc   ;==>Shoot

Func Teleport()
   MouseMove(59, 199)
   _Send('z', Random(2000,2200))
   Sleep(Random(100, 200))
EndFunc   ;==>Teleport

Func Click($x, $y)
   MouseClick('left', Random($x - 5, $x + 5), Random($y - 3, $y + 3), 1, Random(0, 1))
   Sleep(Random(100, 200))
EndFunc   ;==>Click

Func FindItem()
   $work = 1
   $checkCount = 0
   
   While $work == 1 And $checkCount <10
     DEBUG("Search Item")
     $work = 0
;~      $SearchResult = PixelSearch(382, 131, $Right, $Bottom, $Color) ;searches for rares
;~      If Not @error Then
;~        MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
;~        Sleep(2500)
;~        $work = 1
;~        $checkCount = $checkCount +1
;~      EndIf
     $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color2 ) ;searches for magics
     If Not @error Then
       MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;clicks magic
       Sleep(Random(2400,2600))
       $work = 1
       $checkCount = $checkCount +1
     EndIf

;~      $SearchResult = PixelSearch(382, 131, $Right, $Bottom, $Color3 ) ;searches for legendarys
;~      If Not @error Then
;~        MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;clicks legendary
;~        Sleep(2500)
;~        $work = 1
;~        $checkCount = $checkCount +1
;~      EndIf
     $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Color4) ;searches for SETS
     If Not @error Then
       MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
       Sleep(2500)
       $work = 1
       $checkCount = $checkCount +1
     EndIf
    
     ; search for gems

     $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Amethyst,9) ;searches for gems
     If Not @error Then
       MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
       Sleep(Random(2400,2600))
       $work = 1
       $checkCount = $checkCount +1
     EndIf
     $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Ruby,6) ;searches for gems
     If Not @error Then
       MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
       Sleep(Random(2400,2600))
       $work = 1
       $checkCount = $checkCount +1
     EndIf
     $SearchResult = PixelSearch(382, 131, $Right, $Bottom, $Topaz,4) ;searches for gems
     If Not @error Then
       MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
       Sleep(Random(2400,2600))
       $work = 1
       $checkCount = $checkCount +1
     EndIf
     $SearchResult = PixelSearch($Left, $Top, $Right, $Bottom, $Emerald,9) ;searches for gems
     If Not @error Then
       MouseClick("left", $SearchResult[0], $SearchResult[1], 1, 10) ;IF ITS THERE IT CLICKS IT.
       Sleep(2500)
       $work = 1
       $checkCount = $checkCount +1
     EndIf
   WEnd 
   DEBUG("Finish Item Searching")
EndFunc

Func CheckInv()
   
   If Random(1,5,1)==1 Then
     Send("{i}") ;opens inv
     Sleep(Random(200,220))
     $full = PixelSearch(780, 474, 782, 476, 0x130C08,5)
     If @error Then
       DEBUG("FULL")
       Send("{i}") ;close inv
       Return 1
     EndIf
     $full = PixelSearch(754, 474, 756, 476, 0x130C08,5)
     If @error Then
       DEBUG("FULL")
       Send("{i}") ;close inv
       Return 1
     EndIf
     $full = PixelSearch(761, 466, 762, 468, 0x130C08,5)
     If @error Then
       DEBUG("FULL")
       Send("{i}") ;close inv
       Return 1
     EndIf
     Send("{i}") ;close inv
     Return 0
   Else
     Return 0
   EndIf
EndFunc

Func InvRepair()
     DEBUG("Going to repair")
       $slot1x = 538
       $slot1y = 367
       $offset = 27
         Send("t")
         Sleep(Random(8000,8200))
       If Random(1,2,1) == 1 Then ;2 merchants
         MouseClick("left", 700, 147) ;begin movement towards merchant
         Sleep(Random(2400,2600))
         MouseClick("left", 531, 51) ;moves to get merchant in screen
         Sleep(Random(3000,3200))
         For $i = 0 To 9
         For $j = 0 To 3
            MouseClick("right", $slot1x + ($i * $offset), $slot1y + ($j * $offset),1,3)
            Sleep(40)
         Next
       Next
       For $i = 5 To 9
         For $j = 4 To 5
            MouseClick("right", $slot1x + ($i * $offset), $slot1y + ($j * $offset),1,3)
            Sleep(40)
         Next
       Next            
         Click(294, 296) ;button to open up repair menu
       Else
         MouseClick("left", 39, 389) ;begin movement towards merchant
         Sleep(Random(2400,2600))
         MouseClick("left", 31, 108) ;moves to get merchant in screen
         Sleep(Random(3000,3200))
         For $i = 0 To 9
         For $j = 0 To 3
            MouseClick("right", $slot1x + ($i * $offset), $slot1y + ($j * $offset),1,3)
            Sleep(40)
         Next
       Next
       For $i = 5 To 9
         For $j = 4 To 5
            MouseClick("right", $slot1x + ($i * $offset), $slot1y + ($j * $offset),1,3)
            Sleep(40)
         Next
       Next            
         Click(293, 370) ;button to open up repair menu
       EndIf
         
      
         Sleep(Random(1500,1600))
         MouseClick("left", 186, 326) ;button to pay for repairs
         Sleep(Random(1500,1600))
       $inBag = PixelSearch(780, 474, 782, 476, 0x130C08,5)
       If @error Then
         DEBUG("Not at shop")
         Sleep(500)
         Send("{ESCAPE}") ;opens menu
         Sleep(Random(1000,1200))
         Click(407, 345) ;leave
         Sleep(Random(12000,13000))
       Else
         Send("{ESCAPE}") ;opens menu
         Sleep(Random(1000,1200))
         Send("{ESCAPE}") ;opens menu
         Sleep(Random(1000,1200))
         Click(407, 345) ;leave
         Sleep(Random(2000,2200))
       EndIf
EndFunc

Func Pause()
   $Paused = Not $Paused
   While $Paused
      Sleep(100)
      ToolTip('Paused...', 0, 0)
   WEnd
   ToolTip("")
EndFunc   ;==>Pause

Func openSpell() ; RANDOM STUFF
   If Random(1,12,1) == 1 Then
   send('s')
   Sleep(Random(2000,3000))
   send('s')
   EndIf
EndFunc

Func _Send($text, $milliseconds)
    $time = TimerInit()
    Do
        Send($text)
    Until TimerDiff($time) > $milliseconds
EndFunc

Func Quit()
   Exit
EndFunc   ;==>Quit

Func DEBUG($MESSAGE)
   If $DebugOn Then
      ToolTip($MESSAGE, 0, 0)
   EndIf
EndFunc      ;==>Debug Info











Pause/Unpause = F10, End = Stop

A video of the bot running :
http://youtu.be/9sSAluOmAcI


Last edited by fmflex on Tue Jul 17, 2012 9:39 pm, edited 24 times in total.
Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 6:16 pm 
 
User
User
User avatar

Joined: Mon Nov 15, 2004 10:12 pm
Location: New York
Sweet thanks.

_________________
Image

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 7:23 pm 
 
User
User

Joined: Fri Mar 26, 2004 8:36 pm
how can i adupt those window settings for my d3? is there some trick or program that shows me the exact position of my window?

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 8:02 pm 
 
User
User

Joined: Thu Jun 07, 2012 5:03 pm
Code uptaded with new feature , partly from I AM ALPHA dh version

Use this to get coord
Opt('MouseCoordMode', 0)
Opt('PixelCoordMode', 0)
HotKeySet('{END}', 'Quit')
HotKeySet('{F9}', 'Pause')

WinActivate('Diablo III')
While 1

WEnd
   Func Quit()
   Exit
EndFunc   ;==>Quit

Func Pause()
$MPos = MouseGetPos()
       ToolTip($MPos[0] & " " & $Mpos[1], 0, 0)
EndFunc   ;==>Pause


just press F9 and he will get you mouse position

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 9:07 pm 
 
User
User

Joined: Fri Jul 09, 2010 7:14 pm
hmm, bot run great...but don't no y, it doesn't pick up items for me...(just move around, loot golds, town, exist) oo may the color is wrong for me >.<...how do i get the color? drop items on ground, print screen, use autoit window information...drag the thing onto the item on ground? or drag it to the item color in inventory?...i'm hella nub. :(

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 9:27 pm 
 
User
User

Joined: Thu Jun 07, 2012 5:03 pm
item name on ground but the color must be good normaly :o blue color from name ect , gem its the color of the item on the floor
you take the color from the screen

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 10:31 pm 
 
User
User

Joined: Fri Jul 09, 2010 7:14 pm
item name on ground but the color must be good normaly :o blue color from name ect , gem its the color of the item on the floor
you take the color from the screen


xd, can i zoom in from the game to get the color? (default key=z)
or i can screen shot, zoom in from paint to get the color...or am i suppose to get the color exactly as the screen show?.

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 10:54 pm 
 
User
User

Joined: Fri Jul 09, 2010 7:14 pm
um also, didn't see any sell function...only check and close O_o

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 11:00 pm 
 
User
User

Joined: Wed May 30, 2012 5:55 pm
misses an open cellar a small portion of the time, attacks in Archon for an extremely long period of time, that should be easy to fix.

well done, will keep checking for updates :D

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 11:02 pm 
 
User
User

Joined: Wed May 30, 2012 6:32 pm
So, if you collect rare/set/unique does it sell them?

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 11:10 pm 
 
User
User

Joined: Fri Jul 09, 2010 7:14 pm
So, if you collect rare/set/unique does it sell them?

you can't sell un-identify item -_-

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 11:24 pm 
 
User
User
User avatar

Joined: Mon Nov 15, 2004 10:12 pm
Location: New York
Sweet even better!

Thanks a lot buddy!

_________________
Image

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sat Jun 09, 2012 11:47 pm 
 
User
User

Joined: Wed May 30, 2012 6:32 pm
So, if you collect rare/set/unique does it sell them?

you can't sell un-identify item -_-


ZOMG! Good point.

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sun Jun 10, 2012 12:33 am 
 
User
User

Joined: Thu Jun 07, 2012 5:03 pm
i know archon is a bit long i will reduce the time and put a drag click to click the small one faster. and for the cellar the problem is when the 4 teleport bug :s maybe i should try to increase the pixel scan square. will see :)

Top
 Profile  
 Post subject: Re: [AutoIt]Dank Cellar Gold farm (Wizard)
PostPosted: Sun Jun 10, 2012 1:07 am 
 
User
User

Joined: Sun Jun 10, 2012 1:05 am
1. Great bot!
2. Could you TP to town first then exit? It shaves a few seconds.
3. I see you mentioned a sell function, yet the bot is leaving blue items so it has nothing to sell. Intended?

Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1024 posts ]  Go to page 1, 2, 3, 4, 5 ... 69  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron