PHP Code:
#RequireAdmin
#include <GUIConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Const $select1 = "Resolution"
Const $select2 = "Server"
Const $select3 = "Channel"
$Auto = GUICreate("Auto-Login by mipez ver. 2.0", 571, 281, 193, 125)
GUISetFont(12, 400, 0, "Tahoma")
GUISetBkColor(0xC0DCC0)
$resolution = GUICtrlCreateCombo($select1, 16, 24, 153, 27)
GUICtrlSetData(-1, "1440x900")
$server = GUICtrlCreateCombo($select2, 193, 24, 153, 27)
GUICtrlSetData(-1,"English|German|French|Russian, Polish, Turkish|Spain, Italian, Portuguese")
$channel = GUICtrlCreateCombo($select3, 370, 24, 153, 27)
GUICtrlSetData(-1,"Rookie|Super Rookie|Pro|Free|Free 2|Free 3|Free 4")
$loadevery1 = GUICtrlCreateCheckbox("Want to load this every time?", 16, 68, 233, 17)
GUICtrlSetTip(-1 , "Not used yet")
$loadevery2 = GUICtrlCreateCheckbox("Want to load this every time?", 16, 195, 233, 17)
GUICtrlSetTip(-1 , "Not used yet")
$windowed = GUICtrlCreateCheckbox("Windowed", 16, 235, 105, 17)
GUICtrlSetTip(-1 , "Only if you use Window mode")
$news = GUICtrlCreateCheckbox("Click Announcement", 140, 235, 180, 17)
GUICtrlSetTip(-1 , "Only if you know that you haven't clicked it today")
$id = GUICtrlCreateInput("id", 16, 106, 153, 27)
$pw = GUICtrlCreateInput("pw", 193, 106, 153, 27)
$path = GUICtrlCreateInput("path", 16, 152, 329, 27)
$save1 = GUICtrlCreateButton("Save", 368, 106, 80, 27, 0)
$load1 = GUICtrlCreateButton("Load", 458, 106, 80, 27, 0)
$getpath = GUICtrlCreateButton("Get", 368, 152, 48, 27, 0)
$savepath = GUICtrlCreateButton("Save", 422, 152, 56, 27, 0)
$loadpath = GUICtrlCreateButton("Load", 482, 152, 56, 27, 0)
$start = GUICtrlCreateButton("Start", 336, 200, 193, 57, 0)
GUICtrlSetTip(-1 , "Starts S4 League and logs you in automatically")
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
GUIDelete()
Exit
Case $save1
save()
Case $load1
load()
Case $getpath
getpath()
Case $savepath
savepath()
Case $loadpath
loadpath()
Case $start
start()
EndSwitch
WEnd
Func save()
$write1 = GUICtrlRead($id)
IniWrite(@ScriptDir & "\config.ini", "ID", "ID", $write1)
$write2 = GUICtrlRead($pw)
IniWrite(@ScriptDir & "\config.ini", "PW", "PW", $write2)
EndFunc
Func load()
$read1 = IniRead("config.ini", "ID", "ID", "")
GUICtrlSetData($id, $read1)
$read2 = IniRead("config.ini", "PW", "PW", "")
GUICtrlSetData($pw, $read2)
EndFunc
Func getpath()
Global $i = 0
While True ; Get Path from S4 by using the software-installed information in registry
$i +=1
$keyname = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\", $i)
If @error Then ExitLoop
$result = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $keyname, "DisplayName")
If $result = "S4 League_EU" Then
$s4path = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $keyname, "InstallLocation")
ExitLoop
EndIf
WEnd
GUICtrlSetData( $path, $s4path)
EndFunc
Func savepath()
$write1 = GUICtrlRead($path)
IniWrite(@ScriptDir & "\config.ini", "Path", "Path", $write1)
EndFunc
Func loadpath()
$read1 = IniRead("config.ini", "Path", "Path", "")
GUICtrlSetData($path, $read1)
EndFunc
Func start()
$s4path = GUICtrlRead($path)
ShellExecute($s4path & "\patcher_s4.exe", "", $s4path)
WinWait("S4 League Game Launcher")
ControlClick("S4 League Game Launcher", "", "[CLASS:Button; INSTANCE:2]")
WinWait("S4 Client")
$get1 = GUICtrlRead($resolution)
$pixel1 = PixelSearch(720,418,721,419,0x3C4757)
If $get1 = "1440x900" Then
Do
$pixel1
Until $pixel1 = 1
MsgBox(0,"Found","Found")
EndIf
EndFunc