# Forum > Diablo 3 > Diablo 3 Bots and Programs > D3 Gold profiles >  [Goldfarming] AFK 150k-200k Gold Per Hour [AutoIT Script] [1920x1080] [made for DH]

## mackus101

It seems I have gotten to the point where I need to add to the forums after being a spectator and using some other people's codes for myself. After looking at another post about farming the dank cellar in Act I Legacy of Cain at the top of the map that always has the rare Sarkoth who is bugged so ranged don't have to worry about being attacked I automated my runs. 

_This is my first time attempting to put together scripting (never coded anything before) so hopefully it works just as well on yours as it does on mine._


*How to get everything started*

*1. Select Quest: Act I Legacy of Cain - Explore Cellar
2. Waypoint to Old Ruins
3. Run west until you hit a checkpoint (should occur in about 5-10 seconds)
4. Teleport to town, leave game
5. Run AutoIt Script
6. Return to game, press =*


*Summary*
With 205% Gold Find in Inferno my DH used this code to make *1.7mil in 9 hours* while I was at work yesterday
It is made very specifically for DH class _(may be able to be edited per class)_
More Gold Find = More Gold
Must open quest Act I Legacy of Cain - Explore Cellar (run once/leave game and resume before turning code on)
Will Repair broken gear
Understands if cellar is closed or open

*This Code will do the following:*

Run to Dank Celler at the top of the mapChecks if the location is open or closed
If Open it enters, Kills Sarkoth, Collects Gold, Teleports to town, Exits, Resumes, and Starts loop overIf Closed Teleports to town, Exits, Resumes, and Starts loop overChecks if you need to repair gear, automates loop to repair if needed, then restarts the main loop again

*Requirements
*
*Must be in FullScreen WINDOWED 1920x1080* (_for the pixel color search to work)_*Must have a minimum of 5 radius pick up* (_or you wont get all the gold that drops_)

*My Skill Set Up*
*On Right Click* - Elemental Arrow with Nether Tentacles _(Used to kill Sarkoth)_
*On 1*  - Caltrops With Hooked Spines _(to slow enemies on your path to cellar)_
*On 2*  - Smoke Screen with Lingering Fog _(to avoid enemies on path to cellar)_
*On 3* - Preparation with Battle Scars _(to add discipline for more smoke screens and add health on path to cellar)_
*On 4* - Marked for Death with Grim Reaper _(allows for more damage and creates aoe to minions in cellar)_
*Note: You can get an extra 10% GF switching out Marked for Death with Ferrets*

*If you have any advice on coding, changes, or better ways to go about this please feel free to give feedback especially since this is the first time I have ever written any script before.*

*EDIT: Added descriptions next to a lot of the coding for individuals to understand placement etc.*
*EDIT: Attempted some equations to automatically convert any 16:9 ratio resolutions.*



