david1337 Posted September 1, 2014 Share Posted September 1, 2014 Hi guys Hope you can help me out with this one How can I make the script go for Global $2firstname / Global $2lastname the first time my script loops? And next time script loops go for Global $3firstname etc. etc email should be firstname + lastname + @mail.com every time password should be Password123 everytime expandcollapse popupGlobal $email = "@mail.com" Global $password = "Password123" Global $1firstname = "John" Global $1lastname = "Smith" Global $2firstname = "Stan" Global $2lastname = "Jackson" Global $3firstname = "Tina" Global $3lastname = "Samson" run("notepad") ProcessWait("notepad.exe") While 1 send($1firstname) send("{SPACE}") send($1lastname) send("{ENTER}") send($1firstname) send($1lastname) send($email) send("{ENTER}") send($password) send("{ENTER 2}") sleep(5000) WEnd Link to comment Share on other sites More sharing options...
devilman16 Posted September 1, 2014 Share Posted September 1, 2014 I would use arrays: Global $email = "@mail.com" Global $password = "Password123" Dim $Name[3][2] $Name[0][0] = "John" $Name[0][1] = "Smith" $Name[1][0] = "Stan" $Name[1][1] = "Jackson" $Name[2][0] = "Tina" $Name[2][1] = "Samson" run("notepad") ProcessWait("notepad.exe") For $i = 0 To 2 $TempMail = $Name[$i][0] & $Name[$i][1] & $email $text = $Name[$i][0] & " " & $Name[$i][1] & "{ENTER}" & $TempMail & "{ENTER}" & $password & "{ENTER 2}" Send($text) Next Link to comment Share on other sites More sharing options...
david1337 Posted September 1, 2014 Author Share Posted September 1, 2014 (edited) devilman Thanks mate, that worked just as I wanted in my example! My problem now is that I already have an excising script with tons of "send" commands etc, and I am trying to figure out how to to implement this. So if I have a script that looks something like the example in the bottom, (but with about 300 extra send commands ) how can I add this: $Name[0][0] = "John" $Name[0][1] = "Smith" $Name[1][0] = "Stan" $Name[1][1] = "Jackson" $Name[2][0] = "Tina" $Name[2][1] = "Samson" and make it refer to the Send($firstname) Send($lastname) that already exists in this script? So after the Wend command it goes for "Stan Jackson" and then again after the Wend command it goes for "Tina Samson" etc. I hope you understand what I mean expandcollapse popupGlobal $email = "@mail.com" Global $password = "Password123" While 1 sleep(1000) Send($firstname) sleep(300) send("{TAB}") sleep(300) Send($lastname) sleep(300) send("{TAB}") sleep(300) Send($firstname) Send($lastname) Send($email) sleep(300) send("{TAB}") sleep(300) Send($password) sleep(300) send("{TAB}") sleep(300) send("{SPACE}") sleep(300) send("{TAB 2}") sleep(300) send("{ENTER}") WEnd Edited September 1, 2014 by david1337 Link to comment Share on other sites More sharing options...
Solution devilman16 Posted September 1, 2014 Solution Share Posted September 1, 2014 If I understand you correctly you can do it this way: Global $email = "@mail.com" Global $password = "Password123" Dim $Name[3][2] $Name[0][0] = "John" $Name[0][1] = "Smith" $Name[1][0] = "Stan" $Name[1][1] = "Jackson" $Name[2][0] = "Tina" $Name[2][1] = "Samson" run("notepad") ProcessWait("notepad.exe") For $i = 0 To 2 $firstname = $Name[$i][0] $lastname = $Name[$i][1] send($firstname) send("{SPACE}") send($lastname) send("{ENTER}") send($firstname) send($lastname) send($email) send("{ENTER}") send($password) send("{ENTER 2}") sleep(5000) Next But you can also replace every $firstname with $Name[$i][0] and $lastname with $Name[$i][1] in every editor (find-replace) Link to comment Share on other sites More sharing options...
david1337 Posted September 1, 2014 Author Share Posted September 1, 2014 devilman That worked perfectly! Thank you so much! That saved my day ;D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now