Code:
; __ __ .__ .___ _____
;/ \ / \___________| | __| _/ _____/ ____\
;\ \/\/ / _ \_ __ \ | / __ | / _ \ __\
; \ ( <_> ) | \/ |__/ /_/ | ( <_> ) |
; \__/\ / \____/|__| |____/\____ | \____/|__|
; \/ \/
; __ __ _____ __
;/ \ / \_____ _______ ________________ _/ ____\/ |_
;\ \/\/ /\__ \\_ __ \_/ ___\_ __ \__ \\ __\\ __\
; \ / / __ \| | \/\ \___| | \// __ \| | | |
; \__/\ / (____ /__| \___ >__| (____ /__| |__|
; \/ \/ \/ \/
;/###########################################################\
; Battleground Honor Farming Bot Created by: =Z= #
;************************************************************#
; #
;************* #
; Description #
;************* #
; This bot will queue for BGs and use anti-afk measures. #
; You will be prompted for instructions to setup the bot #
; follow the tooltips / prompts, tooltips are in top left #
; corner. #
; #
;************* #
; Features #
;************* #
; • Anti-AFK #
; • Basic navigation (currently AV only) #
; • Death-checking + releasing #
; • Auto BG queuing / detecting #
; • BG end detection and re-queing #
;\###########################################################/
;DO NOT TOUCH - ALTERING THESE WILL BREAK THE MACRO
Global $join[2] ; position of button to click
Global $colour = 14684936 ; the decimal color of the buttons
Global $bgnum = 0; battleground number
Global $bgnav ; battleground navigation
;MAIN MACRO
WinActivate("World of Warcraft") ; activate window
ToolTip("Opening WoW window...", 0, 0); displays tooltip in top left corner
WinWaitActive("World of Warcraft") ; wait untill the window is active
While 1
WinWaitActive("World of Warcraft")
ToolTip("Executing script...", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
Prep()
Wend
;Prep functions - sets up options
Func Prep()
ToolTip("Setting up coordinates, prepare for further instructions...", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
ToolTip("Opening BG window...", 0, 0) ; displays tooltip in top left corner
Send("{h}") ;pressed h key
Sleep (2000)
ToolTip("Mouse over the Join Battle button, you have 5 seconds...", 0, 0) ; displays tooltip in top left corner
Sleep (5000)
$x = MouseGetPos() ;sets target to mouse position
$join = $x ;sets global variable
ToolTip("Join Battle button location set", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
$bgnav = InputBox("Choose navigation options", "Y - Enable BG Navigation, N - Disable BG Navigation", "", "")
If $bgnav = "y" then
ToolTip("You have selected to enable BG Navigation", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
ToolTip("Please enter your battleground number...", 0, 0) ; displays tooltip in top left corner
Sleep (1000)
$bgnum = InputBox("Choose your Battleground", "1 - AV, 2 - AB, 3 - WG, 4 - EoTS, 5 - SotA, 6 - IoC,", "", "")
If $bgnum = 1 Then
ToolTip("You have selected, Alterac Valley, script will use AV nav procedure, beginning queing process", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
ElseIf $bgnum = 2 Then
ToolTip("You have selected, Arathi Basin, script will use AB nav procedure, beginning queing process", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
ElseIf $bgnum = 3 Then
ToolTip("You have selected, Warson Gulch, script will use WG nav procedure, beginning queing process", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
ElseIf $bgnum = 4 Then
ToolTip("You have selected, Eye of the Storm, script will use EotS nav procedure, beginning queing process", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
ElseIf $bgnum = 5 Then
ToolTip("You have selected, Strand of the Ancients, script will use SotA nav procedure, beginning queing process", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
ElseIf $bgnum = 6 Then
ToolTip("You have selected, Isle of Conquest, script will use IoC nav procedure, beginning queing process", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
Else
ToolTip("You have selected nothing, script will not use a nav procedure, beginning queing process", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
EndIf
ElseIf $bgnav = "n" then
ToolTip("You have selected to disable BG Navigation", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
EndIf
Send("{h}") ;pressed h key
Sleep (2000)
Queue()
EndFunc
;Queue function - queues for BG
Func Queue()
ToolTip("Beginning battleground script...", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
ToolTip("Opening BG window...", 0, 0) ; displays tooltip in top left corner
Send("{h}") ;pressed h key
sleep (1000)
MouseMove ($join[0], $join[1]) ;move to area coordinates for join button
ToolTip("Queing for BG...", 0, 0) ; displays tooltip in top left corner
Sleep (1000)
MouseClick ("left")
Sleep(1000)
ToolTip("Closing BG window...", 0, 0) ; displays tooltip in top left corner
Send("{h}") ;pressed h key
Sleep (1000)
Join()
EndFunc
;Join function - detects enter battle button and joins BG
Func Join()
ToolTip("Waiting for BG to start", 0, 0) ; displays tooltip in top left corner
while 1=1
$coord = PixelSearch(808, 231, 946, 250, 0xE01308, 100) ;searches for color of join battleground button within 100 variations
If Not @error Then
MouseMove ($coord[0], $coord[1]) ;move to area coordinates for join button
ToolTip("Joining BG", 0, 0) ; displays tooltip in top left corner
sleep (2000)
MouseClick ("left")
ToolTip("Waiting for BG to load for 10 seconds...", 0, 0) ; displays tooltip in top left corner
Sleep (10000)
BG() ; call combat loop
EndIf
ToolTip("No Enter Battle button located, checking again in 5 seconds...", 0, 0) ; displays tooltip in top left corner
Sleep (5000)
Join()
WEnd
EndFunc
;BG function - Navigates (if enabled) and runs anti-afk procedures, also detects death and BG end
Func BG()
If $bgnav = "y" then
;AV NAV CODE
ToolTip("Beginning Nav procedure", 0, 0) ; displays tooltip in top left corner
sleep (1000)
If $bgnum = 1 Then
Send ("{left down}")
sleep (150)
Send ("{left up}")
sleep (500)
Send ("{NUMLOCK}")
Sleep (2400)
Send ("{NUMLOCK}")
sleep (500)
Send ("{right down}")
sleep (205)
Send ("{right up}")
sleep (500)
Send ("{NUMLOCK}")
Sleep (9000)
Send ("{NUMLOCK}")
ToolTip("Waiting for 1:45 before continuing Nav procedure...)", 0, 0) ; displays tooltip in top left corner
sleep (105000)
ToolTip("Commencing Nav routine...", 0, 0) ; displays tooltip in top left corner
Send ("{NUMLOCK}")
Sleep (7000)
Send ("{left down}")
sleep (310)
Send ("{left up}")
sleep (25000)
Send ("{NUMLOCK}")
ToolTip("Nav routine complete...", 0, 0) ; displays tooltip in top left corner
sleep (2000)
;AB NAV CODE
ElseIf $bgnum = 2 Then
Send ("{DELETE}")
sleep (120000)
;WG NAV CODE
ElseIf $bgnum = 3 Then
Send ("{DELETE}")
sleep (120000)
;EotS NAV CODE
ElseIf $bgnum = 4 Then
Send ("{DELETE}")
sleep (120000)
;SotA NAV CODE
ElseIf $bgnum = 5 Then
Send ("{DELETE}")
sleep (120000)
;IoC NAV CODE
ElseIf $bgnum = 6 Then
Send ("{DELETE}")
sleep (120000)
EndIf
EndIf
while 1=1
$coord = PixelSearch(808, 231, 946, 250, 0xE01308, 100) ;searches for color of join battleground button within 100 variations
If Not @error Then
MouseMove ($coord[0], $coord[1]) ;move to area coordinates for join button
ToolTip("Character has died, respawning", 0, 0) ; displays tooltip in top left corner
sleep (2000)
MouseClick ("left")
ToolTip("Waiting for BG to load for 10 seconds...", 0, 0) ; displays tooltip in top left corner
Sleep (10000)
EndIf
$coord = PixelSearch(848, 783, 1144, 827, 0x670000, 10) ;searches for color of leave battleground button within 10 variations
If Not @error Then
MouseMove ($coord[0], $coord[1]) ;move to area coordinates for leave battleground button
ToolTip("BG has ended, re-starting queing process in 10 seconds", 0, 0) ; displays tooltip in top left corner
sleep (2000)
MouseClick ("left")
sleep (8000)
Queue() ; call combat loop
EndIf
ToolTip("BG not over, commencing anti-afk...", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
Send ("{SPACE}")
Sleep (1000)
For $i = 29 to 1 Step -1
ToolTip("Waiting 60 seconds to repeat routine... tick tock... ( | )", 0, 0); displays tooltip in top left corner
Sleep (500)
ToolTip("Waiting 60 seconds to repeat routine... tick tock... ( \ )", 0, 0); displays tooltip in top left corner
Sleep (500)
ToolTip("Waiting 60 seconds to repeat routine... tick tock... ( | )", 0, 0); displays tooltip in top left corner
Sleep (500)
ToolTip("Waiting 60 seconds to repeat routine... tick tock... ( / )", 0, 0); displays tooltip in top left corner
Sleep (500)
Next
WEnd
EndFunc