Kupo Posted August 21, 2006 Share Posted August 21, 2006 Hey, im new to the autoit community, and just needing help with a simple script that presses the 1 key every 1.8 seconds and loops infintely Thanks! Link to comment Share on other sites More sharing options...
xcal Posted August 21, 2006 Share Posted August 21, 2006 (edited) HotKeySet("{ESC}", "quit") While 1 ControlSend ( "Untitled - Notepad", "", "Edit1", "1") Sleep(1800) WEnd Func quit() Exit EndFunc Replace the "Title" and "Control ID" with your program, of course. See ControlSend, Sleep, and HotKeySet in the help file for explanations. Edited August 21, 2006 by xcal How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Kupo Posted August 21, 2006 Author Share Posted August 21, 2006 There any way to make it send to active window? im trying to make it just hit 1 over and over every 1.8 sec on a game window called CABAL, i just changed the notepad, untitled to the window name right? its not working.. maybe active window will work? Link to comment Share on other sites More sharing options...
xcal Posted August 21, 2006 Share Posted August 21, 2006 (edited) Try... HotKeySet("{ESC}", "quit") While 1 WinWaitActive("Untitled - Notepad") ;Replace with CABAL I suppose. Send ("1") Sleep(1800) WEnd Func quit() Exit EndFunc See Send and WinWaitActive in the help file. edit - you can remove WinWaitActive("Untitled - Notepad") if you don't care if "1" is sent all willy nilly to anything. Really, though, look in the help file. It's one of the best I've ever seen. Edited August 21, 2006 by xcal How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 21, 2006 Share Posted August 21, 2006 Hi, although might have a look at TimerDiff(), it is more exactly then Sleep(...) So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Kupo Posted August 21, 2006 Author Share Posted August 21, 2006 (edited) does it have to be on the task list of task manager to run auto it its a very strange startup for this game, you login from a website and it loads the game off the IE page, and i cant find it in processes or task list, but it does show on the start bar BTW it still does not work after using the modified script, i think most likely due to its not an actuall process or somthing, im lost from here Edited August 21, 2006 by Kupo Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 21, 2006 Share Posted August 21, 2006 Hi, is it a browser game or a Java Webstart oder Java Applet game? So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
xcal Posted August 21, 2006 Share Posted August 21, 2006 This is how I would do it with timerdiff. Not sure if this is the best way. Maybe Mega can say. HotKeySet("{ESC}", "quit") While 1 Send ("1") $start = TimerInit() While TimerDiff($start) < 1800 ;do nothing WEnd WEnd Func quit() Exit EndFunc How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Kupo Posted August 21, 2006 Author Share Posted August 21, 2006 That script diddnt work either.. i can also right click to do the same thing, i dunno if that helps its basicly you login to cabaonline.com, download the game (500mb dl), then later you can login again and click play game, this loads the game somhow from the website, very odd Link to comment Share on other sites More sharing options...
xcal Posted August 21, 2006 Share Posted August 21, 2006 Well ya, that wouldn't work either, since the pause isn't your problem. I'm still learning autoit myself, so I'll sit back and see if anyone else can give you a hand. How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Rad Posted August 21, 2006 Share Posted August 21, 2006 (edited) Hotkeyset("^q","ExitProgram") AdLibEnable("Spammer",1800) While 1 WEnd Func ExitProgram() Exit EndFunc Func Spammer() ;~ If WinActive("Cabal") = 1 Then Send("{1}") ;~ Endif EndFunc ;~ <== that is a quote btw Press CTRL+Q to exit, worked fine when I tested it, just remove quotes and change title name to whatever the Cabal title is (Exactly?) and it should only send there. Edited August 21, 2006 by Rad Link to comment Share on other sites More sharing options...
xcal Posted August 21, 2006 Share Posted August 21, 2006 AdLibEnable() isn't as accurate as using TimerDiff() in a loop. I did a test and it has the same variance as Sleep() did. Mind you, it's splitting hairs. How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
CactuSka Posted August 1, 2007 Share Posted August 1, 2007 Hi! Unfortunatly i'm totally noob in scripting and in AutoIt too i have almost the same problem like the topic opener. I need a script what is pressing a key or do a right click in the game cabal.I tried the sample what you are wrote here,but didn't work The application name is CABAL.Thanks your time and your help. 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