Rawox Posted October 24, 2008 Share Posted October 24, 2008 I want to make a script that goes to a website, clicks something or anything like that and then goes to the website again and repeats the process... This is my example code ... I did not made a real one because I need to know of this is possible. Is there any short code instead of copying and pasting the same code 10 or 20 times in this document? And I Know it's a bit long, but it's just an example HotKeySet("{ESC}", "Terminate") Run("C:\Program Files\Mozilla Firefox\firefox.exe") WinWaitActive ( "Mozilla Firefox" ) Sleep ( 1000 ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" );Extra Check MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "http://www.google.com/" ) Send ( "{ENTER}" ) WinWaitActive ( "Google" ) MouseClick ( "left", 500, 287 ) Send ( "Testing" ) Send ( "{ENTER}" ) Sleep ( 2000 ) Func Terminate() Exit 0 EndFunc Hope this is possible Link to comment Share on other sites More sharing options...
Minikori Posted October 24, 2008 Share Posted October 24, 2008 I want to make a script that goes to a website, clicks something or anything like that and then goes to the website again and repeats the process... This is my example code ... I did not made a real one because I need to know of this is possible. Is there any short code instead of copying and pasting the same code 10 or 20 times in this document? And I Know it's a bit long, but it's just an example HotKeySet("{ESC}", "Terminate") Run("C:\Program Files\Mozilla Firefox\firefox.exe") WinWaitActive ( "Mozilla Firefox" ) Sleep ( 1000 ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" );Extra Check MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "http://www.google.com/" ) Send ( "{ENTER}" ) WinWaitActive ( "Google" ) MouseClick ( "left", 500, 287 ) Send ( "Testing" ) Send ( "{ENTER}" ) Sleep ( 2000 ) Func Terminate() Exit 0 EndFunc Hope this is possible For 1 To 20 ;Your code Next Seriously need to look at the help file before asking questions. For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
Rawox Posted October 24, 2008 Author Share Posted October 24, 2008 I did look at the help file but didn't know where to search for, and it's still not working. I putted away the ESC option, because I got an error with that, but I also get a error: ' For 1 to 3 For ^ Error now... please help me For 1 To 3 Run("C:\Program Files\Mozilla Firefox\firefox.exe") WinWaitActive ( "Mozilla Firefox" ) Sleep ( 1000 ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" );Extra Check MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "http://www.google.com/" ) Send ( "{ENTER}" ) WinWaitActive ( "Google" ) MouseClick ( "left", 500, 287 ) Send ( "Testing" ) Send ( "{ENTER}" ) Sleep ( 2000 ) Next Link to comment Share on other sites More sharing options...
Varian Posted October 24, 2008 Share Posted October 24, 2008 Syntax is incorrect, dude...You need a assign a variable in the For loop For $i =1 to 3 or For $Count = 1 to 20, etc. Link to comment Share on other sites More sharing options...
Rawox Posted October 24, 2008 Author Share Posted October 24, 2008 (edited) I'm totally new to this, could someone please try it, I can't get it to work HotKeySet("{ESC}", "Terminate") Run("C:\Program Files\Mozilla Firefox\firefox.exe") WinWaitActive ( "Mozilla Firefox" ) Sleep ( 1000 ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" );Extra Check MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "http://www.google.com/" ) Send ( "{ENTER}" ) WinWaitActive ( "Google" ) MouseClick ( "left", 500, 287 ) Send ( "Testing" ) Send ( "{ENTER}" ) Sleep ( 2000 ) Func Terminate() Exit 0 EndFunc Edited October 24, 2008 by Rawox Link to comment Share on other sites More sharing options...
Minikori Posted October 24, 2008 Share Posted October 24, 2008 I'm totally new to this, could someone please try it, I can't get it to work HotKeySet("{ESC}", "Terminate") Run("C:\Program Files\Mozilla Firefox\firefox.exe") WinWaitActive ( "Mozilla Firefox" ) Sleep ( 1000 ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" );Extra Check MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "http://www.google.com/" ) Send ( "{ENTER}" ) WinWaitActive ( "Google" ) MouseClick ( "left", 500, 287 ) Send ( "Testing" ) Send ( "{ENTER}" ) Sleep ( 2000 ) Func Terminate() Exit 0 EndFuncHotKeySet("{ESC}", "Terminate") Run("C:\Program Files\Mozilla Firefox\firefox.exe") WinWaitActive ( "Mozilla Firefox" ) Sleep ( 1000 ) For $x = 1 To 20;Assuming this is what you want to loop 20 times MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" ) MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "{BS}" );Extra Check MouseClickDrag ( "left", 700, 55, 250, 55 ) Send ( "http://www.google.com/" ) Send ( "{ENTER}" ) WinWaitActive ( "Google" ) MouseClick ( "left", 500, 287 ) Send ( "Testing" ) Send ( "{ENTER}" ) Sleep ( 2000 ) Next Func Terminate() Exit 0 EndFunc For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
UnknownWarrior Posted October 24, 2008 Share Posted October 24, 2008 I have a similar question to this as well... Would this work if its in a While Loop? If I have say: While 1 Sleep(5000) Send['{F9}'] Sleep(100) Click() ;--- just a func of mine WEnd Instead of copying and pasting this 10 times (which is how many times I need it done) could i do this instead: While 1 For $x = 1 To 10 Sleep(5000) Send['{F9}'] Sleep(100) Click() ;--- just a func of mine Next WEnd Link to comment Share on other sites More sharing options...
Minikori Posted October 24, 2008 Share Posted October 24, 2008 I have a similar question to this as well... Would this work if its in a While Loop? If I have say: While 1 Sleep(5000) Send['{F9}'] Sleep(100) Click();--- just a func of mine WEnd Instead of copying and pasting this 10 times (which is how many times I need it done) could i do this instead: While 1 For $x = 1 To 10 Sleep(5000) Send['{F9}'] Sleep(100) Click();--- just a func of mine Next WEndYes that would work. For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com 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