scg Posted August 10, 2007 Share Posted August 10, 2007 i'm gd in java but i have never touched anything related to scripts so pls help me. What i need is a very simple script. here it goes. do all commands below on ge.exe [ assume ge.exe is already running ] press space 30 secs passed press control and space together 30 secs passed infinite loop Link to comment Share on other sites More sharing options...
qazwsx Posted August 10, 2007 Share Posted August 10, 2007 Take a look at the help file. Search for send (), sleep(), and while. Link to comment Share on other sites More sharing options...
scg Posted August 10, 2007 Author Share Posted August 10, 2007 Take a look at the help file. Search for send (), sleep(), and while.is this correct? without the loop.Send("ge.exe{SPACE}")Sleep(20000) ;twenty secondsSend("ge.exe{^SPACE}") // press control and space togetherSleep(20000) ;twenty seconds Link to comment Share on other sites More sharing options...
qazwsx Posted August 10, 2007 Share Posted August 10, 2007 get rid of the ge.exe in the send commands. If you want it to just send to ge.exe, then you need to use controlsend (window title, keys). But as long as ge.exe is the active window it should work. Link to comment Share on other sites More sharing options...
scg Posted August 10, 2007 Author Share Posted August 10, 2007 (edited) edited Edited August 10, 2007 by scg Link to comment Share on other sites More sharing options...
scg Posted August 10, 2007 Author Share Posted August 10, 2007 (edited) i do not understand (and i'm quite rushing for time)this is my latest versioni want this script to work whether ge.exe is minimised or activeWhile(True)Send("ge.exe{SPACE}")Sleep(1000) ;1secondsSend("ge.exe{CTRLDOWN}")Send("ge.exe{SPACE}")Send("ge.exe{CTRLUP}")Sleep(1000) ;1secondsWEnd Edited August 10, 2007 by scg Link to comment Share on other sites More sharing options...
GMK Posted August 10, 2007 Share Posted August 10, 2007 Install SciTe for AutoIt and run ScriptWriter to try to record your actions. Link to comment Share on other sites More sharing options...
qazwsx Posted August 10, 2007 Share Posted August 10, 2007 if you wnat it to work even if its not active then you need to use controlsend and the title of the window to send to. Link to comment Share on other sites More sharing options...
scg Posted August 10, 2007 Author Share Posted August 10, 2007 if you wnat it to work even if its not active then you need to use controlsend and the title of the window to send to.is it like this?i do not konw what text and controlID parameters are for though i read the help fileWhile(True)ControlSend("ge.exe", "", "", "{SPACE}")Sleep(2000) ;2 secondsControlSend("ge.exe", "", "", "{CTRLDOWN}")ControlSend("ge.exe", "", "", "{SPACE}")ControlSend("ge.exe", "", "", "{CTRLUP}")Sleep(2000) ;2 secs WEnd Link to comment Share on other sites More sharing options...
GMK Posted August 10, 2007 Share Posted August 10, 2007 (edited) I really think you need to look at and run the examples. First you need to use the Run command to open ge.exe, then you need to possibly use WinWait. You'll need the name of the window and, optionally any text in the window. Then you'll need the control IDs in the window, which you'll need to use the AutoIt Window Info program to find. Edited August 10, 2007 by GMK Link to comment Share on other sites More sharing options...
scg Posted August 10, 2007 Author Share Posted August 10, 2007 I really think you need to look at and run the examples. First you need to use the Run command to open ge.exe, then you need to possibly use WinWait. You'll need the name of the window and, optionally any text in the window. Then you'll need the control IDs in the window, which you'll need to use the AutoIt Window Info program to find.firstly, this program assumes ge.exe is already running. its a game. so how am i supposed to find the name of the window? the application is just ge.exe. control id? whats that. i read it but i have no idea what is does. pls help tks. Link to comment Share on other sites More sharing options...
weaponx Posted August 10, 2007 Share Posted August 10, 2007 Does the game show a window or a console? Link to comment Share on other sites More sharing options...
scg Posted August 10, 2007 Author Share Posted August 10, 2007 Does the game show a window or a console?the game is full screen Link to comment Share on other sites More sharing options...
weaponx Posted August 10, 2007 Share Posted August 10, 2007 (edited) Maybe try this: If the game is fullscreen just comment out WinActivate Send only sends keystrokes to the active window Once your game is running hit Shift-Alt-d to trigger event ;Swap out ge.exe for the window title i.e. "Notepad" ;WinActivate ( "ge.exe") HotKeySet("+!d", "automate") ;Shift-Alt-d While 1 Sleep(100) WEnd Func automate() While 1 Send("{SPACE}") ;Wait 1 second Sleep(1000) ;1seconds Send("{CTRLDOWN}") Send("{SPACE}") Send("{CTRLUP}") ;Wait 1 second Sleep(1000) WEnd EndFunc Edited August 10, 2007 by weaponx Link to comment Share on other sites More sharing options...
GMK Posted August 10, 2007 Share Posted August 10, 2007 Going by the first post, perhaps this would work best:;Swap out ge.exe for the window title i.e. "Notepad" ;WinActivate ( "ge.exe") HotKeySet("+!d", "automate") ;Shift-Alt-d While 1 Sleep(100) WEnd Func automate() While 1 Send("{SPACE}") ;Press SPACE Sleep(30000) ;Wait 30 seconds Send("^{SPACE}") ;Press CTRL-SPACE Sleep(30000) ;Wait 30 seconds WEnd EndFunc Link to comment Share on other sites More sharing options...
scg Posted August 10, 2007 Author Share Posted August 10, 2007 Going by the first post, perhaps this would work best:;Swap out ge.exe for the window title i.e. "Notepad" ;WinActivate ( "ge.exe") HotKeySet("+!d", "automate") ;Shift-Alt-d While 1 Sleep(100) WEnd Func automate() While 1 Send("{SPACE}") ;Press SPACE Sleep(30000) ;Wait 30 seconds Send("^{SPACE}") ;Press CTRL-SPACE Sleep(30000) ;Wait 30 seconds WEnd EndFunc GMK, your first one ( that you replaced ) as well as weaponx's and mine all doesn't really work. All of them have the same problem The problem is that once i maximise the game, one of the commands will be activated in the game (e.g space or ctr space) After which nothing will happen after that. the loop is still obviously running, cos when i minimise the game, i can see those commands still periodically being activated, but when i maximise the game the script simply has no effect at all. Link to comment Share on other sites More sharing options...
scg Posted August 11, 2007 Author Share Posted August 11, 2007 anyone can 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