Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;If you are not familiar with AutoIT scripts it is best to
- ;run this in the SciTE editor by pressing F5
- ; There is some debugging information in the console section
- ;This script is very coarse and relies on a lot of timers that may vary depending on the speed of the PC (how fast it loads Warframe)
- ;I have no idea what DE's stance on this sort of thing is.
- ;The following variable is the vertical distance from the top of the screen to the username input box
- ;I suspect it should be a percentage as this would allow scaling for different resolutions
- ;On a 1440p monitor the username input is ~350p from the bottom of the screen
- ;~ $y = @DeskTopHeight - 350 ;1440p, or approx 76% from the top
- $y = @DeskTopHeight * 0.76 ;this % based scaling is untested
- If $CmdLine[0] == 4 Then
- ; This hasn't been tested
- $sUsername = $CmdLine[1]
- $sPassword = $CmdLine[2]
- $sWarframePath = $CmdLine[3]
- $iLoadDelay = $CmdLine[4]
- Else
- $sConfigfile = @ScriptDir & "\config.ini"
- ;~ Config file is in the same location as the script and is formated in the following way
- ;~ [options]
- ;~ username=username
- ;~ password=password
- ;~ path=C:\path\to\launcher.exe
- ;~ loaddelay=30
- ;Path can also be specified with this
- ;~ path =C:\path\to\steam.exe -applaunch 230410
- ;Loaddelay is a value in seconds that depends on the PC it is running on.
- ;It is the duration between the launcher closing and Warframe reaching the login prompt
- ;For reliability you should overestimate this value
- $sUsername = IniRead($sConfigfile, "options", "username", "" )
- $sPassword = IniRead($sConfigfile, "options", "password", "" )
- $sWarframePath = IniRead($sConfigfile, "options", "path", "" )
- $iLoadDelay = IniRead($sConfigfile, "options", "loaddelay", "" )
- EndIf
- If $sUsername == "" OR $sPassword == "" OR $sWarframePath == "" OR $iLoadDelay == "" Then
- MsgBox(0,"", "Options not set")
- exit
- EndIf
- Launcher()
- Login()
- Func Launcher()
- ;Start Warframe
- run($sWarframePath)
- ;Wait for launcher
- WinWait("Warframe","", 30)
- Sleep(2000)
- $hWarframe = WinGetHandle("Warframe")
- ConsoleWrite("Warframe Launcher found, Window ID: " & $hWarframe & @CRLF)
- ;Give the launcher focus
- WinActivate ($hWarframe)
- ;Get Launchers position
- $aLauncher = WinGetPos ($hWarframe)
- Opt("WinDetectHiddenText", 1)
- ;Check for updates
- ConsoleWrite("Checking for updates" & @CRLF)
- While(StringInStr(WinGetText($hWarframe), "CHECKING FOR UPDATES..."))
- Sleep(1000)
- WEnd
- ConsoleWrite("Checking for content" & @CRLF)
- While(StringInStr(WinGetText($hWarframe), "Checking for new content..."))
- Sleep(1000)
- WEnd
- If Not StringInStr(WinGetText($hWarframe), "Warframe is up to date!") Then
- ;Download updates
- ConsoleWrite("Downloading Updates" & @CRLF)
- Do
- Sleep(1000)
- Until(StringInStr(WinGetText($hWarframe), "Warframe is up to date!"))
- EndIf
- ConsoleWrite("Warframe is upto date" & @CRLF)
- ;Attempt to press 'Play' by offsetting our mouse click based on Launchers position
- MouseClick("primary", $aLauncher[0] + 755, $aLauncher[1] + 590, 1, 0)
- ConsoleWrite("Warframe is starting" & @CRLF)
- EndFunc
- Func Login()
- ;~ Sleep(1000)
- ;Wait for it to open
- WinWait("WARFRAME","", 30)
- ConsoleWrite("Waiting to load" & @CRLF)
- ;Wait for it to load
- sleep($iLoadDelay * 1000)
- ;Give Warframe focus
- WinActivate ("WARFRAME")
- ConsoleWrite("Attempting login" & @CRLF)
- ;Click in the username field
- MouseClick ("primary", @DeskTopWidth/2, $y, 2, 0)
- ;Empty the field
- send("{END}{BS 50}")
- ;Type in the username
- send($sUsername)
- ;Move to password field
- send("{TAB}")
- ;Empty the field
- send("{BS 50}")
- ;Type in the password
- send($sPassword)
- ;Login
- send("{ENTER}")
- ;Collect daily reward
- ;But wait a bit for it to login
- sleep(10000)
- ConsoleWrite("Attempting reward claim" & @CRLF)
- MouseClick ("primary", @DeskTopWidth/2, @DeskTopHeight/2, 2, 0)
- ;Let it catch it's breath
- sleep(3000)
- ;exit Warframe
- ConsoleWrite("Exiting" & @CRLF)
- $hWarframe = (WinList("WARFRAME"))[1][1]
- WinClose($hWarframe)
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement