Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Made by Suna and Erz
- ;
- ;Macros:
- ;#Action bar 1
- ;/click PVPHonorFrame
- ;/click PVPFrameTab2
- ;/click PVPFrameLeftButton
- ;
- ;#Action bar 2
- ;#/script AcceptBattlefieldPort(1, 1)
- ;
- ;#Action bar 3
- ;#/afk
- ;
- ;#Action bar 4
- ;#/script LeaveBattlefield()
- ;
- ;Action bar 5(Leader only)
- ;/script AcceptBattlefieldPort(1, 0)
- #include <ImageSearch.au3>
- #include <GuiEdit.au3>
- #include <Date.au3>
- #include <Array.au3>
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #include <StaticConstants.au3>
- HotKeySet("{F10}", "_stop")
- #Region ### START Koda GUI section ###
- Global $wlog
- Global $var
- Global $var2 = WinList("World of Warcraft", "")
- Global $i
- Global $run = false
- Global $inverse
- Global $running = false
- Global $quit
- Global $win = 1
- Global $log = 2
- Global $team = 3
- Global $ct1w = 0 ;number of win for team 1
- Global $ct1l = 0 ;number of loss for team 1
- Global $ct2w = 0 ;number of win for team 2
- Global $ct2l = 0 ;number of loss for team 2
- ;Global $button = "button.bmp"
- ;Global $buttonQ = "buttonQ.bmp"
- Global $teamproc = 0
- ;FOR TESTING
- Global $button = "button1.bmp"
- Global $buttonQ = "button1.bmp"
- Func _log($slog)
- _GUICtrlEdit_AppendText($wlog,$slog & @CRLF)
- endfunc
- Func _MSec()
- ; timer to "thousandths" of a second
- ; Author - Holger
- Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
- DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime))
- $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8))
- $stSystemTime = 0
- Return $sMilliSeconds
- EndFunc
- func _timeInMs()
- return (@HOUR*360000)+(@MIN*60000)+(@SEC*1000)+_MSec()
- endfunc
- $MainWin = GUICreate("FAKE U GLHADIOTARD", 261, 501, 198, 131)
- $FuncMenu = GUICtrlCreateMenu("&Functions")
- $RenWoW = GUICtrlCreateMenuItem("Rename", $FuncMenu)
- $Login = GUICtrlCreateMenuItem("Login", $FuncMenu)
- $HelpWin = GUICtrlCreateMenu("&Help")
- $ReadMe = GUICtrlCreateMenuItem("Readme", $HelpWin)
- $ZmbGrp = GUICtrlCreateGroup("T1", 144, 336, 97, 73, $BS_CENTER)
- $tagt1 = GUICtrlCreateButton("Tag T1", 152, 352, 75, 25, $BS_VCENTER)
- $entert1 = GUICtrlCreateButton("Enter T1", 152, 376, 75, 25, $BS_VCENTER)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $PrtyLdrs = GUICtrlCreateGroup("T2", 24, 336, 105, 73, $BS_CENTER)
- $tagt2 = GUICtrlCreateButton("Tag T2", 40, 352, 75, 25, $BS_VCENTER)
- $entert2 = GUICtrlCreateButton("Enter T2", 40, 376, 75, 25, $BS_VCENTER)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Group1 = GUICtrlCreateGroup("Que Functions", 48, 144, 169, 73, $BS_CENTER)
- $wlog = _GUICtrlEdit_Create($MainWin, "", 0, 5,260,140,$ES_MULTILINE + $ES_READONLY+$ES_AUTOVSCROLL)
- $RunBot = GUICtrlCreateButton("Run bot", 56, 184, 155, 25, $BS_VCENTER)
- $combo1 = GUICtrlCreateCombo("2v2", 56, 160, 153, 25)
- GUICtrlSetData(-1, "3v3|5v5", "3v3")
- ;$gg = GUICtrlCreateButton("Good Game", 56, 184, 155, 25, $BS_VCENTER)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Label1 = GUICtrlCreateLabel("Debug Button :", 40, 296, 176, 33)
- GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
- $Group2 = GUICtrlCreateGroup("Ratio W/L", 48, 216, 169, 65, $BS_CENTER)
- $Label2 = GUICtrlCreateLabel("Team1", 56, 232, 37, 17)
- $Label3 = GUICtrlCreateLabel("Team2", 168, 232, 37, 17, $SS_RIGHT)
- $Counter_t1 = GUICtrlCreateLabel("000/000", 56, 248, 77, 20)
- GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
- $Counter_t2 = GUICtrlCreateLabel("000/000", 144, 248, 61, 20, $SS_RIGHT)
- GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Lo_t1 = GUICtrlCreateButton("Quit T1", 48, 416, 163, 25, $WS_GROUP)
- $Lo_t2 = GUICtrlCreateButton("Quit T2", 48, 440, 163, 25, $WS_GROUP)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- _log("Started !")
- func _stop();STOP THE BOT
- $running = false
- _log("Bot going to stop...")
- GUICtrlSetData ( $RunBot, "Wait for the end...")
- endfunc
- Func updatecounter() ;U NO SAY (FACE)
- GUICtrlSetData ($Counter_t1, $ct1w&" / "&$ct1l)
- GUICtrlSetData ($Counter_t2, $ct2w&" / "&$ct2l)
- EndFunc
- Func ct1() ;add a win for team 1 and a loss for team 2
- $ct1w = $ct1w + 1
- $ct2l = $ct2l + 1
- EndFunc
- Func ct2() ;add a win for team 2 and a loss for team 1
- $ct2w = $ct2w + 1
- $ct1l = $ct1l + 1
- EndFunc
- Func ImgS($locx,$locy,$img)
- $X=0
- $Y=0
- $image_path = @ScriptDir & "\" & $img
- ;_log($image_path)
- $Restart = _ImageSearchArea($image_path,1,$locx,$locy,500+$locx,500+$locy,$X,$Y,100)
- If $Restart = 1 Then
- ;_log($X & " " & $Y)
- ;MouseMove($X, $Y,0)
- return 0
- else
- return 1
- EndIf
- EndFunc
- func PopArena($pos)
- $ret = ImgS($pos,0,$button)
- ;_log("Found: "&$ret)
- $time = _timeInMs()
- ;_log($time1)
- if($ret == 0) then
- if($pos==0)then
- $teamproc = 1
- else
- $teamproc = 2
- endif
- _log("Found POP")
- return $time
- endif
- return 1
- endfunc
- Func Main();the core of the script
- $inqueue = false
- $inverse = true
- $running = true
- GUICtrlSetData ( $RunBot, "F10 to stop")
- do
- if($inqueue=false) then
- Inscription()
- $inqueue = true
- _log("Inscriptions")
- endif
- if(Runin() = 0) then ;if arena proc is good < 1sec then all team go in arena
- Join()
- _log("Join Leader")
- JoinA()
- _log("Join Zombies")
- $inqueue = false
- sleep(10000)
- ;WinActivate($var[$log][1], "")
- ControlSend($var[$log][1], "", "", "{3}")
- for $i = $log to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{3}")
- next
- _log("Team "&$log&" Quit")
- leaveBG()
- if($inverse) then
- $win = 2
- $log = 1
- ct1()
- else
- $win = 1
- $log = 2
- ct2()
- endif
- updatecounter()
- $inverse = NOT $inverse
- sleep(10000)
- else
- _log("Bad proc")
- if($teamproc==2)then
- _log("T1 and T2 quit queue.")
- Joint1()
- ControlSend($var[2][1], "", "", "{5}")
- for $i = 2 to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{5}")
- next
- sleep(10000)
- ControlSend($var[1][1], "", "", "{3}")
- for $i = 1 to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{3}")
- next
- sleep(10000)
- ;ControlSend($var[1][1], "", "", "{ENTER}")
- ;for $i = 1 to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ;ControlSend($var2[$i][1], "", "", "{ENTER}")
- ;next
- ;sleep(10000)
- else
- _log("Joining T2 and T1 quit queue.")
- Joint2()
- ControlSend($var[1][1], "", "", "{5}")
- for $i = 1 to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{5}")
- next
- sleep(10000)
- ControlSend($var[2][1], "", "", "{3}")
- for $i = 2 to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{3}")
- next
- ;sleep(10000)
- ;ControlSend($var[2][1], "", "", "{ENTER}")
- ;for $i = 2 to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ;ControlSend($var2[$i][1], "", "", "{ENTER}")
- ;next
- ;sleep(10000)
- endif
- _log("Done bad proc")
- $inqueue = false
- ;_log("Leaving Arena queue !")
- endif
- Until ($running = false )
- GUICtrlSetData ( $RunBot, "Run Bot")
- _log("Bot stopped.")
- endfunc
- func leaveBG()
- $pos=500
- if($teamproc==1)then
- $pos = 0
- endif
- while(ImgS($pos,0,$buttonQ)==1)
- sleep(1000)
- wend
- ;WinActivate($var[$win][1], "")
- ControlSend($var[$win][1], "", "", "{4}")
- for $i = $win to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{4}")
- next
- _log("Team "&$win&" Win")
- ;WinActivate($var[$log][1], "")
- ;ControlSend($var[$log][1], "", "", "{ENTER}")
- ;for $i = $log to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ;ControlSend($var2[$i][1], "", "", "{ENTER}")
- ;next
- ;_log("Team "&$log&" logon")
- endfunc
- Func Runin()
- $t1=1
- $t2=1
- while 1
- if($t1==1) then
- $t1 = PopArena(500)
- endif
- if($t2==1) then
- $t2 = PopArena(0)
- endif
- $t = abs($t1-$t2)
- _log("T1: "&$t1&" T2: "&$t2&" DiffTime: "&$t)
- if($t1<>1 and $t2<>1 and $t<1000) then
- ;_log("Diff Time: " & $t)
- return 0
- else
- if(($t1<>1 or $t2<>1) and $t>=1000) then
- return 1
- endif
- endif
- sleep(50)
- wend
- EndFunc
- Func Inscription()
- For $i = 1 To $var[0][0]
- ;MsgBox(0, "HWNDs", "Title=" & $var[$i][0] & " HWND=" & $var[$i][1]) ;Extra crap
- ;WinActivate($var[$i][1], "")
- ControlSend($var[$i][1], "", "", "{h}")
- ControlSend($var[$i][1], "", "", "{1}")
- Next
- sleep(1000)
- EndFunc
- Func Join()
- For $i = 1 To $var[0][0]
- ;WinActivate($var[$i][1], "")
- ControlSend($var[$i][1], "", "", "{2}")
- Next
- EndFunc
- Func RenameWoW()
- $pos = 0
- $taille = 500
- $tmp = Winlist("WoWHost1","")
- if($tmp[0][0]==1)then
- $var[1] = $tmp[1]
- $tmp = Winlist("WoWHost2","")
- $var[2] = $tmp[1]
- $var[0][0] = 2
- for $i = 1 to (($team-1)*2)
- $tmp = Winlist("WoWZombie"&$i,"")
- $var2[$i] = $tmp[1]
- next
- $var2[0][0] = (($team-1)*2)
- $run = true
- else
- if($var2[0][0]<>($team*2)) then
- msgbox(0,"Error","Incorrect number of wows launched.")
- else
- for $i = 1 to 2
- WinSetTitle($var2[$i][1], "", "WoWHost"&$i)
- WinMove($var2[$i][1], "", $pos, 0, $taille,$taille)
- $pos = $pos + $taille
- Next
- $pos = 0
- $var2 = WinList("World of Warcraft", "")
- for $i = 1 to $var2[0][0]
- WinSetTitle($var2[$i][1], "", "WoWZombie"&$i)
- WinMove($var2[$i][1], "", $pos, 500, $taille,$taille)
- $pos = $pos + 100
- Next
- $var = WinList("WoWHost", "")
- $var2 = WinList("WoWZombie", "")
- $run = true
- endif
- endif
- EndFunc
- func login()
- Dim $tab[10][2]
- ; File Ini order
- ; 0 = Lead T1
- ; 1 = Lead T2
- ; 2 = Zombie T1
- ; 3 = Zombie T2
- ; 4 = Zombie T1
- ; 5 = Zombie T2
- ; 6 = Zombie T1
- ; 7 = Zombie T2
- ; 8 = Zombie T1
- ; 9 = Zombie T2
- for $i = 0 to ($team*2)-1
- $tab[$i][0] = iniread("login.ini",$i,"log","")
- ;_log($tab[$i][0])
- $tab[$i][1] = iniread("login.ini",$i,"mdp","")
- ;_log($tab[$i][1])
- next
- for $i = 0 to 1
- ;lead t1 / t2
- controlsend($var[$i+1][1],"","",$tab[$i][0])
- controlsend($var[$i+1][1],"","","{TAB}")
- controlsend($var[$i+1][1],"","",$tab[$i][1])
- controlsend($var[$i+1][1],"","","{ENTER}")
- next
- For $i = 2 to ($team*2)-3
- ;zombies t1 / t2
- controlsend($var2[$i-1][1],"","",$tab[$i][0])
- controlsend($var2[$i-1][1],"","","{TAB}")
- controlsend($var2[$i-1][1],"","",$tab[$i][1])
- controlsend($var2[$i-1][1],"","","{ENTER}")
- next
- endfunc
- Func JoinA()
- For $i = 1 to $var2[0][0]
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{2}")
- Next
- EndFunc
- Func Joint1()
- ControlSend($var[1][1], "", "", "{2}")
- For $i = 1 to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{2}")
- Next
- EndFunc
- Func Joint2()
- ControlSend($var[2][1], "", "", "{2}")
- for $i = 2 to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{2}")
- Next
- EndFunc
- Func Tagt1()
- ControlSend($var[1][1], "", "", "{h}")
- ControlSend($var[1][1], "", "", "{1}")
- EndFunc
- Func Tagt2()
- ControlSend($var[2][1], "", "", "{h}")
- ControlSend($var[2][1], "", "", "{1}")
- EndFunc
- Func Leavet1()
- ControlSend($var[1][1], "", "", "{4}")
- for $i = 1 to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{4}")
- Next
- EndFunc
- Func Leavet2()
- ControlSend($var[2][1], "", "", "{4}")
- for $i = 2 to $var2[0][0] step 2
- ;WinActivate($var2[$i][1], "")
- ControlSend($var2[$i][1], "", "", "{4}")
- Next
- EndFunc
- Func HelpDoc()
- MsgBox(0, "README", "CHECK THE TUTORIAL ON OWNEDCORE MOTHAFUKA!")
- EndFunc
- ;$var = WinList("WoWHost", "")
- ;$var2 = WinList("WoWZombie", "")
- ;$team = 3
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $entert2
- Joint2()
- Case $entert1
- Joint1()
- Case $tagt1
- Tagt1()
- Case $tagt2
- Tagt2()
- Case $Lo_t1
- Leavet1()
- Case $Lo_t2
- Leavet2()
- Case $ReadMe
- HelpDoc()
- Case $RunBot
- if($run) then
- if($running)then
- $running= not $running
- else
- Main()
- endif
- else
- msgbox(0,"Alert !","Open your "&($team*2)&" wows and use Functions->Rename first.")
- endif
- Case $RenWoW
- RenameWoW()
- Case $Login
- if($run)then
- login()
- else
- msgbox(0,"Alert !","Rename wow first !")
- endif
- case $combo1
- Switch GUICtrlRead($combo1)
- case "2v2"
- $team = 2
- case "3v3"
- $team = 3
- case "5v5"
- $team = 5
- EndSwitch
- _log($team&"v"&$team&" selected.")
- EndSwitch
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement