I am doing an automatic login that skips the launcher of a game.
I would connect to the login page, after sending the data I would take the code that it gives me and automatically execute the application with the received code
I have some problems because when loading the page sometimes the Stackpath "protection from online attacks" jumps and then my application crashes .. lol !!
sometimes it jumps after logging in just before being able to grab the code ... and also crashes haha
When the page doesn't load it sometimes hangs anyway
Some Pics:
could you help me improve my code? If you can give me some advice I would appreciate it
Code:
Case $btn_login
$usr = GUICtrlRead($btn_user)
if StringLen(StringStripWS($usr,3)) = 0 Then
MsgBox("","","ERROR")
Else
$index =_GUICtrlComboBox_GetCurSel($btn_user)
_Login()
_GetGame()
EndIf
Code:
Func _Login()
Local $User = GUICtrlRead($btn_user), $Pass = $var[$index+1][1]
$oIE = _IECreate ("https://test.com/dialog/oauth?response_type=code&client_id=0ad0734dc5df644018b5fbfc8265ec6c05bb218dc&state=xyz&lang=es&Scope=scope_general%2Cscope_billing&fbclid=IwAR09eHfj34Dd128WnaGCN1I1aOwe7Yk8ZpCIEITBldBO_nprm4bH48qkCkU")
if Not @error Then
Local $username = _IEGetObjByName ($oIE, "edit[id]")
Local $password = _IEGetObjByName ($oIE, "edit[pass]")
Local $button = _IEGetObjByName ($oIE, "op")
_IEFormElementSetValue ($username, $User)
_IEFormElementSetValue ($password, $Pass)
_IEAction ($button, "click")
_IELoadWait($oIE)
Sleep(500)
Global $addr = _IEPropertyGet ($oIE, "LocationURL")
If StringLeft($addr, 48) = "https://test.com/content_only_launcher" Then
_IEQuit($oIE)
Else
_IEQuit($oIE)
MsgBox("","","ERROR","")
EndIf
EndIf
EndFunc
Func _GetGame()
$addr = StringSplit(String($addr), "&?#")
$SID = ""
Local $i = 1
While $i < $addr[0] + 1
If StringLeft($addr[$i], 2) = "co" Then
$addr = StringSplit($addr[$i], "=")
If $addr[0] = 2 Then $SID = $addr[2]
ExitLoop
EndIf
$i = $i + 1
WEnd
If $SID = "" Then
Return SetError(1, 0, 0)
Else
EndIf
$Exe = "game.exe"
local $Switch[2] =[("-a"),(" -p ")]
if $aMsg[0] = $btn_login Then
ShellExecute($Path & $Exe,$Switch[0] & $SID & $Switch[1],$Path)
EndIf
EndFunc
I must add that I do not know much about programming, little by little I have read some cases and add different codes and I have the login like this, first a small interface is executed, the account is selected and then the login code is executed that also reads the file account key
Pic
Code:
[Account]
Account=Pasword
I had also read about this other code for the login process on the page but I do not know if it is better than mine I suppose it is xD
Code:
#include <IE.au3>
Local $oUser, $oPass, $oSubmit
Local $sUser = "Account"
Local $sPass = "Password"
Local $url = "https://test.com/dialog/oauth?"
Local $oIE = _IECreate($url, 1)
_IELoadWait($oIE)
$oInputs = _IETagNameGetCollection($oIE, "input")
for $oInput in $oInputs
if $oInput.type = "text" And $oInput.name = "edit[id]" Then $oUser = $oInput
if $oInput.type = "password" And $oInput.name = "edit[pass]" Then $oPass = $oInput
if $oInput.type = "submit" And $oInput.value = "Iniciar sesión" Then $oSubmit = $oInput
if isObj($oUser) And isObj($oPass) And isObj($oSubmit) then exitloop
Next
$oUser.value = $sUser
$oPass.value = $sPass
_IEAction($oSubmit, "click")
_IELoadWait($oIE)
I still have to say that I wouldn't know how to do with the filters if you load the stackpath sooner or later and avoid crashes.