TK_Incorperate Posted October 16, 2005 Posted October 16, 2005 Ok..... me and a friend are making a game, and we are in the testing phase of it, finding bugs, ect.... and i need to test alot of stuff but at the same time i have many things on my computer i need to do.... Is there any way to attach a script directly to a program (namely the program is called Shadow Realm) and let it run in there, but still be aply to type/browse freely without it taking effect on the rest of your computer? i've searched the help file throu and throu and havent found anything, but if this was possible it would be a GREAT help, if it's not then as a suggestion could you put it in the next version of AI? Thanks in advance, any answer will satisfy me as long as i get an answer and it's truthfull hehe -TK
svennie Posted October 16, 2005 Posted October 16, 2005 Ok..... me and a friend are making a game, and we are in the testing phase of it, finding bugs, ect.... and i need to test alot of stuff but at the same time i have many things on my computer i need to do....Is there any way to attach a script directly to a program (namely the program is called Shadow Realm) and let it run in there, but still be aply to type/browse freely without it taking effect on the rest of your computer? i've searched the help file throu and throu and havent found anything, but if this was possible it would be a GREAT help, if it's not then as a suggestion could you put it in the next version of AI?Thanks in advance, any answer will satisfy me as long as i get an answer and it's truthfull hehe -TKI am not sure this is what you meaning, but maybe you can create a child window in the game:GUICreate ("title",(width),(height),(left),(top),$WS_CHILD,WinGetHandle("title of your game","Text in your game"))This creates a GUI embedded in your game...It will not have caption etc.If you want that replace $WS_CHILD with $WS_CHILD+$WS_CAPTION+$WS_SYSMENUUse AutoIt Window Info to search the title of your game and the text in your game.If it hasnt a title/text, place this at the top of your script:Opt("WinTitleMatchMode",4).Now place this in the title:classname=Here the classname, find it with AutoIt Window InfoAlmostly all windows have classname.Hope it helps u. Sorry for my English, I'm Dutch... =DMedia UDFINet Adv UDF
TK_Incorperate Posted October 16, 2005 Author Posted October 16, 2005 im not sure what you mean by that stuff you posted lol... but i'll make what i meant more understandable.... What i need is to attach my script ONLY! to the game, so i can have my script testing the game for me, while i can freely do stuff OUTSIDE of the game, (typing, clicking, browsing, ect.) without the clicks and movements that are going on inside of the game.... is this possible?
TK_Incorperate Posted October 17, 2005 Author Posted October 17, 2005 anybody know? if so PLEASE help me... if not then at least tell me it isnt possible so ill quit lookin for sumtin dat dont exist, lol but please tell me if it's possible... it's important that i find something that can do this
dexxa Posted October 17, 2005 Posted October 17, 2005 i think what you are looking for is minimized click. i think the UDF is control_click. try searching the forum for it.
TK_Incorperate Posted October 17, 2005 Author Posted October 17, 2005 i think what you are looking for is minimized click. i think the UDF is control_click. try searching the forum for it.minimized click? lol i know how to have my game minimized but still have auto-it work in it, the problem is... once i click away from the game, like if i click ANYWHERE on the screen, it automaticaly detaches from the game.... i want this to attach itself to Shadow Realm (my game) and KEEP itself attached while i do other stuff (in firefox, notepad, messangers, ect.) but i DONT want the effects (like pressing z, e, q, ect.) to take place in firefox, notepad, ect....as far as minimized click, no clue wut dat is lol....
LxP Posted October 17, 2005 Posted October 17, 2005 as far as minimized click, no clue wut dat is lol....A 'minimised click' is a click in a window that's minimised or otherwise not visible on the screen. AutoIt is capable of automating standard windows in the background via the use of ControlClick(), ControlSend() etc. If your game consists of a standard Windows GUI (text fields, buttons, menus etc.) then it should be quite easy to automate as needed. Try using AutoIt Window Info on your game window to see if any information can be read. Place your mouse cursor over the different clickable/editable elements of the game screen to see what comes up. If nothing useful comes up then you're out of luck.It's harder to 'automate' games because generally games are designed to be played by a human! You will probably need to do your testing by hand.
TK_Incorperate Posted October 17, 2005 Author Posted October 17, 2005 well i just want it to send certain keys inside of the game.... not completely play it, but it's not just a regular window...... it's a fullscreen program, lol so im guessing that means this isnt possible with autoit?
w0uter Posted October 17, 2005 Posted October 17, 2005 try controlsend My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
LxP Posted October 17, 2005 Posted October 17, 2005 try controlsendMore specifically, try using ControlSend() without specifying a control ID since your game window is likely not to have one:ControlSend("Game window title", "", "", "Keys to send")
TK_Incorperate Posted October 17, 2005 Author Posted October 17, 2005 (edited) ok so limmy get this strait, if i wanna send S, sleep for 2 seconds, then send Z, it'd look like this? ControlSend("Shadow Realm", "S") Sleep(2000) ControlSend("Shadow Realm", "Z") right??? Edited October 17, 2005 by TK_Incorperate
LxP Posted October 17, 2005 Posted October 17, 2005 (edited) Almost right:ControlSend("Shadow Realm", "", "", "s") Sleep(2000) ControlSend("Shadow Realm", "", "", "z")Note the lowercase S and Z because otherwise it'll send Shift+key. Edited October 17, 2005 by LxP
TK_Incorperate Posted October 17, 2005 Author Posted October 17, 2005 do i hafta have all those blank ,"" things??
LxP Posted October 17, 2005 Posted October 17, 2005 Yes -- ControlSend() expects four parameters. If you try it with just two then AutoIt will throw an error at you. You could have found this out for yourself by trying it, you know...
blademonkey Posted October 17, 2005 Posted October 17, 2005 Yes -- ControlSend() expects four parameters. If you try it with just two then AutoIt will throw an error at you. You could have found this out for yourself by trying it, you know... LOL, but who wants to go through trial and error when you can be handed the solution? ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung
seandisanti Posted October 17, 2005 Posted October 17, 2005 LOL, but who wants to go through trial and error when you can be handed the solution?...
w0uter Posted October 17, 2005 Posted October 17, 2005 i do since i want to learn and be more leet then you. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Skruge Posted October 17, 2005 Posted October 17, 2005 @ w0uter & LxP: I've seen both of you suggest using a blank ControlID with ControlSend when the target window has no controls. I've had only limited success with this method. (See my last post in the following topic) Could you please check out this topic and let me know what your thoughts are? http://www.autoitscript.com/forum/index.php?showtopic=16867 Thanks, guys! [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
LxP Posted October 18, 2005 Posted October 18, 2005 Hi Skruge,How embarrassing -- I've suggested this usage of ControlSend() a couple times now and after actually testing it with the following code:Opt("WinWaitDelay", 0) Opt("WinTitleMatchMode", 2) Local Const $NP = "metapad" Local Const $CALC = "Calculator" Run("metapad") Run("Calc") WinWait($NP) WinWait($CALC) WinActivate($CALC) WinWaitActive($CALC) Local $Return = ControlSend($NP, "", "", "Testing...") MsgBox(0x40 , "ControlSend()", "Return value is " & $Return)I find that it doesn't work as expected. Perhaps no one has actually tested this but instead heard that it works from someone else -- it's interesting how false ideas can propagate like this. Now to find the original poster of this suggestion... Incidentally the value returned by ControlSend() indicates success, which suggests that it is in fact designed to work this way... I would expect it to choose the control with focus by default.
seandisanti Posted October 18, 2005 Posted October 18, 2005 Hi Skruge,How embarrassing -- I've suggested this usage of ControlSend() a couple times now and after actually testing it with the following code:Opt("WinWaitDelay", 0) Opt("WinTitleMatchMode", 2) Local Const $NP = "metapad" Local Const $CALC = "Calculator" Run("metapad") Run("Calc") WinWait($NP) WinWait($CALC) WinActivate($CALC) WinWaitActive($CALC) Local $Return = ControlSend($NP, "", "", "Testing...") MsgBox(0x40 , "ControlSend()", "Return value is " & $Return)I find that it doesn't work as expected. Perhaps no one has actually tested this but instead heard that it works from someone else -- it's interesting how false ideas can propagate like this. Now to find the original poster of this suggestion... Incidentally the value returned by ControlSend() indicates success, which suggests that it is in fact designed to work this way... I would expect it to choose the control with focus by default.yeah i was going to post that yesterday after skruge's posts in another thread i tested on my own, i couldn't get it to send even to notepad without a control id. after i added just the control id to the line that wasn't working, it went fine for me....
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