Quote:
Originally Posted by leelawliet7
I think I need to get the control id to use the function but the window info tool couldn't pick up anything on the controls tab. Is there any other way I can get the control id?
|
Games do not work like that, there are no controlls at all on the whole game, what u can trigger with control ID.
You should put your send key codes in a function, then call the function with a hotkey. It will work for sure.
Try this for example:
HotKeySet("{F5}", "Run_Script")
while 1
sleep(100)
wend
Func Run_Script()
MouseClick("Left", 887, 1063)
Sleep(2000)
Send("s")
endfunc
It will run your mouse click and s button press imitation on a curent window what u are useing. If you are useing window mode and your window size is lower then your system screen resolution, it will not work, cause the coordinates in this script are used on system screen. It mean, it is clicking on your 887x1063 coordinate on your monitor screen and not on your game screen. To solve this is easy, just use the Help file, it will offer the solution for it as an alternative option bottom of examples in help file. Read more carefuly.
If u want u can use loop in your function, cause in this example it will run only once after u pressed F5 button (u can change this button

), but it will run again if u press it again. For exit you can make a new function like this:
HotKeySet("{F6}", "Exit_from_My_Script")
Func Exit_from_My_Script()
Exit
Endfunc