Voici une Source que j'ai trouvé sur un autre forum (me demandez pas lequel sinon je vous tue).
Screen :
Utilisez-le pour vous approprier quelque fonction que voue ne connaissez pas (pour certains)
Screen :
PHP:
#RequireAdmin
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
If Not FileExists(@scriptdir & "/S4Client.exe") Then
MsgBox(48, "Error", "Missing S4Client.exe!")
Exit
EndIf
$oIE = _IECreateEmbedded()
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("S4League Launcher", 288, 115, 376, 131)
GUICtrlCreateObj($oIE, 0, 0, 1, 1)
$Label1 = GUICtrlCreateLabel("Username:", 16, 16, 55, 17)
$Label2 = GUICtrlCreateLabel("Password:", 16, 48, 53, 17)
$fUsername = GUICtrlCreateInput("", 72, 16, 201, 21)
$fPassword = GUICtrlCreateInput("", 72, 48, 201, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$fLoginbutton = GUICtrlCreateButton("Login", 8, 80, 267, 25, $BS_DEFPUSHBUTTON)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
If FileExists(@scriptdir&"/logindata.ini") Then
GUICtrlSetData($fUsername, IniRead(@scriptdir&"/logindata.ini", "Logindata", "username", ""))
GUICtrlSetData($fPassword, IniRead(@scriptdir&"/logindata.ini", "Logindata", "password", ""))
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $fLoginbutton
LoginProcess(GUICtrlRead($fUsername), GUICtrlRead($fPassword))
EndSwitch
WEnd
Func LoginProcess($user, $pass)
IniWrite(@scriptdir&"/logindata.ini", "Logindata", "username", $user)
IniWrite(@scriptdir&"/logindata.ini", "Logindata", "password", $pass)
$sURL = "https://www.aeriagames.com/dialog/oauth?response_type=code&client_id=a354ab1d0894ba2ecaac12bf5ad86fd905373a07f&redirect_uri=https://www.aeriagames.com/content_only_launcher&theme=api_ignite"
_IENavigate($oIE, $sURL)
$oForm = _IEFormGetCollection($oIE, 0)
$oUsername = _IEFormElementGetObjByName($oForm, "edit[id]")
$oPassword = _IEFormElementGetObjByName($oForm, "edit[pass]")
_IEFormElementSetValue($oUsername, $user)
_IEFormElementSetValue($oPassword, $pass)
_IEFormSubmit($oForm, 0)
_IELoadWait($oIE)
If _IEPropertyGet($oIE, "innertext") == "." Then
$code = _IEPropertyGet($oIE, "locationurl")
$code = StringTrimLeft($code, StringInStr($code, "code=")+4)
Run('"S4Client.exe" -rc:eu -lac:ger -auth_server_ip:83.220.134.84 -aeria_acc_code:'&$code)
Exit
Else
MsgBox(48, "Error", "Wrong Username or Password!")
EndIf
EndFunc
Utilisez-le pour vous approprier quelque fonction que voue ne connaissez pas (pour certains)
Voici un Remember Login avec sa source évidemment.
PHP:
#RequireAdmin
#include <IE.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIListBox.au3>
#include <GUIConstants.au3>
Local $aLinks[1], $iInd, $aLinks[2]
$sHtml = FileRead('C:\s4.ini')
$log = 'C:\s4.ini'
$hGUI = GUICreate("Form1", 187, 197, 192, 124)
$Input1 = GUICtrlCreateInput("", 8, 80, 121, 21)
$Label1 = GUICtrlCreateLabel("Login", 136, 80, 30, 17)
$Input2 = GUICtrlCreateInput("", 8, 112, 121, 21)
$Label2 = GUICtrlCreateLabel("Password", 136, 112, 50, 17)
__SetPasswordChar($hGUI,GUICtrlGetHandle($Input2),-1,9679)
$Input3 = GUICtrlCreateInput("", 8, 48, 121, 21)
$Label3 = GUICtrlCreateLabel("Inform", 136, 48, 33, 17)
$Checkbox1 = GUICtrlCreateCheckbox("Password", 8, 144, 97, 17)
$iCombo = GUICtrlCreateCombo("", 8, 8, 145, 25)
$Add = GUICtrlCreateButton("ADD",8, 168, 75, 25)
$vTmp = StringRegExp($sHtml, '<div class=><h1><a href=(.*?)>(.*?)</a>(.*?)</h1>', 3)
ReDim $aLinks[UBound($vTmp) / 3][3]
For $i = 0 To UBound($vTmp) - 1 Step 3
$aLinks[$iInd][0] = $vTmp[$i]
$aLinks[$iInd][1] = $vTmp[$i + 1]
$aLinks[$iInd][2] = $vTmp[$i + 2]
GUICtrlSetData($iCombo, $aLinks[$iInd][1], $aLinks[$iInd][1])
$iInd += 1
Next
$vTmp = UBound($aLinks) - 1
$iInd = 0
GUISetState(@SW_SHOW, $hGUI)
#EndRegion ### END Koda GUI section ###
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $Checkbox1
If BitAND(GUICtrlRead($Checkbox1),$gui_checked)=$gui_checked Then
__SetPasswordChar($hGUI,GUICtrlGetHandle($Input2),-1,0)
ElseIf BitAND(GUICtrlRead($Checkbox1),$gui_unchecked)=$gui_unchecked Then
__SetPasswordChar($hGUI,GUICtrlGetHandle($Input2),-1,9679)
EndIf
Case $iCombo
$iInd = GUICtrlSendMsg($iCombo, $CB_GETCURSEL, 0, 0)
Switch $iInd
Case 0 To $vTmp
$Login = $aLinks[$iInd][1]
$Pass = $aLinks[$iInd][0]
GUICtrlSetData($Input1, $aLinks[$iInd][1])
GUICtrlSetData($Input2, $aLinks[$iInd][0])
GUICtrlSetData($Input3, $aLinks[$iInd][2])
If Not IsDeclared("iMsgBoxAnswer") Then Dim $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox(0x4,"S4 Client"," Run S4 Client?" & @CRLF)
Select
Case $iMsgBoxAnswer = 6;Yes
start()
Case $iMsgBoxAnswer = 7;No
EndSelect
Case Else
MsgBox(16, 'Error', 'Error')
EndSwitch
Case $Add
add()
EndSwitch
WEnd
Func add()
$hForm2 = GUICreate("Form2", 220, 135, -1, -1)
$nLogin2 = GUICtrlCreateInput("Login", 10, 10)
$nPass2 = GUICtrlCreateInput("Pass", 10, 40,0,0, $ES_PASSWORD)
$nInfo = GUICtrlCreateInput("Inform", 10, 70)
$nAdd = GUICtrlCreateButton("Add", 10, 100, 200, 25)
GUISetState()
While 1
Switch GUIGetMsg()
Case $nAdd
FileWrite($log,@CRLF & "<div class=><h1><a href=" & GUICtrlRead($nPass2) & ">" & GUICtrlRead($nLogin2) & "</a>" & GUICtrlRead($nInfo) & "</h1>")
$sHtml = FileRead('C:\s4.ini')
$vTmp = StringRegExp($sHtml, '<div class=><h1><a href=(.*?)>(.*?)</a>(.*?)</h1>', 3)
ReDim $aLinks[UBound($vTmp) / 3][3]
For $i = 0 To UBound($vTmp) - 1 Step 3
$aLinks[$iInd][0] = $vTmp[$i]
$aLinks[$iInd][1] = $vTmp[$i + 1]
$aLinks[$iInd][2] = $vTmp[$i + 2]
GUICtrlSetData($iCombo, $aLinks[$iInd][1], $aLinks[$iInd][1])
$iInd += 1
Next
$vTmp = UBound($aLinks) - 1
$iInd = 0
Case -3
ExitLoop
EndSwitch
WEnd
GUIDelete($hForm2)
EndFunc
Func start()
$oIE = _IECreate ("https://www.aeriagames.com/dialog/oauth?response_type=code&client_id=a354ab1d0894ba2ecaac12bf5ad86fd905373a07f&state=36424314&redirect_uri=https://www.aeriagames.com/content_only_launcher&theme=api_ignite")
$oForm = _IEFormGetCollection($oIE,0)
$oLogin = _IEFormElementGetObjByName($oForm,"edit[id]")
$oPass = _IEFormElementGetObjByName($oForm,"edit[pass]")
_IEFormElementSetValue($oLogin,$Login)
_IEFormElementSetValue($oPass,$Pass)
_IEFormSubmit($oForm)
$sUrl = _IEPropertyGet( $oIE, "locationurl" )
$str=StringRegExpReplace($sUrl,'.*code=','\1')
run("S4Client.exe -rc:eu -lac:ger -auth_server_ip:83.220.134.84 -aeria_acc_code:" & $str)
ProcessClose("iexplore.exe")
EndFunc
Func __SetPasswordChar($hWnd,$hCtrl,$iToggleState,$sPassChar)
If Not IsHWnd($hWnd) Then
$hWnd = WinGetHandle($hWnd)
EndIf
If Not IsHWnd($hCtrl) Then
$hCtrl = ControlGetHandle($hWnd, "", $hCtrl)
EndIf
Local Const $EM_SETPASSWORDCHAR = 0xCC
Local Const $EM_GETPASSWORDCHAR = 0xD2
Local $iGet_Pass_Char, $iSet_Pass_Char, $iDef_Pass_Char = 9679
Local $aRet = DllCall("user32.dll", "long", "SendMessageW", "hwnd", $hCtrl, "int", $EM_GETPASSWORDCHAR, "int", 0, "int", 0)
If Not @error And $aRet[0] Then
$iGet_Pass_Char = $aRet[0]
EndIf
If $sPassChar = -1 Then
$iSet_Pass_Char = $iGet_Pass_Char
Else
If StringLen($sPassChar) = 1 And IsString($sPassChar) Then
$iSet_Pass_Char = Asc($sPassChar)
Else
$iSet_Pass_Char = Number($sPassChar)
EndIf
$iDef_Pass_Char = $iSet_Pass_Char
EndIf
If $iToggleState = -1 Then
If $iGet_Pass_Char <> 0 Then
$iSet_Pass_Char = 0
Else
$iSet_Pass_Char = $iDef_Pass_Char
EndIf
ElseIf $iToggleState = 0 Then
$iSet_Pass_Char = 0
ElseIf $iToggleState = 1 Then
$iSet_Pass_Char = $iDef_Pass_Char
EndIf
DllCall("user32.dll", "none", "SendMessageW", "hwnd", $hCtrl, "int", $EM_SETPASSWORDCHAR, "int", $iSet_Pass_Char, "int", 0)
DllCall("user32.dll", "none", "InvalidateRect", "hwnd", $hCtrl, "ptr", 0, "int", 1)
EndFunc
Last edited: