Code:
$WOW_WINDOW = "World of Warcraft"
WinActivate($WOW_WINDOW, "")
WinSetOnTop($WOW_WINDOW, "", 0)
Sleep(1000)
Global $BG_1[2]
Global $BG_2[2]
Global $POPUP
Global $COLOR = 14684936
HotKeySet("{F2}", "StopScript")
AdlibEnable("pause")
HotKeySet("{F1}", "pauseset")
$PAUSE = -1
While 1
WinWaitActive("World of Warcraft")
ToolTip("Executing script...", 0, 0)
Sleep(2000)
SETUP()
WEnd
Func SETUP()
ToolTip("Preparing setup, please wait...", 0, 0)
Sleep(2000)
ToolTip("Attempting to open BG Tab (h)", 0, 0)
Send("{h}")
SoundPlay("sound1.wav", 1)
ToolTip("Mouse over BG 1, you have 5 seconds...", 0, 0)
Sleep(5000)
$X = MouseGetPos()
$BG_1 = $X
SoundPlay("sound2.wav", 1)
ToolTip("Mouse over BG 2, you have 5 seconds...", 0, 0)
Sleep(5000)
$Y = MouseGetPos()
$BG_2 = $Y
$POPUP = InputBox("-ßlink- PvP Bot", "Please choose an option ( 1 or 2 )" & @LF & "" & @LF & "1 - Q for BG 1 ONLY" & @LF & "2 - Q for BG 1 AND BG 2", "", "")
If $POPUP = "1" Then
ToolTip("You have selected to ONLY Queue for BG 1...", 0, 0)
Else
ToolTip("You have selected to Queue for BOTH BG 1 & 2...", 0, 0)
EndIf
Send("{h}")
Sleep(2000)
QUEUE()
EndFunc
Func QUEUE()
If $POPUP = "1" Then
ToolTip("Beginning Queue script 1...", 0, 0)
Sleep(2000)
ToolTip("Opening BG window", 0, 0)
Send("{h}")
Sleep(1000)
MouseMove($BG_1[0], $BG_1[1])
ToolTip("Queing for BG 1", 0, 0)
Sleep(1000)
MouseClick("left")
Sleep(1000)
Send("{h}")
Sleep(1000)
MouseMove($BG_1[0], $BG_1[1])
ToolTip("Queing for BG 1", 0, 0)
Sleep(1000)
MouseClick("left")
Sleep(1000)
Send("{h}")
Send("{w}")
Send("{s}")
Sleep(10000)
JOIN()
Else
ToolTip("Beginning Queue script 2...", 0, 0)
Sleep(2000)
ToolTip("Opening BG window", 0, 0)
Send("{h}")
Sleep(1000)
MouseMove($BG_1[0], $BG_1[1])
ToolTip("Queing for BG 1", 0, 0)
Sleep(1000)
MouseClick("left")
Sleep(1000)
MouseMove($BG_2[0], $BG_2[1])
ToolTip("Queing for BG 2", 0, 0)
Sleep(1000)
MouseClick("left")
Sleep(1000)
Send("{h}")
MouseMove($BG_1[0], $BG_1[1])
ToolTip("Queing for BG 1", 0, 0)
Sleep(1000)
MouseClick("left")
Sleep(1000)
MouseMove($BG_2[0], $BG_2[1])
ToolTip("Queing for BG 2", 0, 0)
Sleep(1000)
Send("{h}")
Send("{w}")
Send("{s}")
Sleep(10000)
JOIN()
EndIf
EndFunc
Func JOIN()
ToolTip("Waiting for BG to start", 0, 0)
While 1 = 1
$COORD = PixelSearch(450, 150, 800, 230, 14684936, 100)
If Not @error Then
MouseMove($COORD[0], $COORD[1])
ToolTip("Joining BG", 0, 0)
Sleep(2000)
MouseClick("left")
ToolTip("Waiting for BG to load for 10 seconds...", 0, 0)
Sleep(10000)
AFK()
EndIf
ToolTip("No Enter Battle button located, checking again in 5 seconds...", 0, 0)
Sleep(5000)
JOIN()
WEnd
EndFunc
Func AFK()
While 1 = 1
$COORD = PixelSearch(350, 600, 1000, 690, 6750208, 10)
If Not @error Then
MouseMove($COORD[0], $COORD[1])
ToolTip("BG has ended, re-starting queing process in 10 seconds", 0, 0)
Sleep(2000)
MouseClick("left")
Sleep(8000)
QUEUE()
EndIf
ToolTip("BG not over, starting afk script", 0, 0)
Sleep(2000)
Send("{SPACE}")
Sleep(1000)
For $I = 29 To 1 Step - 1
ToolTip("Waiting 60 seconds to repeat ( | )", 0, 0)
Sleep(500)
ToolTip("Waiting 60 seconds to repeat ( \ )", 0, 0)
Sleep(500)
ToolTip("Waiting 60 seconds to repeat ( | )", 0, 0)
Sleep(500)
ToolTip("Waiting 60 seconds to repeat ( / )", 0, 0)
Sleep(500)
Next
WEnd
Func PAUSESET()
$PAUSE = $PAUSE * - 1
EndFunc
Func PAUSE()
While $PAUSE = -1
Sleep(500)
ToolTip("Bot Paused, F1 to resume.", 0, 0)
WEnd
EndFunc
Func STOPSCRIPT()
$STOP = MsgBox(4, "-ßlink- PvP Bot", "Do you want to Exit the bot?")
If $STOP = 6 Then
ToolTip("Stopping Script...", 0, 0)
Sleep(3000)
Exit
EndIf
EndFunc