Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.91 KB | None | 0 0
  1.  
  2. ;CHANGE THESE VALUES ONLY
  3.  
  4.    $sUsername = "username@address.com"
  5.    $sPassword = "p@ssw0rd"
  6.  
  7.    $sWarframePath = "C:\path\to\launcher.exe"
  8.  
  9.    $iLoadDelay = 30
  10.    ;Loaddelay is a value in seconds that depends on the PC it is running on.
  11.    ;It is the duration between the launcher closing and Warframe reaching the login prompt
  12.    ;For reliability you should overestimate this value
  13.  
  14.  
  15. ;DON'T TOUCH BELOW HERE
  16.  
  17.  
  18. Launcher()
  19. Login()
  20.  
  21. Func Launcher()
  22.    ;Start Warframe
  23.    run($sWarframePath)
  24.  
  25.    ;Wait for launcher
  26.    WinWait("Warframe","", 30)
  27.    Sleep(2000)
  28.    $hWarframe = WinGetHandle("Warframe")
  29.    ConsoleWrite("Warframe Launcher found, Window ID: " & $hWarframe & @CRLF)
  30.    ;Give the launcher focus
  31.    WinActivate ($hWarframe)
  32.  
  33.    ;Get Launchers position
  34.    $aLauncher = WinGetPos ($hWarframe)
  35.  
  36.    Opt("WinDetectHiddenText", 1)
  37.  
  38.    ;Check for updates
  39.    ConsoleWrite("Checking for updates" & @CRLF)
  40.    While(StringInStr(WinGetText($hWarframe), "CHECKING FOR UPDATES..."))
  41.       Sleep(1000)
  42.    WEnd
  43.  
  44.    ConsoleWrite("Checking for content" & @CRLF)
  45.    While(StringInStr(WinGetText($hWarframe), "Checking for new content..."))
  46.       Sleep(1000)
  47.    WEnd
  48.  
  49.    If Not StringInStr(WinGetText($hWarframe), "Warframe is up to date!") Then
  50.       ;Download updates
  51.       ConsoleWrite("Downloading Updates" & @CRLF)
  52.       Do
  53.          Sleep(1000)
  54.       Until(StringInStr(WinGetText($hWarframe), "Warframe is up to date!"))
  55.    EndIf
  56.    ConsoleWrite("Warframe is upto date" & @CRLF)
  57.  
  58.    ;Attempt to press 'Play' by offsetting our mouse click based on Launchers position
  59.    MouseClick("primary", $aLauncher[0] + 755, $aLauncher[1] + 590, 1, 0)
  60.    ConsoleWrite("Warframe is starting" & @CRLF)
  61. EndFunc
  62.  
  63.  
  64.  
  65. Func Login()
  66. ;~    Sleep(1000)
  67.  
  68.    ;Wait for it to open
  69.    WinWait("WARFRAME","", 30)
  70.    ConsoleWrite("Waiting to load" & @CRLF)
  71.    ;Wait for it to load
  72.    sleep($iLoadDelay * 1000)
  73.  
  74.    ;Give Warframe focus
  75.    WinActivate ("WARFRAME")
  76.    ConsoleWrite("Attempting login" & @CRLF)
  77.    ;Click in the username field
  78.  
  79.    ;The following variable is the vertical distance from the top of the screen to the username input box
  80.    ;Assumes that Warframe is fullscreen
  81.    $y = @DeskTopHeight * 0.76 ;this % based scaling is untested
  82.  
  83.  
  84.    MouseClick ("primary", @DeskTopWidth/2, $y, 2, 0)
  85.    ;Empty the field
  86.    send("{END}{BS 50}")
  87.    ;Type in the username
  88.    send($sUsername)
  89.  
  90.    ;Move to password field
  91.    send("{TAB}")
  92.    ;Empty the field
  93.    send("{BS 50}")
  94.    ;Type in the password
  95.    send($sPassword)
  96.  
  97.    ;Login
  98.    send("{ENTER}")
  99.  
  100.    ;Collect daily reward
  101.    ;But wait a bit for it to login
  102.    sleep(10000)
  103.    ConsoleWrite("Attempting reward claim" & @CRLF)
  104.    MouseClick ("primary", @DeskTopWidth/2, @DeskTopHeight/2, 2, 0)
  105.  
  106.    ;Let it catch it's breath
  107.    sleep(3000)
  108.    ;exit Warframe
  109.    ConsoleWrite("Exiting" & @CRLF)
  110.    $hWarframe = (WinList("WARFRAME"))[1][1]
  111.    WinClose($hWarframe)
  112. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement