PHP Code:
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.4.0
Author: mipez
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
#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|Spanish, Italian, Portuguese")
$channel = GUICtrlCreateCombo($select3, 370, 24, 153, 27)
GUICtrlSetData(-1,"Rookie|Super Rookie|Pro|Free|Free 2|Free 3|Free 4")
$news = GUICtrlCreateCheckbox("Click Announcement", 16, 68, 200, 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", 200, 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
$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)
$get2 = GUICtrlRead($server)
$get3 = GUICtrlRead($channel)
$get4 = GUICtrlRead($news)
If $get1 = "1440x900" Then
Do
$pixel=PixelSearch(674,442,676,444,0x3C4757)
Until Isarray($pixel)
If Isarray($pixel) Then
Send(GUICtrlRead($id) & "{TAB}" & GUICtrlRead($pw) & "{ENTER}")
ElseIf Isarray($pixel)=0 Then
MsgBox(0,"Couldn't log in", "Couldn't log in")
EndIf
EndIf
Sleep(1000)
Do
$pixel2=PixelSearch(351,249,431,532,0xFFFFFF, 5)
Until IsArray($pixel2)
If IsArray($pixel2) Then
If $get2 = "German" Then
MouseClick(360, 346)
ElseIf $get2 = "English" Then
MouseClick(400, 293)
ElseIf $get2 = "French" Then
MouseClick(400, 402)
ElseIf $get2 = "Russian, Polish, Turkish" Then
MouseClick(400, 459)
ElseIf $get2 = "Spanish, Italian, Portuguese" Then
MouseClick(400, 513)
EndIf
ElseIf Isarray($pixel2)=0 Then
MsgBox(0,"Couldn't log in", "Couldn't log in")
EndIf
EndFunc