Ok killers another Question!
#1
Posted 20 June 2004 - 02:53 PM
Also great work on AHK guys this is a great free program better than some you have to pay for great works and keep it up. I am gonna be getting alot of the macroers on sb to start using this app.
Oh forgot to ask something is there anyway to hot key the scripts to activate on command. I think the answer would be to put a looping program that looks for certain keystroke then activates desired script name its directory is that close?
#2
Posted 20 June 2004 - 04:18 PM
#3
Posted 20 June 2004 - 07:28 PM
The first thing to try is ControlSend, in this order:Is it possible to send keystrokes to a specific program.
ControlSend, , text to send .... ; leave first param blank to send to topmost control.
ControlSend, ahk_parent, text to send ... ; Send directly to the parent window
(You'll need to fill in the other params for the above commands)
If neither of the above work, you can try using PostMessage as in this (working) example:
Run, wordpad
WinWait, Document -
WinActivate
ControlGetFocus, focused_control
start = 0
Loop
{
PostMessage, 0x102, %start%, 1, %focused_control%
++start
if start > 600
break
}
Some games are resistant to automation and might not work with any of the above methods. They might not even work with the Send command itself. All you can do is experiment.Edit: Uses ControlFocus now since control names vary in different versions of WordPad.
#4
Posted 21 June 2004 - 01:52 AM
you shold be able to identify them using window ID.
http://www.autohotke...ands/WinGet.htm
^,:: WinGet, active_id, ID, A WinGetClass, this_class, ahk_id %active_id% WinGetTitle, this_title, ahk_id %active_id% MsgBox, 0, , id - %active_id%`nclass - %this_class%`nName - %this_title%`n
#5
Posted 25 June 2004 - 01:56 AM
#6
Posted 25 June 2004 - 02:19 AM
#z::WinGetClass, clipboard, A
Then press the hotkey while in the game, and the class name should now be on the clipboard.
If you have two windows that have the same title, text, and class, you'll need to get their IDs with WinGet as jamestr mentioned above.
Of course, you can also use the Send command to send keystrokes directly to the active window.
#7
Posted 25 June 2004 - 05:02 AM
WinGet, active_id, ID, A
WinGetClass, this_class, ahk_id %active_id%
WinGetTitle, this_title, ahk_id %active_id%
MsgBox, 0, , id - %active_id%`nclass - %this_class%`nName - %this_title%`n
Ok I ran that and it gave me the following information
id-0x80050
class-opengl
name-shadowbane
Now I know this is proably a dumb question but what do I do with that information.
#8
Posted 25 June 2004 - 05:52 AM
WinGet, windowlist, list, shadowbane ; Get list of shadowbane Window ID's
Loop, %windowlist%
{
StringTrimRight, windowid, windowlist%a_index%, 0
if a_index = 1
ControlSend,, abc, ahk_id %windowid%; Send abc to first shadowbane window
if a_index = 2
ControlSend,, def, ahk_id %windowid%; Send def to second shadowbane window
}thanks,beardboy
#9
Posted 25 June 2004 - 11:52 AM
Experiment with these (the first was illustrated above by beardboy):what do I do with that information
ControlSend, , text to send .... ; leave first param blank to send to topmost control.
ControlSend, ahk_parent, text to send ... ; Send directly to the parent window
(You'll need to fill in the other params for the above commands)
If neither of the above work, you can try using PostMessage as in this (working) example (see my earlier post above).
#10
Posted 26 June 2004 - 09:53 PM
That is a copy of the command I am using now it does pretty much what I want it to using that. Only thing it did so far I didn't like was I was on the website called shadowbane and it froze my macro till I left the site. Any Ideas.
#11
Posted 26 June 2004 - 11:34 PM
(both named shadowbane)?
you should be able to identify the website browser window and then use a ifwinactive command.
ifwinactive, Shadowbane -
the '-' makes the window unique
#12
Posted 28 June 2004 - 03:37 AM
WinGet,SBID, ID,A
This is outside of my infinite loop in the top of my macro so it only checks once when you first start the macro. You must be in the the client you want to bind the macro to when you hotkey start the macro. It will then bind to the current SB Client windows ID number. You can then use the following to do direct input to the windows ID number.
ControlSend,,%CombatKey% , ahk_id %SBID%
This enters whatever the person has set as there combat key in the ini file and sends it to binded client. You can do as many client ahk binds as you want just got to do one at a time.
#13
Posted 20 August 2004 - 11:37 AM




