Krackin Posted September 26, 2008 Share Posted September 26, 2008 (edited) okay i want to make a script that will press 4 in a separate window without switching to it if possible the window name is U2K EDIT if Possible also that it was activated by a hotkey Edited September 26, 2008 by Krackin Link to comment Share on other sites More sharing options...
DaRam Posted September 26, 2008 Share Posted September 26, 2008 What do have so far?PS: Where has the COP bot gone?okay i want to make a script that will press 4 in a separate window without switching to it if possiblethe window name is U2KEDIT if Possible also that it was activated by a hotkey Link to comment Share on other sites More sharing options...
Krackin Posted September 26, 2008 Author Share Posted September 26, 2008 i have nothing so far i usually have my bro do scripts for me but his pc is broken im gunna be using it for diablo 2 median mod so that i can make my second char drink an exp lixer while i kill stuff Link to comment Share on other sites More sharing options...
Tapeworm Posted September 26, 2008 Share Posted September 26, 2008 try ControlSend() Link to comment Share on other sites More sharing options...
Krackin Posted September 26, 2008 Author Share Posted September 26, 2008 (edited) okay let me clear the first post up i want a script that will make a keystroke in a second window without actually switching to it and set to a hotkey key to press 4 window name to press in is U2K hotkey preferably - if its possible ive never personally worked with script but i learn really fast any hints/tip would be greaty appreciated Edited September 26, 2008 by Krackin Link to comment Share on other sites More sharing options...
Krackin Posted September 26, 2008 Author Share Posted September 26, 2008 So im guessing its not possible? Link to comment Share on other sites More sharing options...
Pain Posted September 26, 2008 Share Posted September 26, 2008 It's already been answered, ControlSend(). HotKeySet("{PAUSE}" , "start") ;change hotkey Func start() ControlSend ( "title", "text", controlID, "4") ;change the parameters, you can read about them in the helpfile. Endfunc Link to comment Share on other sites More sharing options...
Krackin Posted September 26, 2008 Author Share Posted September 26, 2008 (edited) HotKeySet("{ENTER}" , "start") Func start() ControlSend ( "U2K", "", controlID, "4") Endfunc --------------------------- AutoIt Error --------------------------- Line 5 (File "C:\Documents and Settings\Sterling\Desktop\U2K Elixer Bot.au3"): ControlSend ( "U2K", controlID, "4") ControlSend ( "U2K", controlID^ ERROR Error: Missing separator character after keyword. --------------------------- OK --------------------------- what did i do wrong? EDIT: Fixed The Error but i just tryed to run it and it wont start Edited September 26, 2008 by Krackin Link to comment Share on other sites More sharing options...
DaRam Posted September 26, 2008 Share Posted September 26, 2008 Glad to see you got started. Optional Use: ProcessWait("u2k_process.exe"); To wait until this process is running - Use Au3Info.exe or Taskmanager to determine the actual EXE name Or Just Use: WinWaitActive("U2K"); To wait until there is an active Window with the title U2K Use: WinActivate("U2K"); To force focus to this Window And then Send("4"); To Send 4 what did i do wrong? Link to comment Share on other sites More sharing options...
Developers Jos Posted September 26, 2008 Developers Share Posted September 26, 2008 HotKeySet("{ENTER}" , "start")Func start()ControlSend ( "U2K", "", controlID, "4") Endfunc---------------------------AutoIt Error---------------------------Line 5 (File "C:\Documents and Settings\Sterling\Desktop\U2K Elixer Bot.au3"):ControlSend ( "U2K", controlID, "4")ControlSend ( "U2K", controlID^ ERRORError: Missing separator character after keyword.---------------------------OK ---------------------------what did i do wrong?EDIT: Fixed The Error but i just tryed to run it and it wont startThe line that has an error does not look the same as the line shown at the top of your post.ControlSend ( "U2K", "", controlID, "4") ControlSend ( "U2K", controlID, "4")Jos SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Krackin Posted September 26, 2008 Author Share Posted September 26, 2008 (edited) Anyone Have Msn Im So Confused Edit ddiadlo19@hotmail.com Edited September 26, 2008 by Krackin Link to comment Share on other sites More sharing options...
DaRam Posted September 26, 2008 Share Posted September 26, 2008 No to MSN. Try this: WinWait("U2K") WinActivate("U2K") If WinActive("U2K") Then Send("4") If it needs an Enter after 4, then modify Send to: Send("4{ENTER}") If this works then you can enhance it to use a Hotkey and move the (above) working code to a function. Anyone Have Msn Im So Confused Link to comment Share on other sites More sharing options...
Krackin Posted September 26, 2008 Author Share Posted September 26, 2008 (edited) Okay so What Order Does The Stuff Go In I Have This So Far HotKeySet("{0}" , "start") Func start() ControlSend ( "U2K", "text", controlID "4") Endfunc where do i add into it like i said ive never used auto it b4 Is There Anywhere To See The Basic Order This Stuff Goes In Ive Been Looking In The Help File And Have Found Nothing Like What I Want Or The Order Of Things EDIT: Idk I May Just Quit Trying Im Trying to Figure This Out And Im Runing A 103 Fever Plus Nothing I Make Will Even Open Edited September 26, 2008 by Krackin Link to comment Share on other sites More sharing options...
DaRam Posted September 26, 2008 Share Posted September 26, 2008 Try running the (first) part of the code I posted.If it works then place that code within your start() function replacing your (controlsend line).Take care, chill (fever remember?), and have a nice WE.Okay so What Order Does The Stuff Go In I Have This So FarHotKeySet("{0}" , "start") Func start()ControlSend ( "U2K", "text", controlID "4")Endfunc where do i add into it like i said ive never used auto it b4Is There Anywhere To See The Basic Order This Stuff Goes In Ive Been Looking In The Help File And Have Found Nothing Like What I Want Or The Order Of ThingsEDIT: Idk I May Just Quit Trying Im Trying to Figure This Out And Im Runing A 103 Fever Link to comment Share on other sites More sharing options...
Krackin Posted September 26, 2008 Author Share Posted September 26, 2008 (edited) do i use {0} if i want my hotkey to be 0 or just 0 also when i run the first one you posted it opens but when i change it to HotKeySet("{0}" , "start") Func start() WinWait("U2K") WinActivate("U2K") If WinActive("U2K") Then Send("4") Endfunc it wont open Edited September 26, 2008 by Krackin Link to comment Share on other sites More sharing options...
Pain Posted September 26, 2008 Share Posted September 26, 2008 (edited) As you said in your first post "without switching to it if possible" so I still believe ControlSend is the best way. Here is a working example but since I don't have that "U2K" I can't fix it for you to work with your program. HotKeySet("0" , "start") While 1 Sleep(100);loop to keep program running WEnd Func start() ControlSend("Untitled", "", "Edit1", "This is a line of text in the notepad window");send some text to notepad ;to get the parameters like title, text and controlID you can use "AutoIt Window Tool" ; look for Title and ClassnameNN for your program. Endfunc Edited September 26, 2008 by Pain Link to comment Share on other sites More sharing options...
Krackin Posted September 26, 2008 Author Share Posted September 26, 2008 (edited) As you said in your first post "without switching to it if possible" so I still believe ControlSend is the best way. Here is a working example but since I don't have that "U2K" I can't fix it for you to work with your program. HotKeySet("0" , "start") While 1 Sleep(100);loop to keep program running WEnd Func start() ControlSend("Untitled", "", "Edit1", "This is a line of text in the notepad window");send some text to notepad ;to get the parameters like title, text and controlID you can use "AutoIt Window Tool" ; look for Title and ClassnameNN for your program. Endfunc U2K I Actually Diablo 2 Lod i just have it named u2k what goes in edit1 ;send some text to notepad ;to get the parameters like title, text and controlID you can use "AutoIt Window Tool" ; look for Title and ClassnameNN for your program. thats confusing Edited September 26, 2008 by Krackin Link to comment Share on other sites More sharing options...
Pain Posted September 26, 2008 Share Posted September 26, 2008 (edited) I assume you won't get any classname for Diabo 2 (like many other games) so try with "" but I'm not sure if it will work or not. ControlSend("Diablo II", "", "", "text to send") Most likely Diablo II also blocks send commands anyways. Edited September 26, 2008 by Pain Link to comment Share on other sites More sharing options...
Krackin Posted September 26, 2008 Author Share Posted September 26, 2008 (edited) I assume you won't get any classname for Diabo 2 (like many other games) so try with "" but I'm not sure if it will work or not.ControlSend("Diablo II", "", "", "text to send")Most likely Diablo II also blocks send commands anyways.its not for the regular realm nothing is blocked at all i play a mod on a private serverand i dont want to send text i just want to press 4 just to use a xp elixer Edited September 26, 2008 by Krackin Link to comment Share on other sites More sharing options...
Pain Posted September 26, 2008 Share Posted September 26, 2008 then change "text to send" to "4" ;P 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