Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <MsgBoxConstants.au3>
- #include <File.au3>
- HotKeySet("{Esc}", "escape")
- ;initialise all the screen coordinate constants
- const $AGENTX = 1870
- const $AGENTY = 49
- const $MOBILEX = 1725
- const $MOBILEY = 130
- const $DESKTOPX = 1376
- const $DESKTOPY = 132
- const $NEUTRALX = 811
- const $NEUTRALY = 842
- const $SEARCHX = 249
- const $SEARCHY = 96
- ;create array for command line arguments
- Local $args[5]
- ;store all the parameters into variables
- if $CmdLine[0] > 0 And $CmdLine[1] <> "-" Then
- $args[0] = $CmdLine[1] * 1000
- Else ;
- $args[0] = StringLeft(@ScriptFullPath, StringLen(@ScriptFullPath) - 8) ;
- EndIf
- if $CmdLine[0] > 1 And $CmdLine[2] <> "-" Then
- $args[1] = $CmdLine[2] * 1000
- Else ;
- $args[1] = 10000 ;
- EndIf
- If $CmdLine[0] > 2 And $CmdLine[3] <> "-" Then
- $args[2] = $CmdLine[3] * 1000
- Else
- $args[2] = 20000
- EndIf
- If $CmdLine[0] > 3 And $CmdLine[4] <> "-" Then ;
- $args[3] = $CmdLine[4];
- Else ;
- $args[3] = 30 ;
- EndIf
- If $CmdLine[0] > 4 And $CmdLine[5] <> "-" Then ;
- $args[4] = $CmdLine[5] ;
- Else ;
- $args[4] = 20 ;
- EndIf
- ;assign the parameters to variables
- const $ADDRESS = $args[0]
- const $SEARCHES = String($ADDRESS) & "searches.txt"
- const $LINECOUNT = _FileCountLines($SEARCHES)
- const $LOADTIME = $args[1]
- Const $TIMEBETWEENSEARCH = $args[2]
- Const $DSKTPSRCH = $args[3]
- Const $MBLSRCH = $args[4]
- ;get to the search page
- Run("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
- sleep($LOADTIME)
- Send("^l")
- sleep(100)
- send("bing.com{space}{backspace}{enter}")
- sleep($LOADTIME)
- FileOpen($SEARCHES, 0)
- sendSearch()
- Send("{Enter}")
- FileClose($SEARCHES)
- Sleep($LOADTIME)
- If $DSKTPSRCH <> 0 Then
- FileOpen($SEARCHES, 0)
- makeSearch($DSKTPSRCH)
- EndIf
- FileClose($SEARCHES)
- MouseClick("left", $AGENTX, $AGENTY, 1, 0) ;switch to ;AGENT
- sleep(200); ;mobile mode
- MouseClick("left", $MOBILEX, $MOBILEY, 1, 0); ;MOBILE
- sleep(200);
- If $MBLSRCH <> 0 Then
- FileOpen($SEARCHES)
- makeSearch($MBLSRCH)
- EndIf
- FileClose($SEARCHES)
- MouseClick("left", $AGENTX, $AGENTY, 1, 0) ;switch to ;AGENT
- sleep(200); ;desktop mode
- MouseClick("left", $DESKTOPX, $DESKTOPY, 1, 0); ;DESKTOP
- sleep(200); ;
- MouseClick("left", $NEUTRALX, $NEUTRALY, 1, 0);close ;NEUTRAL
- sleep(200); ;chrome
- Send("^w"); ;
- Func makeSearch($times)
- For $i = 1 to $times
- MouseClick("left", $SEARCHX, $SEARCHY, 1, 0);click the searchbar ;SEARCH
- Send("^a")
- sendSearch()
- Send("{Enter}")
- sleep(2000)
- Send("{F5}")
- sleep($TIMEBETWEENSEARCH-2000)
- Next
- EndFunc
- Func sendSearch()
- $line = FileReadLine($SEARCHES, Round(Random(1, $LINECOUNT)))
- Send($line)
- EndFunc
- Func escape()
- Exit 0
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement