Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #MaxThreadsPerHotkey 7
- ^r::Reload
- Pause::Reload
- F5:: ;Hotkey to start
- if D3farm ; This means an underlying thread is already running the loop below.
- {
- D3farm := false ; Signal that thread's loop to stop.
- return ; End this thread so that the one underneath will resume and see the change made by the line above.
- }
- ; Otherwise:
- D3farm := true
- Loop ;main loop
- {
- ;ResumeSearch() ;clicking resume game
- LoadWait() ;waiting till after load screen
- MouseClick, right, 1668, 1049 ;blink
- Sleep, 500
- MouseClick, left, 975, 948 ;walk
- Sleep, 1200
- MouseClick, left, 1115, 944 ;walk
- Sleep, 1200
- MouseClick, left, 1106, 795 ;walk
- Sleep, 1000
- MouseClick, left, 1072, 592 ;talk to merchant
- RandomSleep(1000,1500)
- MouseClick, left, 513, 482 ;click on rings tab
- RandomSleep(500,1000)
- MouseMove, 377, 314 ;hover ammy 1
- ItemSearch() ;look for item
- MouseMove, 159, 315 ;hover ammy 2
- ItemSearch() ;look for item
- RandomSleep(100,500)
- Send, {V}
- RandomSleep(200,600)
- Send, {ESC}
- ;LeaveGame() ;click Leave Game
- if not D3farm ;
- break ;
- }
- D3farm := false ; Reset in preparation for the next press of this hotkey.
- return
- ^p::Pause
- ResumeSearch()
- {
- Loop ;looking for Resume
- {
- Imagesearch, x,y,%x%,%y%,%a_screenwidth%,%a_screenheight%, *40 %a_desktop%/D3farm/img/Resume.png
- Imagesearch, x,y,31,350,464,485, *40 %a_desktop%/D3farm/img/Resume.png
- If Errorlevel = 0
- {
- RandomSleep(200,1000)
- MouseClick, Left, X+6, Y+6
- Break
- }
- }
- }
- LoadWait()
- {
- Loop ;Waiting till loaded
- {
- Imagesearch, x,y,623, 879,745, 972, *40 %a_desktop%/D3farm/img/Inn.png
- If Errorlevel = 0
- {
- RandomSleep(200,1000)
- Break
- }
- }
- }
- LeaveGame()
- {
- Loop
- {
- Imagesearch, x,y,767,496,1143,684, *40 %a_desktop%/D3farm/img/LeaveGame.png ;looking for Leave Game button
- If Errorlevel = 0
- {
- RandomSleep(200,600)
- MouseClick, Left, X+6, Y+6 ;clicking Leave Game
- Break
- }
- }
- }
- RandomSleep(min,max)
- {
- Random, random, %min%, %max%
- Sleep %random%
- }
- ItemSearch()
- {
- Loop, 7 ;Waiting till loaded
- {
- Imagesearch, x,y,%x%,%y%,1454, 443, *60 %a_desktop%/D3farm/img/TestItem.png
- If Errorlevel = 0
- {
- Send, {PrintScreen}
- RandomSleep(1000,2000)
- Send, {V}
- Idle()
- ;Break
- }
- }
- }
- Idle()
- {
- Loop
- {
- RandomSleep(5000,10000)
- Send 4
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement