AutoHotKey Help?

12/01/2007 23:55 Maddhatter56#1
I have Read the "Help" File but still cant figure out how to make a macro that works on client 1 while playing on client 2. Any ideas or codes for this :confused:

I'm working on a macro that heals/pots/sits/med/stig/dc/area to macro etc.
Pretty much it will play the game for u :D
12/02/2007 00:22 a1blaster#2
No questions in release sections.

#Moved :p
12/02/2007 00:39 hieitk#3
you can do some actions on a minimized client with the control functions,
but I know only 2, click and send, you can't do a pixelsearch with minimized window, also with the control functions Idk what will happend if you open 2 clients because it works with the name of the window so there won't be a difference between those two unless there is a way to tell ahk to work on the one that's not active.

Anyway here is a sample on how to use control functions:

first declare the name of the window

Code:
WinGet,id, ID,[Conquer2.0]
then use control click:
Code:
ControlClick, x y,ahk_id %id%,,left
or control send:
Code:
ControlSend, , key, %id%
Good luck.
12/02/2007 09:40 evanxxxm#4
exactly right.
just need to add a little info:
if u open multi CO, activate (on top of all others) the one that u want the ahk.exe to attach to.
and if u want one ahk.exe that controls 2 or more CO
u can use different var, like:
Code:
WinGet,id1, ID,[Conquer2.0]
WinGet,id2, ID,[Conquer2.0]
WinGet,id3, ID,[Conquer2.0]
12/05/2007 13:10 purplehaze#5
Quote:
Originally Posted by evanxxxm View Post
exactly right.
just need to add a little info:
if u open multi CO, activate (on top of all others) the one that u want the ahk.exe to attach to.
and if u want one ahk.exe that controls 2 or more CO
u can use different var, like:
Code:
WinGet,id1, ID,[Conquer2.0]
WinGet,id2, ID,[Conquer2.0]
WinGet,id3, ID,[Conquer2.0]
Could u perhaps add a little more info about this Im curious too :p
if I get it right
Code:
WinGet,id1, ID,[Conquer2.0]
connects to the first, id2 to the second etc... etc.. right?
Could you perhaps give an example how to do the:
Code:
ControlClick, x y,ahk_id %id%,,left
for the second client, it automatically knows your in number 2 or 3 when u start?
(Sorry if my questions sound weird :P)
12/05/2007 15:05 evanxxxm#6
usually i will do something like this
Code:
msgbox, Please activate 1st CO
WinGet,id1, ID,[Conquer2.0]
msgbox, Please activate 2nd CO
WinGet,id2, ID,[Conquer2.0]
msgbox, Please activate 3rd CO
WinGet,id3, ID,[Conquer2.0]
then, it will be more accurate
of course, u can also do a loop check on all current CO windows exist
but then u wont know which one is which id
12/06/2007 01:52 purplehaze#7
I cant seem to figure it out :P

lets say i wanna make a clicker for in TG:

Code:
msgbox, Please activate 1st CO
WinGet,id, ID,[Conquer2.0]

ControlClick, x506 y534,ahk_id %id%,,right
ControlClick, x641 y649,ahk_id %id%,,left
Can u tell me what im doing wong because this wont work :p
atleast right click doesnt, and left well not exactly either

Tho this does work but its not what i want :p

Code:
MouseClick, right,  506,  534
Sleep, 200
MouseClick, left,  641,  649
Sleep, 200
But this way of clicking does work so i must be doing something wrong.
What im exactly doing is trying to scatter and clicking on a stake for bow prof repeating this fast would work great ^^
And i want it to do this without the window open, if ican figure ot how many nice little things can be made.

I was thinking maybe i should put it like this:
Code:
WinGet,id, ID,[Conquer2.0]

ControlClick, x506 y534,ahk_id %id%,,right
sleep,200
ControlClick, x641 y649,ahk_id %id%,,left
sleep,200
*goes testing after maint... lol*
thanks ^^
12/06/2007 02:14 evanxxxm#8
the above code looks fine with me
maybe it clicks too fast that u dont see it?

a better way to see this will be:
Code:
msgbox, Please activate 1st CO
WinGet,id, ID,[Conquer2.0]
loop 10
{
ControlClick, x110 y740,ahk_id %id%,,right
sleep 1000
}
exitapp
tell me if this works for u.
put something like 3+ items in F1 slot
u should be able to see it keeps clicking F1 slot every 1 second
12/06/2007 04:54 hax0rzz#9
quick selling example not for all resolutions but for me it works

Quote:
ButtonScabSell:

mouseclick, left, 584, -725 ;first click using full screen coords
mouseclick, left, 216, 243 ;second click using CO window coords

loop, 39
{
mouseclick, left, 800, 48
mouseclick, left, 216, 243
sleep 500
}

SoundPlay, selldonde.wav
return
12/06/2007 05:14 evanxxxm#10
the difference is we are using controlclicks - which it works on background/minimized
and your mouse function will actually move ur mouse around
12/06/2007 07:16 hax0rzz#11
hmm that control seems new since i've used autohotkey ... although i haven't looked at the language for a while now. guess a new breed of fun will come out of this :)
12/06/2007 08:03 purplehaze#12
Quote:
Originally Posted by evanxxxm View Post
the above code looks fine with me
maybe it clicks too fast that u dont see it?

a better way to see this will be:
Code:
msgbox, Please activate 1st CO
WinGet,id, ID,[Conquer2.0]
loop 10
{
ControlClick, x110 y740,ahk_id %id%,,right
sleep 1000
}
exitapp
tell me if this works for u.
put something like 3+ items in F1 slot
u should be able to see it keeps clicking F1 slot every 1 second
Thanks a lot for your help!
I wil test this out as soon as i get home from work and im about to leave to work, go figure LOL
Anyway thanks a lot, very apriciated!

Alrighty! I looked at it, worked perfect!
So I altered it a bit:

Code:
WinGet,id, ID,[Conquer2.0]
loop
{
ControlClick, x509 y594,ahk_id %id%,,left
sleep 500

ControlClick, x509 y594,ahk_id %id%,,right
sleep 500
}

^r::reload
^p::Pause
exitapp
But once again I stumbled on 1 more problem!
If the window is open and i move my mouse it will click there, So while its running I cant have the window open at all, For example if i wanna see on how much percent im on I cant open the window cuz it will mess up the left click.
Would you perhaps know why that happens? and what can I do about it :p
*thanks you for all your help, sorry im a pain :p... Learning :p