```
  Global $Paused

HotKeySet("=","Leave") 
HotKeySet("-", "Pause") 
HotKeySet("x", "Stop")

$default_resolutionX = 1920
$default_resolutionY = 1080
$x_ratio = @Desktopwidth / $default_resolutionX 
$y_ratio = @Desktopheight / $default_resolutionY

$go = True
$Leave = False

While $go
   if($Leave) Then
   $Pixel1 = PixelSearch((1482 * $x_ratio),(20 * $y_ratio),(1535 * $x_ratio),(95 * $y_ratio),0xFFF000) ;searches top right screen for yellow of broken armor
	  If Not @error Then
		 Send("t")
		 Sleep(8000)
		 MouseClick("left", Round(1480 * $x_ratio),Round(281 * $y_ratio));begin movement towards merchant
		 Sleep(1500)
		 MouseClick("left", Round(1316 * $x_ratio),Round(206 * $y_ratio)) ;moves to get merchant in screen
		 Sleep(1500)
		 MouseClick("left", Round(845 * $x_ratio),Round(225 * $y_ratio)) ;NPC Merchant to the right of cain's home
		 Sleep(1500)
		 MouseClick("left", Round(521 * $x_ratio),Round(506 * $y_ratio)) ;button to open up repair menu
		 Sleep(1500)
		 MouseClick("left", Round(260 * $x_ratio),Round(595 * $y_ratio)) ;button to pay for repairs		  
		 Sleep(2500)
		 Send("{ESCAPE}") ;exits store menu
		 Sleep(250)
		 Send("{ESCAPE}") ;opens menu
		 Sleep(1000)
		 MouseClick("left", Round(956 * $x_ratio),Round(579 * $y_ratio)) ;button to leave game
		 Sleep(8000)
		 MouseClick("left", Round(230 * $x_ratio),Round(416 * $y_ratio)) ;button to resume game from main menu
		 Sleep(8000)
	  Else
		 MouseClick("left", Round(587 * $x_ratio),Round(333 * $y_ratio)) ;starts the main run
		 Sleep(1800)
		 Send("2")
		 MouseClick("left", Round(96 * $x_ratio),Round(383 * $y_ratio))
		 Sleep(800)
		 Send("1")
		 Sleep(1500)
		 MouseClick("left", Round(417 * $x_ratio),Round(422 * $y_ratio)) ;middle of area outside of cellar
		 Send("1")
		 Sleep(2000)
		 Send("3")
		 Send("2")
		 MouseMove(Round(115 * $x_ratio),Round(210 * $y_ratio),1) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted	
		 Sleep(2000)
			$Pixel2 = PixelSearch(0,0,(960 * $x_ratio),(540 * $y_ratio),0x3B62E3,3) ;searches for the specific blue pixel that only occurs when mouse hovers over open cellar
			   If Not @error Then
				  MouseClick("left",Round(115 *$x_ratio),Round(210 * $y_ratio)) ;Entrance to cellar
				  Sleep(1900)
				  Send(2)
				  Sleep(1800)
				  MouseClick("left",Round(531 *$x_ratio),Round(769 * $y_ratio))
				  Sleep(2000)
				  MouseClick("left",Round(547 *$x_ratio),Round(490 * $y_ratio)) ;moves to doorway leading to rare inside cellar
				  Sleep(1500)
				  MouseMove(Round(579 * $x_ratio),Round(209 * $y_ratio),1) ;hovers over the rare Sarkoth
				  Send(4)
				  Sleep(1000)
				  Send("{SHIFTDOWN}")
				  MouseDown("right") ;attack middle	
				  Sleep(3800)
				  MouseMove(Round(467 * $x_ratio),Round(269 * $y_ratio),1) ;attack left, add more sleep time if you can't kill minion on left
				  Sleep(3000)
				  MouseMove(Round(682 * $x_ratio),Round(147 * $y_ratio),1) ;attack right
				  Sleep(800)
				  MouseMove(Round(579 * $x_ratio),Round(209 * $y_ratio),1) ;move back to middle
				  Sleep(1000)
				  MouseUP("right")
				  Sleep(300)
				  Send("{SHIFTUP}")
				  Sleep(500)
				  MouseClick("left",Round(579 *$x_ratio),Round(209 * $y_ratio)) ;location of sarkoth after death
				  Sleep(2500)
				  MouseClick("left",Round(866 *$x_ratio),Round(324 * $y_ratio)) ;moves to right top corner for gold
				  Sleep(1500)
				  MouseClick("left",Round(902 *$x_ratio),Round(954 * $y_ratio)) ;moves to bottom middle for gold			  
				  Sleep(1500)
				  MouseClick("left",Round(687 *$x_ratio),Round(413 * $y_ratio)) ;moves to left top corner for gold
				  Sleep(1500)
				  Send("t")
				  Sleep(8200)
				  Send("{Escape}") ;menu
				  MouseClick("left",Round(956 *$x_ratio),Round(579 * $y_ratio)) ;button to leave game
				  Sleep(13000)
				  MouseClick("left",Round(230 *$x_ratio),Round(416 * $y_ratio)) ;button to resume game from main menu
				  Sleep(7000)
			   Else
				  MouseClick("left",Round(900 *$x_ratio),Round(900 * $y_ratio))	;moves down screen away from cellar in attempt for safety before teleporting back to town
				  Sleep(1200)
				  Send("t")
				  Sleep(8200)
				  Send("{ESCAPE}") ;menu
				  MouseClick("left",Round(956 *$x_ratio),Round(579 * $y_ratio))	;button to leave game
				  Sleep(13000)
				  MouseClick("left",Round(230 *$x_ratio),Round(416 * $y_ratio))	;button to resume game from main menu
				  Sleep(8000)
			   EndIf
	  EndIf
   EndIf
WEnd

Func Pause()
   $Leave = False
EndFunc

Func Stop() ;to allow the script to stop
    Exit
EndFunc 
 
Func Leave()
    $Leave = True
 EndFunc
```

----------


## mackus101

Once Script is active it begins paused
Press = to Start the Script
Press - to pause
Press x to end the Script

----------


## iFarmer

Is AutoIt safe to bot with? It doesn't inject anything, does it?

The problem lies with it always clicking the same spots, making it obvious botting behavior. Right?

----------


## mackus101

From my very limited knowledge of programming code I believe this does not inject anything...it uses monitor coordinates to find where to click and uses the information on screen to find a color of a pixel. 

Yes clicking the same spots does make it obvious botting behavior so use at your own risk and make sure that you don't allow people to join your game

----------


## neversaynever

