Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Array of colors to find different enemies
- ; 0x6C9FA6 Fatty
- ; 0xA9FEFD Mini
- ; 0x9CAAB8 Arms
- ; 0x56736E Dawgs
- Global $colors[4] = [0x6C9FA6, 0xA9FEFD, 0x9CAAB8, 0x56736E]
- ; Just in case we want to keep track of how many loops have been done
- Global $loop_n = 1
- Global $had_fight = 0
- HotKeySet("{F4}", "ExitProg")
- Func ExitProg()
- Exit
- EndFunc
- ;Start Main Account
- Func start_main_account()
- ConsoleWrite('Starting up')
- MouseMove (465, 1061)
- Sleep(500)
- MouseClick ("Left")
- Sleep(1000)
- EndFunc
- ; Click attack button
- Func click_attack($e_position)
- Local $pixel = $e_position
- MouseMove($pixel [0], $pixel [1], 1)
- Sleep(50)
- MouseClick ("Right")
- Sleep(1000)
- MouseMove (732, 407)
- Sleep (3000)
- ;$pixel2 = PixelSearch ($pixel[0]-105, $pixel[1]-111, $pixel[0]-41, $pixel[1]-35, 0xDBD8D2)BIGGER
- Local $pixel2 = PixelSearch ($pixel[0]-100, $pixel[1]-106, $pixel[0]-46, $pixel[1]-40, 0xDBD8D2)
- ;$pixel2 = PixelSearch ($pixel[0]-90, $pixel[1]-96, $pixel[0]-56, $pixel[1]-50, 0xDBD8D2) OG
- If IsArray($pixel2) = True Then
- MouseMove($pixel2 [0], $pixel2 [1], 1)
- MouseClick ("left")
- Sleep (500)
- Else
- ConsoleWrite("No Button Found, looking for new enemy...")
- Return "button not found"
- EndIf
- EndFunc
- ; [TODO] Click extract button
- Func click_extract()
- EndFunc
- ; Find an enemy for us to attack
- ; Accepts a color code: findEnemy(0x6C9FA6)
- Func findEnemy($e_color)
- Return PixelSearch (505, 458, 788, 713, $e_color)
- EndFunc
- Func MenuOpen()
- Local $menupixel1 = PixelGetColor(954, 435)
- Local $menupixel2 = PixelGetColor(957, 622)
- If ($menupixel1 == 0xFFFFFF And $menupixel2 == 0xCDCAC1) Then
- return True
- Else
- return False
- EndIf
- EndFunc
- Func CloseMenu()
- If MenuOpen() Then
- Send("{ESC}")
- EndIf
- EndIf
- ; Main loop
- while 1
- $had_fight = 0
- $attack = ""
- start_main_account()
- ; Loop through enemies, attacking each one
- For $i =0 To UBound($colors) - 1
- $enemy = findEnemy($colors[$i])
- ; Attack the enemy if we managed to find one, continue looping
- ; we didn't
- If IsArray($enemy) = True Then
- $attack = click_attack($enemy)
- If $attack == "button not found" Then
- ContinueLoop
- EndIF
- ; [TODO] Refactor the shit out of this
- ;MouseMove($enemy [0], $enemy [1], 1)
- Sleep (5500)
- ;Second Account Ready Up
- MouseMove (515, 1060)
- Sleep (250)
- MouseClick ("Left")
- Sleep (500)
- Send ("{SPACE}")
- ConsoleWrite('account 1 ready up')
- Sleep(1000)
- ;Main Account ready up
- MouseMove (465, 1061)
- Sleep (250)
- MouseClick ("Left")
- Sleep (500)
- Send ("{SPACE}")
- ConsoleWrite('account 2 ready up')
- Sleep(6000)
- ; Attacking Script
- Send ("1")
- Sleep (250)
- MouseClick ("left", 673, 554)
- Sleep (3000)
- Send ("1")
- Sleep (250)
- MouseClick ("left", 673, 554)
- ConsoleWrite('Fight over!')
- Sleep (30000)
- Send ("{ESC}")
- ConsoleWrite('account 1 close menu')
- Sleep (1000)
- ;Account2 clean up
- MouseMove (515, 1060)
- Sleep (1000)
- MouseClick ("Left")
- Sleep (1000)
- Send ("{ESC}")
- ConsoleWrite('account 2 close menu')
- ; Set var so we know we had a fight
- $had_fight = 1
- Sleep (3000)
- ExitLoop
- Else
- ; Uncomment to help with debugging
- ;ConsoleWrite("Enemy not found: " & $colors[$i])
- ContinueLoop
- EndIf
- Next
- ; If we didn't have a fight, select window 2 so that window 1 doesn't
- ; get minimized when the loop restarts
- If $had_fight == 0 Then
- MouseMove (515, 1060)
- Sleep (1000)
- MouseClick ("Left")
- Sleep (1000)
- EndIf
- ; Lets take it from the top!
- ConsoleWrite("Loop " & $loop_n)
- ; Sleep for a moment so we don't have crazy high cpu usage
- Sleep(500)
- ContinueLoop
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement