Shock Posted September 6, 2006 Share Posted September 6, 2006 (edited) I need some help to write a script: probably i'll receive an answer in quite 2 seconds because it should be easy to compose and i'm only a n00b,..well..I'll describe it. I need a script which can do the following things (in this order): 1) press "1" and wait "50secs" -this for 100times-, then wait "30secs" 2) press "/qtd", "pressINSERT" and wait "50secs" 3) shut down windows (so press "WINstartButton"+"UParrow"+"INSERT" ] Could you please post your creation(s) in this pages like .txt files? Thank you very much. Uhh...Sorry for my english, i'm [iTA]... You can't imagine how difficult has been to write this post! I hope you'll answer soon, thanks again, -shock- Edited September 6, 2006 by Shock Link to comment Share on other sites More sharing options...
AzKay Posted September 6, 2006 Share Posted September 6, 2006 HotKeySet("^{F1}", "_Thingo") While 1 Sleep(5000) WEnd Func _Thingo() For $i = 1 to 100 Send("1") Sleep(50000) Next Sleep(30000) Send("/qtd") Send("{INSERT}") Sleep(50000) Send("{LWIN}") Send("{UP}") Send("{ENTER}") Send("{TAB}") Send("{ENTER}") EndFunc Like this? When you press Ctrl + F2 itll do it # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Shock Posted September 6, 2006 Author Share Posted September 6, 2006 (edited) I tried to copy your project in a .txt, then I modified the extension in .au3 and started it, but i doesn't work. I edited it a bit in the end to reduce the risk of a "freeze" of windows when It should get shut down. HotKeySet("^{F1}", "_Thingo") While 1 Sleep(5000) WEnd Func _Thingo() For $i = 1 to 100 Send("1") Sleep(50000) Next Sleep(30000) Send("/qtd") Send("{INSERT}") Sleep(50000) Send("{LWIN}") Sleep(1000) Send("{UP}") Sleep(1000) Send("{ENTER}") I tried it using WindowsWord, but "1" doesn't appear. Have you set up to press "F1" or...what? Edited September 6, 2006 by Shock Link to comment Share on other sites More sharing options...
AzKay Posted September 6, 2006 Share Posted September 6, 2006 Well, It should do it when you press CTRL + F2, And, Dont know if you put this in but, remember to keep the "EndFunc" at the bottom of the script # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Shock Posted September 6, 2006 Author Share Posted September 6, 2006 (edited) Well, It should do it when you press CTRL + F2, And, Dont know if you put this in but, remember to keep the "EndFunc" at the bottom of the scriptI put "EndFunc" at the end of the script (you had already done it:))..If I well understand you have set the script to start when i press CTRL + F2....can't we eliminate this input i should give him just setting a delay of 5secs to start after i've LeftClicked2times on his icon to open it? Thank you soo much, you're an angel! Edited September 6, 2006 by Shock Link to comment Share on other sites More sharing options...
AzKay Posted September 6, 2006 Share Posted September 6, 2006 (edited) I put "EndFunc" at the end of the script (you had already done it:)).. If I well understand you have set the script to start when i press CTRL + F2....can't we eliminate this input i should give him just setting a delay of 5secs to start after i've LeftClicked2times on his icon to open it? Thank you soo much, you're an angel! Well, The reason I asked about the end func thing, was because when you reposted the code, it was missing "EndFunc" Sleep(10000) For $i = 1 to 100 Send("1") Sleep(50000) Next Sleep(30000) Send("/qtd") Send("{INSERT}") Sleep(50000) Send("{LWIN}") Send("{UP}") Send("{ENTER}") Send("{TAB}") Send("{ENTER}") Itll start 10 seconds after being ran. Edited September 6, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Shock Posted September 6, 2006 Author Share Posted September 6, 2006 (edited) Well, The reason I asked about the end func thing, was because when you reposted the code, it was missing "EndFunc"Touché. Well, that's my last request, i promise: how can i set a random delay [from 0 to 1.5secs] between every "1button" press? Thank you so much, really. Edited September 6, 2006 by Shock Link to comment Share on other sites More sharing options...
AzKay Posted September 6, 2006 Share Posted September 6, 2006 Touché. Well, that's my last request, i promise: how can i set a random delay [from 0 to 1.1secs] between every "1button" press? Thank you so much, really. Button1? # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Shock Posted September 6, 2006 Author Share Posted September 6, 2006 Button1? Err...[ Send("1") ] Link to comment Share on other sites More sharing options...
AzKay Posted September 6, 2006 Share Posted September 6, 2006 Between the send("1")? So, It will have the 50seconds, then an extra random sleep between0 to 1.1? # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Shock Posted September 6, 2006 Author Share Posted September 6, 2006 Between the send("1")? So, It will have the 50seconds, then an extra random sleep between0 to 1.1?Yes, this is what I was trying to say. Link to comment Share on other sites More sharing options...
AzKay Posted September 6, 2006 Share Posted September 6, 2006 Sleep(10000) For $i = 1 to 100 $RandomSleep = Random(0, 1100) Send("1") Sleep($RandomSleep) Sleep(50000) Next Sleep(30000) Send("/qtd") Send("{INSERT}") Sleep(50000) Send("{LWIN}") Send("{UP}") Send("{ENTER}") Send("{TAB}") Send("{ENTER}") # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Shock Posted September 6, 2006 Author Share Posted September 6, 2006 AzKay won. Tyvm. Link to comment Share on other sites More sharing options...
AzKay Posted September 6, 2006 Share Posted September 6, 2006 AzKay won.Tyvm. Anytime # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Shock Posted October 2, 2006 Author Share Posted October 2, 2006 What's the "ESC" button name? Send("{ESC}")? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 2, 2006 Moderators Share Posted October 2, 2006 Sleep(10000) For $i = 1 to 100 $RandomSleep = Random(0, 1100) Send("1") Sleep($RandomSleep) Sleep(50000) Next Sleep(30000) Send("/qtd") Send("{INSERT}") Sleep(50000) Send("{LWIN}") Send("{UP}") Send("{ENTER}") Send("{TAB}") Send("{ENTER}") oÝ÷ Ûú®¢×¢é]m¶më"b~'i¸jëh×6Sleep(10000) For $i = 1 to 100 Send("1") Sleep(50000) Next Sleep(30000) Send("/qtd") Send("{INSERT}") Sleep(50000) Shutdown(1) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Shock Posted October 2, 2006 Author Share Posted October 2, 2006 Couldn't that be simplified a bit?Sleep(10000) For $i = 1 to 100 Send("1") Sleep(50000) Next Sleep(30000) Send("/qtd") Send("{INSERT}") Sleep(50000) Shutdown(1)Nope. ...Can you answer to my question, please? Link to comment Share on other sites More sharing options...
AzKay Posted October 2, 2006 Share Posted October 2, 2006 Nope. ...Can you answer to my question, please? If you search the helpfile, itll tell you what the "esc" code is. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 2, 2006 Moderators Share Posted October 2, 2006 Nope. ...Can you answer to my question, please? I wasn't answering your question but more so pointing out an obvious Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
dandymcgee Posted October 2, 2006 Share Posted October 2, 2006 Esc = the Escape button. It in the top-left most button on the keyboard. It might have a different abbreviation on an Italian keyboard - Dan [Website] 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