Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;===========================================
- #NoEnv
- #SingleInstance Force
- DetectHiddenWindows, On
- SetWorkingDir %A_ScriptDir%
- ;===========================================
- IEVisible := True
- LoadWait = 30
- MaxTries = 3
- Email = %1%
- Pass = %2%
- Name = %3%
- User = %4%
- /*
- Email := ""
- Pass := ""
- Name := ""
- User := ""
- */
- ;===========================================
- FileDelete, Result.txt
- OnExit, Exit
- GoSub, LoadIE
- Loop
- {
- If Failed
- {
- Errors++
- If Errors > %MaxTries%
- ExitApp
- Sleep, 5000
- }
- Failed := False
- GoSub, ClearIE
- GoSub, LoadGoogle
- If Failed
- Continue
- GoSub, LoadTwitter
- If Failed
- Continue
- GoSub, CreateTwitter
- If Failed
- Continue
- Break
- }
- FileAppend, Account Created, Result.txt
- ExitApp
- ;===========================================
- LoadTwitter:
- ;================
- Url := "https://twitter.com/signup"
- wb := CheckBrowser(wb)
- wb.Navigate(Url)
- Sleep, 2000
- Wait := (LoadWait * 2)
- Loop
- {
- wb := CheckBrowser(wb)
- If A_Index > %Wait%
- {
- Failed := True
- Return
- }
- Sleep, 500
- If ((wb.ReadyState = 4 && !wb.Busy) || A_Index > 45)
- {
- html := wb.document.body.innerHTML
- If html =
- html := wb.document.innerHTML
- IfInString, html, <title>This page can
- {
- Failed := True
- Return
- }
- IfInString, html, >This page can
- {
- IfInString, html, be displayed</div>
- {
- Failed := True
- Return
- }
- }
- IfInString, html, Twitter
- Break
- }
- }
- Sleep, 1500
- Return
- ;===========================================
- CreateTwitter:
- ;================
- ; full-name
- ; email
- ; password
- ; submit_button
- ; Enter your phone
- wb := CheckBrowser(wb)
- wb.document.getElementById("full-name").value := Name
- wb.document.getElementById("email").value := Email
- wb.document.getElementById("password").value := Pass
- Sleep, 500
- wb.document.getElementById("submit_button").click()
- Sleep, 5000
- wb.document.getElementById("submit_button").click()
- Sleep, 2000
- Wait := (LoadWait * 2)
- Loop
- {
- wb := CheckBrowser(wb)
- If A_Index > %Wait%
- {
- Failed := True
- Return
- }
- Sleep, 500
- If ((wb.ReadyState = 4 && !wb.Busy) || A_Index > 45)
- {
- html := wb.document.body.innerHTML
- If html =
- html := wb.document.innerHTML
- IfInString, html, <title>This page can
- {
- Failed := True
- Return
- }
- IfInString, html, >This page can
- {
- IfInString, html, be displayed</div>
- {
- Failed := True
- Return
- }
- }
- IfInString, html, Enter your phone
- Break
- }
- }
- Sleep, 500
- ; https://twitter.com/account/add_username
- ; Choose a username
- Url := "https://twitter.com/account/add_username"
- wb := CheckBrowser(wb)
- wb.Navigate(Url)
- Sleep, 2000
- Wait := (LoadWait * 2)
- Loop
- {
- wb := CheckBrowser(wb)
- If A_Index > %Wait%
- {
- Failed := True
- Return
- }
- Sleep, 500
- If ((wb.ReadyState = 4 && !wb.Busy) || A_Index > 45)
- {
- html := wb.document.body.innerHTML
- If html =
- html := wb.document.innerHTML
- IfInString, html, <title>This page can
- {
- Failed := True
- Return
- }
- IfInString, html, >This page can
- {
- IfInString, html, be displayed</div>
- {
- Failed := True
- Return
- }
- }
- IfInString, html, Choose a username
- Break
- }
- }
- Sleep, 500
- ; username
- ; submit_button
- ; We’re glad you’re here
- wb := CheckBrowser(wb)
- wb.document.getElementById("username").value := User
- Sleep, 500
- wb.document.getElementById("submit_button").Click()
- Sleep, 5000
- wb.document.getElementById("submit_button").Click()
- Wait := (LoadWait * 2)
- Loop
- {
- wb := CheckBrowser(wb)
- If A_Index > %Wait%
- {
- Failed := True
- Return
- }
- Sleep, 500
- If ((wb.ReadyState = 4 && !wb.Busy) || A_Index > 45)
- {
- html := wb.document.body.innerHTML
- If html =
- html := wb.document.innerHTML
- IfInString, html, <title>This page can
- {
- Failed := True
- Return
- }
- IfInString, html, >This page can
- {
- IfInString, html, be displayed</div>
- {
- Failed := True
- Return
- }
- }
- IfInString, html, We’re glad you’re here
- Break
- }
- }
- Sleep, 500
- ; https://twitter.com/i/start/interests
- ; What are you interested in
- Url := "https://twitter.com/i/start/interests"
- wb := CheckBrowser(wb)
- wb.Navigate(Url)
- Sleep, 2000
- Wait := (LoadWait * 2)
- Loop
- {
- wb := CheckBrowser(wb)
- If A_Index > %Wait%
- {
- Failed := True
- Return
- }
- Sleep, 500
- If ((wb.ReadyState = 4 && !wb.Busy) || A_Index > 45)
- {
- html := wb.document.body.innerHTML
- If html =
- html := wb.document.innerHTML
- IfInString, html, <title>This page can
- {
- Failed := True
- Return
- }
- IfInString, html, >This page can
- {
- IfInString, html, be displayed</div>
- {
- Failed := True
- Return
- }
- }
- IfInString, html, What are you interested in
- Break
- }
- }
- Sleep, 500
- ; button class EdgeButton EdgeButton--primary js-continue
- ; Want to find friends and see who they follow
- wb := CheckBrowser(wb)
- wb.document.getElementsByClassName("EdgeButton EdgeButton--primary js-continue")[0].Click()
- Sleep, 2000
- Wait := (LoadWait * 2)
- Loop
- {
- wb := CheckBrowser(wb)
- If A_Index > %Wait%
- {
- Failed := True
- Return
- }
- Sleep, 500
- If ((wb.ReadyState = 4 && !wb.Busy) || A_Index > 45)
- {
- html := wb.document.body.innerHTML
- If html =
- html := wb.document.innerHTML
- IfInString, html, <title>This page can
- {
- Failed := True
- Return
- }
- IfInString, html, >This page can
- {
- IfInString, html, be displayed</div>
- {
- Failed := True
- Return
- }
- }
- IfInString, html, Want to find friends and see who they follow
- Break
- }
- }
- Sleep, 500
- ; https://twitter.com/i/start/choose
- ; Make your timeline yours
- Url := "https://twitter.com/i/start/choose"
- wb := CheckBrowser(wb)
- wb.Navigate(Url)
- Sleep, 2000
- Wait := (LoadWait * 2)
- Loop
- {
- wb := CheckBrowser(wb)
- If A_Index > %Wait%
- {
- Failed := True
- Return
- }
- Sleep, 500
- If ((wb.ReadyState = 4 && !wb.Busy) || A_Index > 45)
- {
- html := wb.document.body.innerHTML
- If html =
- html := wb.document.innerHTML
- IfInString, html, <title>This page can
- {
- Failed := True
- Return
- }
- IfInString, html, >This page can
- {
- IfInString, html, be displayed</div>
- {
- Failed := True
- Return
- }
- }
- IfInString, html, Make your timeline yours
- Break
- }
- }
- Sleep, 500
- ; button class EdgeButton EdgeButton--primary btn-follow-all
- ; UIWalkthrough-skip
- wb := CheckBrowser(wb)
- wb.document.getElementsByClassName("EdgeButton EdgeButton--primary btn-follow-all")[0].Click()
- Sleep, 2000
- Wait := (LoadWait * 2)
- Loop
- {
- wb := CheckBrowser(wb)
- If A_Index > %Wait%
- {
- Failed := True
- Return
- }
- Sleep, 500
- If ((wb.ReadyState = 4 && !wb.Busy) || A_Index > 45)
- {
- html := wb.document.body.innerHTML
- If html =
- html := wb.document.innerHTML
- IfInString, html, <title>This page can
- {
- Failed := True
- Return
- }
- IfInString, html, >This page can
- {
- IfInString, html, be displayed</div>
- {
- Failed := True
- Return
- }
- }
- IfInString, html, UIWalkthrough-skip
- Break
- }
- }
- Sleep, 500
- ; button class UIWalkthrough-skip js-close
- ; Welcome to Twitter
- wb := CheckBrowser(wb)
- wb.document.getElementsByClassName("UIWalkthrough-skip js-close")[0].Click()
- Sleep, 2000
- Wait := (LoadWait * 2)
- Loop
- {
- wb := CheckBrowser(wb)
- If A_Index > %Wait%
- {
- Failed := True
- Return
- }
- Sleep, 500
- If ((wb.ReadyState = 4 && !wb.Busy) || A_Index > 45)
- {
- html := wb.document.body.innerHTML
- If html =
- html := wb.document.innerHTML
- IfInString, html, <title>This page can
- {
- Failed := True
- Return
- }
- IfInString, html, >This page can
- {
- IfInString, html, be displayed</div>
- {
- Failed := True
- Return
- }
- }
- IfInString, html, Welcome to Twitter
- Break
- }
- }
- Sleep, 500
- Return
- ;===========================================
- Logout:
- ;================
- ; https://twitter.com/logout
- ; Log out of Twitter
- ; button class EdgeButton EdgeButton--primary js-submit
- ; >Log in<
- Return
- ;===========================================
- LoadIE:
- ;================
- SB_SetText(" Loading IE")
- ComObjError(False)
- wb := ComObjCreate("InternetExplorer.Application")
- wb.Visible := False
- If !IEVisible
- {
- WinSet, Transparent, 0, ahk_id %IEId%
- Sleep, 300
- }
- wb.Visible := True
- WinGet, IEId, ID, Internet Explorer_Server1
- If IEId =
- WinGet, IEId, ID, ahk_class IEFrame
- If IEId =
- WinGet, IEId, ID, ahk_class TabWindowClass1
- If IEId =
- WinGet, IEId, ID, Internet Explorer
- ;Msgbox, % IEId
- If IEId =
- {
- Msgbox, 64, %App%, Failed to load Internet Explorer...
- ExitApp
- }
- Return
- ;===========================================
- ClearIE:
- ;================
- iCmd = 255
- VarSetCapacity(wCmd, 15, 0)
- DllCall("MultiByteToWideChar", "Uint", 0, "Uint", 0, "str", iCmd, "int", -1, "str", wCmd, "int", 8)
- DllCall("inetcpl.cpl\ClearMyTracksByProcessW", "Uint", 0, "Uint", 0, "str", wCmd, "int", 0)
- Sleep, 1000
- Return
- ;===========================================
- LoadGoogle:
- ;================
- Url := "https://www.google.com"
- wb := CheckBrowser(wb)
- wb.Navigate(Url)
- Sleep, 2000
- Wait := (LoadWait * 2)
- Loop
- {
- wb := CheckBrowser(wb)
- If A_Index > %Wait%
- {
- Failed := True
- Return
- }
- Sleep, 500
- If ((wb.ReadyState = 4 && !wb.Busy) || A_Index > 45)
- {
- html := wb.document.body.innerHTML
- If html =
- html := wb.document.innerHTML
- IfInString, html, <title>This page can
- {
- Failed := True
- Return
- }
- IfInString, html, >This page can
- {
- IfInString, html, be displayed</div>
- {
- Failed := True
- Return
- }
- }
- IfInString, html, Google
- Break
- }
- }
- Sleep, 500
- Return
- ;===========================================
- ReloadIE:
- ;================
- wb := CheckBrowser(wb)
- wb.Quit()
- GoSub, LoadIE
- Sleep, 2000
- Return
- ;===========================================
- Exit:
- ;================
- wb := CheckBrowser(wb)
- If IEId !=
- wb.Quit()
- ExitApp
- ;===========================================
- CheckBrowser(wb)
- {
- Global IEId
- DetectHiddenWindows, On
- nwb := IEGet()
- If !nwb
- Return wb
- Else
- wb := nwb
- WinGet, IEId, ID, Internet Explorer_Server1
- If IEId =
- WinGet, IEId, ID, ahk_class IEFrame
- If IEId =
- WinGet, IEId, ID, ahk_class TabWindowClass1
- If IEId =
- WinGet, IEId, ID, Internet Explorer
- ;Msgbox, % IEId
- If IEId =
- {
- Msgbox, Failed to locate Internet Explorer...
- ExitApp
- }
- Return wb
- }
- ;===========================================
- IEGet(Name = "")
- {
- Global wbLoc
- Global wbName
- If Name !=
- {
- IfEqual, Name,, WinGetTitle, Name, ahk_class IEFrame
- Name := (Name = "New Tab - Windows Internet Explorer") ? "about:Tabs" : RegExReplace(Name, " - (Windows|Microsoft) Internet Explorer")
- }
- ;Msgbox % Name
- wbLoc =
- wbName =
- For npwb In ComObjCreate("Shell.Application").Windows
- {
- If Name !=
- {
- npwbLoc := npwb.LocationName
- IfNotInString, npwbLoc, %Name%
- {
- If (InStr(npwb.FullName, "iexplore.exe"))
- {
- pwb := npwb
- wbLoc := pwb.LocationName
- wbName := pwb.FullName
- }
- }
- }
- Else
- {
- If (InStr(npwb.FullName, "iexplore.exe"))
- {
- pwb := npwb
- wbLoc := pwb.LocationName
- wbName := pwb.FullName
- }
- }
- }
- If (wbLoc = "" || wbName = "")
- Return False
- Return pwb
- }
- ;===========================================
- IEInfo(Name = "")
- {
- IEInfo =
- For npwb In ComObjCreate("Shell.Application").Windows
- {
- LocName := npwb.LocationName
- FullName := npwb.FullName
- StringLower, LocName, LocName
- StringLower, FullName, FullName
- IfInString, FullName, iexplore.exe
- {
- If (Name = "")
- IEInfo .= LocName . "^"
- Else
- {
- IfInString, LocName, %Name%
- IEInfo .= LocName . "^"
- }
- }
- }
- StringRight, cc, IEInfo, 1
- If cc = ^
- StringTrimRight, IEInfo, IEInfo, 1
- Return IEInfo
- }
- ;===========================================
- IECount(Name = "")
- {
- IECount = 0
- For npwb In ComObjCreate("Shell.Application").Windows
- {
- LocName := npwb.LocationName
- FullName := npwb.FullName
- StringLower, LocName, LocName
- StringLower, FullName, FullName
- IfInString, FullName, iexplore.exe
- {
- If (Name = "")
- IECount++
- Else
- {
- IfInString, LocName, %Name%
- IECount++
- }
- ;Msgbox % FullName . "|" . LocName
- }
- }
- Return IECount
- }
- ;===========================================
- ProcessCount(ExeName)
- {
- ProCout = 0
- For Process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process")
- {
- ProName := Process.Name
- If ProName = %ExeName%
- ProCount++
- }
- Return ProCount
- }
- ;===========================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement