On trying to manipulate the embedded IE_server control, the document returned (_IEAttach)always had a null body, so it wasn't possible to do it more cleanly (for me)
this picture shows the order of clicks you need to calibrate for the script to work (note: this is a one off, data will be stored in a text file, also 8 is missing from this picture but is simply confirming the logout (ok button)
commented code follows:
edit: .exe follows in a few days quite busy atm, gonna sort a few things and compile when i got the time, (would like to think u all have the intelligence to run it from source in the meanwhile tho)Quote:
#include <Misc.au3>
;clicks needed to acheive task
Global Const $mouseClicks=7
;name/path of userdata file
Global Const $uDataFileName="UData.txt"
;name/path of mouse co-ordinate data file
Global Const $mouseDataFileName="scriptInfo.txt"
;in-memory mouse co-ordinate data
Global $positions[$mouseClicks+1][2]
;in-memory user data
Global $uData[20][2]
Global $calibrated=False
;run script by pressing f2
HotKeySet("{F2}","_openLootBox")
;run calibration by pressing f1
HotKeySet("{F1}","_calibrate")
__readUsernamesPasswords()
WinMove("Aeria Ignite","",0,0)
If (Not _fetchMousePositions()) Then
_calibrate()
EndIf
$calibrated=True
_writeMousePositions()
While 1
Sleep(100)
WEnd
;calibrate all the neccessary mouse clicks calling the helper function on each one
Func _calibrate()
$calibrate=False
_openIgnite()
Local $calCount=0;
while $calCount<=$mouseClicks+1
ToolTip("mouse over button"&$calCount&"and press alt",0,0)
;on alt press, run helper function
If (_IsPressed("12")And(Not $calibrated)) Then
__calibrate($calCount)
ElseIf ($calibrated==True) Then
ExitLoop
EndIf
sleep(100)
Wend
ToolTip("finished calibrating, press f2 to run the script",0,0)
EndFunc
;calibrate helper function To save 1 mouse click
Func __calibrate(ByRef $calCount)
If ($calibrated==False) Then
Local $temp=MouseGetPos()
$positions[$calCount][0]=$temp[0]
$positions[$calCount][1]=$temp[1]
$calCount=$calCount+1
EndIf
if $calCount==$mouseClicks+1 Then
$calibrated=True
EndIf
ConsoleWrite($positions[$calCount-1][0]&","&$positions[$calCount-1][1]&" ")
Sleep(1000)
EndFunc
;click all the relevant spots and input usernames and passwords
Func _openLootBox($user,$pass)
Local $i=0
While Not ($uData[$i][0]=="")
If $calibrated==True Then
ConsoleWrite("opening")
_openIgnite()
MouseClick("",$positions[0][0],$positions[0][1],1)
Sleep(1000)
MouseClick("",$positions[1][0],$positions[1][1],1)
Sleep(1000)
MouseClick("",$positions[2][0],$positions[2][1],1)
Sleep(1000)
Send($uData[$i][0])
Sleep(100)
Send("{TAB}")
Sleep(100)
Send($uData[$i][1])
sleep(500)
Send("{ENTER}")
Sleep(5000)
MouseClick("",$positions[3][0],$positions[3][1],1)
Sleep(5000)
MouseClick("",$positions[4][0],$positions[4][1],1)
Sleep(3000)
MouseClick("",$positions[5][0],$positions[5][1],1)
Sleep(100)
MouseClick("",$positions[6][0],$positions[6][1],1)
Sleep(500)
MouseClick("",$positions[7][0],$positions[7][1],1)
EndIf
$i=$i+1
WEnd
EndFunc
;write mouse positions to file
Func _writeMousePositions()
$oFile=FileOpen($mouseDataFileName,2)
If $oFile = -1 Then
ConsoleWrite("Error", "Unable to open file.")
EndIf
for $i=0 to $mouseClicks Step 1
FileWriteLine($oFile,$positions[$i][0]&","&$positions[$i][1])
Next
FileClose($oFile)
EndFunc
;attempts to fetch mouse positions
;
;@return boolean value defining successful retrieval of mouse calibrated points
Func _fetchMousePositions()
$oFile=FileOpen($mouseDataFileName,0)
if $oFile=-1 Then
ConsoleWrite("failed to open")
Return False
EndIf
for $i=0 to $mouseClicks Step 1
$line=FileReadLine($oFile,$i+1)
if (@error Or $line==-1) Then
ConsoleWrite("failed to read line"&$i)
Return False
EndIf
Local $temp=StringSplit($line,",")
ConsoleWrite($temp[1]&","&$temp[2]&" ")
if UBound($temp)<2 Then
;less than 2 fields stored so entry is flawed
ConsoleWrite("ubound at"&$i&" = "&UBound($temp))
Return False
Else
$positions[$i][0]=$temp[1]
$positions[$i][1]=$temp[2]
EndIf
Next
return True
EndFunc
;open the aeria ignite program
Func _openIgnite()
if Not WinActive("Aeria Ignite") Then
if WinExists("Aeria Ignite") Then
WinClose("Aeria Ignite")
WinWaitClose("Aeria Ignite")
EndIf
Run("C:\Program Files\Aeria Games\Ignite\aeriaignite.exe")
WinWaitActive("Aeria Ignite")
EndIf
WinMove("Aeria Ignite","",0,0)
EndFunc
;read in usernames and passwords from the text file(seperate from the mouse calibrations File
Func __readUsernamesPasswords()
$oFile=FileOpen($uDataFileName,0)
if $oFile=-1 Then
ConsoleWrite("failed to open")
Return False
EndIf
Local $i=0
Local $line=FileReadLine($oFile,1)
While Not ($line==-1 Or @error)
Local $temp=StringSplit($line,",")
if UBound($temp)<2 Then
;less than 2 fields stored so entry is flawed
ConsoleWrite("ubound at"&$i&" = "&UBound($temp))
Return False
Else
$uData[$i][0]=$temp[1]
$uData[$i][1]=$temp[2]
EndIf
$i=$i+1
$line=FileReadLine($oFile,$i)
WEnd
EndFunc
also, ty for the thanks, this is my first contribution and it means a lot
edit2: escape special chars in passwords with {}







