Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\..\..\..\Pictures\ICO\moxzbot.ico
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <array.au3>
Global $version = "2.3"
Global $fileExit, $jqkey, $aaKey, $jqmodcombo, $aamodcombo, $mNONE, $mSHIFT, $mCTRL, $mALT, $jqmodPick, $aamodPick, $sGUI, $jqInput, $aaInput
Global $random1, $random2, $randomtime, $botData, $ppkey, $ppmodpick, $ppmodcombo, $ppInput, $looping, $tGUI, $r1Input, $r2Input, $combodat
Global $handledata, $combodatlabel, $wowHandle, $list, $PID, $hWnd, $modArray, $helptext
If Not FileExists(@AppDataDir & "\Moxzbot") Then DirCreate(@AppDataDir & "\Moxzbot\")
if not FileExists(@AppDataDir & "\Moxzbot\Help.txt") Then FileInstall("C:\Documents and Settings\Zach\My Documents\autoit scripts\WoW bot\Help.txt", @AppDataDir & "\Moxzbot\Help.txt")
if Not FileExists(@AppDataDir & "\Moxzbot\moxzbot.ini") Then FileInstall("C:\Documents and Settings\Zach\My Documents\autoit scripts\WoW bot\moxzbot.ini", @AppDataDir & "\Moxzbot\moxzbot.ini")
if not processexists("WoW.exe") Then
msgbox(0, "Error", "Please open World of Warcraft")
Exit
Else
$buttonLab = "Start"
Opt("GUIOnEventMode", 1)
$mGUI = GUICreate("MoxzBot v" & $version, 200, 200, -1, -1, $WS_BORDER)
$fileMenu = GUICtrlCreateMenu("&File")
$fileHelp = GuiCtrlCreateMenuItem("Help", $fileMenu)
GuiCtrlSetOnEvent($fileHelp, "HelpMenu")
$fileExit = GUICtrlCreateMenuItem("Exit", $fileMenu)
GUICtrlSetOnEvent($fileExit, "Close")
$sMenu = GuiCtrlCreateMenu("&Settings")
$sKeybinds = GuiCtrlCreateMenuItem("Keybinds", $sMenu)
GUICtrlSetOnEvent($sKeybinds, "keybindsGUI")
$sTimer = GuiCtrlCreateMenuItem("Timer", $sMenu)
GuiCtrlSetOnEvent($sTimer, "timerGUI")
$startButton = GUICtrlCreateButton($buttonLab, 20, 20, 50, 30)
GuiCtrlSetOnEvent($startButton, "StartButton")
$botLabel = GuiCtrlCreateLabel("Click 'Start' to begin", 85, 30, 100, 30)
$comboLabel = GuiCtrlCreateLabel("pick a WoW.exe Process ID", 30, 70)
$comboLabel2 = GuiCtrlCreateLabel("Your bot will send keys to this process", 10, 120)
$combodat = GuiCtrlCreateCombo("", 45, 90, 100)
populate()
GUISetState(@SW_SHOW)
EndIf
while 1
if($looping = 1) Then
readIni()
;msgbox(1,$handledata,$wowHandle)
$jqmodi = iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", $modArray[5][1], "")
$aamodi = iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", $modArray[6][1], "")
$ppmodi = iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", $modArray[7][1], "")
$randomtime = Random($random1, $random2)
$randomtime = $randomtime * 1000
sleep($randomtime / 5)
sleep($randomtime / 5)
sleep($randomtime / 5)
;ControlSend($hWnd, "", "", $ppmodi & "{" & $ppkey & "}")
;sleep(50)
;ControlSend($hWnd, "", "", $ppmodi & "{" & $ppkey & "}")
sleep(50)
ControlSend($hWnd, "", "", $aamodi & "{" & $aaKey & "}")
sleep(50)
ControlSend($hWnd, "", "", $jqmodi & "{" & $jqkey & "}")
sleep($randomtime / 5)
sleep($randomtime / 5)
else
sleep(50)
EndIf
WEnd
func Close()
Exit
EndFunc ;==>Close
func timerGUI()
readIni()
$tGUI = GUICreate("Timer", 200, 200, -1, -1, $WS_BORDER)
GuiCtrlCreateLabel("Random Delay is chosen", 30, 10)
GUICtrlCreateLabel("Between :", 45, 40)
$r1Input = GUICtrlCreateInput($random1, 95, 38, 50)
GuiCtrlCreateLabel("And :", 45, 70)
$r2Input = GuiCtrlCreateInput($random2, 95, 68, 50)
GuiCtrlCreateLabel("Seconds", 70, 100)
$timerSave = GuiCtrlCreateButton("Save", 35, 130, 50)
GuiCtrlSetOnEvent($timerSave, "timerSave")
$timerDefault = GuiCtrlCreateButton("Default", 105, 130, 50)
GuiCtrlSetOnEvent($timerDefault, "timeDefault")
GUISetState()
EndFunc ;==>timerGUI
Func timerSave()
$iniwrite = GuiCtrlRead($r1Input)
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "timer", "random1", $iniwrite)
$iniwrite = GuiCtrlRead($r2Input)
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "timer", "random2", $iniwrite)
GUIDelete($tGUI)
EndFunc ;==>timerSave
Func timeDefault()
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "timer", "random1", "5")
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "timer", "random2", "12")
GUIDelete($tGUI)
EndFunc ;==>timeDefault
func keybindsGUI()
readIni()
Opt("GUIOnEventMode", 1)
$sGUI = GUICreate("Keybinds", 300, 180, -1, -1, $WS_BORDER)
;JOIN / QUEUE KEYBIND
$join_queue = GUICtrlCreateLabel("Queue / Join : ", 10, 20)
$jqInput = GuiCtrlCreateInput($jqkey, 85, 18, 40, 20)
$jqmod = GuiCtrlCreateLabel("Modifier:", 140, 20)
$jqmodcombo = GuiCtrlCreateCombo($modArray[5][1], 190, 18, 60, 20)
;GUICtrlSetData(-1,$mNONE &"|"& $mSHIFT &"|"& $mCTRL &"|"& $mALT)
GuiCtrlSetData(-1, $modArray[1][0] & "|" & $modArray[2][0] & "|" & $modArray[3][0] & "|" & $modArray[4][0])
;ANTI AFK KEYBIND
$antiAfk = GuiCtrlCreateLabel("Anti-AFK : ", 10, 50)
$aaInput = GuiCtrlCreateInput($aaKey, 85, 48, 40, 20)
$aamod = GuiCtrlCreateLabel("Modifier:", 140, 50)
$aamodcombo = GuiCtrlCreateCombo($modArray[6][1], 190, 48, 60, 20)
GuiCtrlSetData(-1, $modArray[1][0] & "|" & $modArray[2][0] & "|" & $modArray[3][0] & "|" & $modArray[4][0])
;PVP PANE KEYBIND
;$pvpPaneL = GuiCtrlCreateLabel("PVP Pane : ", 10, 80)
;$ppInput = GuiCtrlCreateInput($ppkey, 85, 78, 40, 20)
;$ppmod = GuiCtrlCreateLabel("Modifier:", 140, 80)
;$ppmodcombo = GuiCtrlCreateCombo($modArray[7][1], 190, 78, 60, 20)
;GuiCtrlSetData(-1, $modArray[1][0] & "|" & $modArray[2][0] & "|" & $modArray[3][0] & "|" & $modArray[4][0])
;SaveButton
$sSave = GuiCtrlCreateButton("Save", 20, 110, 40, 30)
GUICtrlSetOnEvent($sSave, "Savekeybind")
;DefaultButton
$defaultButton = GuiCtrlCreateButton("Default", 70, 110, 50, 30)
GuiCtrlSetOnEvent($defaultButton, "defaultKeybind")
;setstate
GUISetState()
EndFunc ;==>keybindsGUI
Func Savekeybind()
;JOIN QUEUE KEYBIND SAVE
$iniwrite = GuiCtrlRead($jqmodcombo)
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", "jqmodPick", $iniwrite)
$iniwrite = GuiCtrlRead($jqInput)
$iniwrite = StringLower($iniwrite)
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "keybind", "queue", $iniwrite)
;ANTI AFK KEYBIND SAVE
$iniwrite = GuiCtrlRead($aamodcombo)
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", "aamodPick", $iniwrite)
$iniwrite = GuiCtrlRead($aaInput)
$iniwrite = StringLower($iniwrite)
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "keybind", "afk", $iniwrite)
;PVP PANE KEYBIND SAVE
$iniwrite = GuiCtrlRead($ppmodcombo)
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", "ppmodPick", $iniwrite)
$iniwrite = GuiCtrlRead($ppInput)
$iniwrite = StringLower($iniwrite)
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "keybind", "pvp", $iniwrite)
GUIDelete($sGUI)
EndFunc ;==>Savekeybind
func DefaultKeybind()
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", "jqmodPick", "NONE")
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "keybind", "queue", "F9")
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", "aamodPick", "NONE")
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "keybind", "afk", "F10")
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", "ppmodPick", "NONE")
iniwrite(@AppDataDir & "\Moxzbot\moxzbot.ini", "keybind", "pvp", "h")
GUIDelete($sGUI)
EndFunc ;==>DefaultKeybind
func readIni()
;KEYBIND MODIFIER READ
$modArray = IniReadSection(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier")
$jqmodPick = Iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", $modArray[5][1], "ERROR")
$aamodPick = Iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", $modArray[6][1], "ERROR")
$ppmodpick = Iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "modifier", $modArray[7][1], "ERROR")
;KEYBIND READ
$aaKey = Iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "keybind", "afk", "ERROR")
$jqkey = Iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "keybind", "queue", "ERROR")
$ppkey = Iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "keybind", "pvp", "ERROR")
;TIMER READ
$random1 = Iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "Timer", "random1", "ERROR")
$random2 = Iniread(@AppDataDir & "\Moxzbot\moxzbot.ini", "Timer", "random2", "ERROR")
EndFunc ;==>readIni
func StartButton()
$buttonLab = "Pause"
$PID = GuiCtrlRead($combodat)
_GetHwndFromPID($PID)
GuiCtrlSetData($botLabel, "Bot Running")
GuiCtrlSetData($startButton, $buttonLab)
GuiCtrlSetOnEvent($startButton, "PauseButton")
$looping = 1
EndFunc ;==>StartButton
func PauseButton()
$buttonLab = "Start"
GuiCtrlSetData($botLabel, "Bot Paused")
GuiCtrlSetData($startButton, $buttonLab)
GuiCtrlSetOnEvent($startButton, "StartButton")
$looping = 0
EndFunc ;==>PauseButton
func HelpMenu()
Local $file = Run('Notepad.exe ' & @AppDataDir & '\Moxzbot\Help.txt')
EndFunc ;==>HelpMenu
;THISCODEISNTMINE
func populate()
Local $list = ProcessList("WoW.exe")
For $i = 1 To $list[0][0]
GUICtrlSetData($combodat, $list[$i][1], $list[1][1])
Next
EndFunc ;==>populate
Func _GetHwndFromPID($PID)
$hWnd = 0
$stPID = DllStructCreate("int")
Do
$winlist2 = WinList()
For $i = 1 To $winlist2[0][0]
If $winlist2[$i][0] <> "" Then
DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID))
If DllStructGetData($stPID, 1) = $PID Then
$hWnd = $winlist2[$i][1]
ExitLoop
EndIf
EndIf
Next
Sleep(100)
Until $hWnd <> 0
Return $hWnd
EndFunc ;==>_GetHwndFromPID
;THISHAH
-if you wish to distribute this or use it in any other way, i only ask that you don't claim it as your work, and refer to my original post.