Is there anyway you can upload this in 1680x1050 <3  :Smile:  also - what program do I need to download, how do I load it etc.

Thanks a million!

----------


## kallellkryptonite

> Is AutoIt safe to bot with? It doesn't inject anything, does it?
> 
> The problem lies with it always clicking the same spots, making it obvious botting behavior. Right?


Lol, autoit bot does not inject. You'll be fine with this.

----------


## Purse

Is it possible to use this for a Wizard? Do I need to change the code at all?

----------


## mackus101

I think if you have skills that have similar characteristics as a DH you would be fine

Right click should be assigned to your best Ranged attack (aoe would be nice to take care of minions)
1 - is set up to lay a trap in the location of the TOON to slow the enemy down (not sure if the wizard has anything like that...maybe frost nova)
2 - is a defensive cooldown (most likely diamond skin for you)
3 - is a way to heal and add back into my discipline or Mana for you (not sure of your skills that do that)
4 - is a way to add damage to the Rare monster while also damaging the other minions (not sure of your skills that do that)

otherwise the rest of the script works for any ranged character that has skills enough to kill the enemies

----------


## Purse

> I think if you have skills that have similar characteristics as a DH you would be fine
> 
> Right click should be assigned to your best Ranged attack (aoe would be nice to take care of minions)
> 1 - is set up to lay a trap in the location of the TOON to slow the enemy down (not sure if the wizard has anything like that...maybe frost nova)
> 2 - is a defensive cooldown (most likely diamond skin for you)
> 3 - is a way to heal and add back into my discipline or Mana for you (not sure of your skills that do that)
> 4 - is a way to add damage to the Rare monster while also damaging the other minions (not sure of your skills that do that)
> 
> otherwise the rest of the script works for any ranged character that has skills enough to kill the enemies


My hotkeys are set as Q, W, E, R. Which lines in the script should I edit so they can correspond correctly? Is it the

Send("2") etc?

----------


## kallellkryptonite

> My hotkeys are set as Q, W, E, R. Which lines in the script should I edit so they can correspond correctly? Is it the
> 
> Send("2") etc?


Yessssssss

----------


## neversaynever

Can somebody give me a quick hand compiling this please? Thank you!

----------


## fukker

Hey mackus101 thanks for the script but where do u start it?i started in the cellar and it teleported to town then repairs and was just trapping and using skills in town then the script left game joined back and was doing skill in town again lol

----------


## fukker

> Can somebody give me a quick hand compiling this please? Thank you!


just open notepad put script there and save it as whatevername.au3 make sure its not .txt file and then right click on it and press Run Script and open diablo and press =

----------


## Purse

I just tested the script. Right now it goes to check if it's open , but when its closed, my toon just walks down to the fence and tries to town portal , but a zombie is still there and attacks me and interrupts my portalling. This only happens if a fat zombie happens to spawn on the path. No problem with the skinny zombies.

Proposed solution for the 1st problem: getting attacked while trying to TP when cellar is closed - instead of running down to the fence, I think running up to the little well is a safer option. How do I find out the coordinates of where to click so I can change the code?

Also ran into another issue, I don't know if this is a DH skill that lets you shoot through walls.. but once I entered into the cellar, my Wizard sat next to the wall and tried to shoot Arcane Orb through it aiming at Sarkoth + Minions. A big table also spawned at the door which might have affected by toon's pathing. Will do more testing.

Reason for problem 2: Just a latency issue with zoning into Dank Cellar, I added some delay to the 1st mouseclick to get into position at the doorway and now its all fine.

----------


## Alumix

I dont run in 1920 so I cant test it but one or two things for the future of your bot writing.
Make sleep times random. sleep(random($min,$max)), make different min/max sets so you get your 1500, 2500 aso ms. same goes with coords. If you get problems with navigation build in checks like if x> 504 next random x is smaller than intended. Sure it adds code and work but it is safer at least imo.
Your Pause / Leave function can be put together:
func pause()
$pause = NOT $pause // switch between true and false
endfunc
WIth that users only have to remember two buttons. They use a bot so they are lazy. 3 buttons might be to complex  :Big Grin: 
If you want people to be able to change your script try to use variables for the coords. for example: $xEntrance $yResumeGame 
That also helps to understand the code. No offence or anything intended just stuff I got as feedback during the years.

@neversaynever
if you google "autoit" you find it.
Download the full install, start the program and copy paste the code. save file,
Now if you want to just run it, go to Tools and click GO (shortcut F5)
If you want to compile it. Tools -> Compile (shortcut ctrl+f7) 

@Purse
maybe a check while using teleport. If you loose hp then use a pbae that damages everything around you. search for the hp bar of the npc, move mouse to it, and atk. while target-not-dead atk else use teleport.

aLumix

----------

