Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;CHANGE THESE VALUES ONLY
- $sUsername = "username@address.com"
- $sPassword = "p@ssw0rd"
- $sWarframePath = "C:\path\to\launcher.exe"
- $iLoadDelay = 30
- ;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
- ;DON'T TOUCH BELOW HERE
- 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
- ;The following variable is the vertical distance from the top of the screen to the username input box
- ;Assumes that Warframe is fullscreen
- $y = @DeskTopHeight * 0.76 ;this % based scaling is untested
- 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