sronoob Posted March 5, 2008 Posted March 5, 2008 Hello I'm trying to make a simple script that will press three buttons.....like this - ------ Press 0 Press 9 Wait 6 seconds Press 8 Repeat every 1800 seconds ------ I'm totally new to this though and I can't figure out how to do it. ;o Any suggestions?
ToyleY Posted March 5, 2008 Posted March 5, 2008 (edited) Hello I'm trying to make a simple script that will press three buttons.....like this - ------ Press 0 Press 9 Wait 6 seconds Press 8 Repeat every 1800 seconds ------ I'm totally new to this though and I can't figure out how to do it. ;o Any suggestions? while 1 send("0") send("9") sleep(6000) send("8") sleep(1800000) wend ;something like that Edited March 5, 2008 by ToyleY
Moderators SmOke_N Posted March 5, 2008 Moderators Posted March 5, 2008 Look up While/WEnd, Send, Sleep in the help file. 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.
sronoob Posted March 7, 2008 Author Posted March 7, 2008 The sample script you gave me just presses 8. I looked up wend and while in the help file and it gave me a bunch of advanced stuff that means nothing to me whatsoever. All the guides I've read seem to skip over the most basic functions....like pressing two buttons. :/
sronoob Posted March 7, 2008 Author Posted March 7, 2008 (edited) OK nm....I got it to work...I just removed the sleep() parts. But I still need it to sleep for 5 mins (doesn't have to be exact) after it presses 8. Is sleep in seconds? For example... sleep(60) = 1 min? P.S. I couldn't find th edit post button. O_o -edit- Ok it's in milliseconds...how how many milliseconds = 5 mins? O_o Edited March 7, 2008 by sronoob
ReaImDown Posted March 7, 2008 Posted March 7, 2008 (edited) OK nm....I got it to work...I just removed the sleep() parts. But I still need it to sleep for 5 mins (doesn't have to be exact) after it presses 8. Is sleep in seconds? For example... sleep(60) = 1 min?P.S. I couldn't find th edit post button. O_o1 min = 1000*601000 = 1 second Edited March 7, 2008 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
sronoob Posted March 7, 2008 Author Posted March 7, 2008 $n = 10 While $n = 10 send("0") send("9") send("8") sleep(300000) WEnd This is what I did...I tried to make an infinite loop or whatever...but when I put sleep in....the script does nothing. Why?
ReaImDown Posted March 7, 2008 Posted March 7, 2008 $n = 10 While $n = 10 send("0") send("9") send("8") sleep(300000) WEnd This is what I did...I tried to make an infinite loop or whatever...but when I put sleep in....the script does nothing. Why? #1, you may as well use while 1, because you never change $n and just use this for your sleep Sleep(1000 * 60 * 5) ;1000 = 1 second, 1000 *60 =1 minute, 1000*60*5 = 5 minutes [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
sronoob Posted March 7, 2008 Author Posted March 7, 2008 (edited) I'm trying to use this through a game and when I put this while 1 send("0") send("9") send("8") WendoÝ÷ Øp¢¹,¥êßyËcºËpØg¡×¥k)mÐn´Èv(ëax%G+ºÚ"µÍÚ[HBÙ[ ][ÝÌ ][ÝÊBÙ[ ][ÝÎI][ÝÊBÙ[ ][ÝÎ ][ÝÊBÛY L JBÙ[ Nothing happens....not even in notepad. -edit- Nevermind...I got it to work. Just had to put 1 second sleep inbetween each key press. Wierd. O_o Edited March 7, 2008 by sronoob
ReaImDown Posted March 7, 2008 Posted March 7, 2008 (edited) I'm trying to use this through a game and when I put this while 1 send("0") send("9") send("8") WendƒoÝŠ÷ Ø‹p¢¹,¥êßyËcºËpŠØg¡×¥k)m–Ðn´‡Èv‹(™ëaŠx%ŠG†+ºÚ"µÍÚ[HBˆÙ[™ œ][ÝÌ œ][ÝÊBˆÙ[™ œ][ÝÎIœ][ÝÊBˆÙ[™ œ][ÝÎ œ][ÝÊB”ÛY L ˆ Œ ˆ JB•Ù[™ Nothing happens....not even in notepad.EDIT WTF is that? ^^^ works fine for me... CODErun("NotePad.exe") sleep(2000) while 1 send("0") send("9") send("8") Sleep(1000) Wend you can also do this... CODErun("NotePad.exe") sleep(2000) while 1 send("098") Sleep(1000) Wend Edited March 7, 2008 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
sronoob Posted March 7, 2008 Author Posted March 7, 2008 This is what I did....that other post got messed up....Lolz while 1 send("0") sleep(1000) send("9") sleep(5000) send("8") sleep(300000) Wend Works now...
ReaImDown Posted March 7, 2008 Posted March 7, 2008 This is what I did....that other post got messed up....Lolz while 1 send("0") sleep(1000) send("9") sleep(5000) send("8") sleep(300000) Wend Works now...Wonder why it wasnt working for you before, maybe you did something wrong -.-' u have alot of delay in there too. [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
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