AutoHotkey problem

01/27/2007 00:49 Diabox#1
Edit: Look @ post #7

Well here's my code:

;WinGet,id, ID,[Conquer2.0]
Gui, Add, Text,, For [Only registered and activated users can see links. Click Here To Register...]
Gui, Add, Text,x10 y42 w100 h20, Auto-summon-guard.
Gui, Add, Text,x15 y62 w190 h20, To start, press F10 on active window,
Gui, Add, Text,x65 y82 w150 h20, now press Ok
Gui, Add, Button, x150 y102 w60 h20 vButton gStart, Ok
Gui, Add, Text,x55 y122 w100 h20, v1.0 by Diabox
Gui, Show

return

Start:

Gui, Submit, Hide
;MsgBox, To start press F10 on active window`n`n Beta version`n v1.0 by Diabox `n`n special for [Only registered and activated users can see links. Click Here To Register...] community
;#NoTrayIcon
*F10::
WinGet,id, ID,[Conquer2.0]
gata := false
MsgBox, Started
loop
{
;ControlSend,,F6,ahk_id %id%
ControlClick,ahk_id %id%,,RIGHT
ControlSend,,F5,ahk_id %id%
Sleep, 60000
}
*F11::ExitApp
;GuiClose:
return






it's supposed to press f6, then right click and then press f5 and then wait 60 seconds to perform the same thing again. But it doesn't work, anyone knows why it doesn't work? I'm quite a nuub with autohotkey.
01/28/2007 21:26 mr.rattlz#2
i think it should be more like this:
Code:
ControlSend,,{F6},ahk_id %id%
ControlClick,,ahk_id %id%,,RIGHT
ControlSend,,{F5},ahk_id %id%
Note the {} around the function keys, and the additional comma after ControlClick.
01/28/2007 21:56 Diabox#3
Quote:
Originally posted by mr.rattlz@Jan 28 2007, 21:26
i think it should be more like this:
Code:
ControlSend,,{F6},ahk_id %id%
ControlClick,,ahk_id %id%,,RIGHT
ControlSend,,{F5},ahk_id %id%
Note the {} around the function keys, and the additional comma after ControlClick.
Not working :cry:
01/29/2007 05:59 dlerch#4
Quote:
Originally posted by Diabox@Jan 26 2007, 15:49
Well here's my code:

;WinGet,id, ID,[Conquer2.0]
Gui, Add, Text,, For [Only registered and activated users can see links. Click Here To Register...]
Gui, Add, Text,x10 y42 w100 h20, Auto-summon-guard.
Gui, Add, Text,x15 y62 w190 h20, To start, press F10 on active window,
Gui, Add, Text,x65 y82 w150 h20, now press Ok
Gui, Add, Button, x150 y102 w60 h20 vButton gStart, Ok
Gui, Add, Text,x55 y122 w100 h20, v1.0 by Diabox
Gui, Show

return

Start:

Gui, Submit, Hide
;MsgBox, To start press F10 on active window`n`n Beta version`n v1.0 by Diabox `n`n special for [Only registered and activated users can see links. Click Here To Register...] community
;#NoTrayIcon
*F10::
WinGet,id, ID,[Conquer2.0]
gata := false
MsgBox, Started
loop
{
;ControlSend,,F6,ahk_id %id%
ControlClick,ahk_id %id%,,RIGHT
ControlSend,,F5,ahk_id %id%
Sleep, 60000
}
*F11::ExitApp
;GuiClose:
return






it's supposed to press f6, then right click and then press f5 and then wait 60 seconds to perform the same thing again. But it doesn't work, anyone knows why it doesn't work? I'm quite a nuub with autohotkey.
This is a guess but remove the semicolon in front of the line

;ControlSend,,F6,ahk_id %id%

make the line this if that does not work

ControlSend,,{F6},ahk_id %id%

let me know if this helps
i dont use controlSend i just use send and it works for me but let me know. Same mod for all the fkey sends enclose them in {}
Don
01/29/2007 13:00 Diabox#5
Quote:
Originally posted by dlerch+Jan 29 2007, 05:59--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (dlerch @ Jan 29 2007, 05:59)</td></tr><tr><td id='QUOTE'> <!--QuoteBegin--Diabox@Jan 26 2007, 15:49
Well here's my code:

;WinGet,id, ID,[Conquer2.0]
Gui, Add, Text,, For [Only registered and activated users can see links. Click Here To Register...]
Gui, Add, Text,x10 y42 w100 h20, Auto-summon-guard.
Gui, Add, Text,x15 y62 w190 h20, To start, press F10 on active window,
Gui, Add, Text,x65 y82 w150 h20, now press Ok
Gui, Add, Button, x150 y102 w60 h20 vButton gStart, Ok
Gui, Add, Text,x55 y122 w100 h20, v1.0 by Diabox
Gui, Show

return

Start:

Gui, Submit, Hide
;MsgBox, To start press* F10 on active window`n`n Beta version`n* * v1.0* by Diabox `n`n special for [Only registered and activated users can see links. Click Here To Register...] community
;#NoTrayIcon
*F10::
WinGet,id, ID,[Conquer2.0]
gata := false
MsgBox, Started
loop
{
* ;ControlSend,,F6,ahk_id %id%
* ControlClick,ahk_id %id%,,RIGHT
* ControlSend,,F5,ahk_id %id%
* Sleep, 60000
}
*F11::ExitApp*
;GuiClose:
return






it's supposed to press f6, then right click and then press f5 and then wait 60 seconds to perform the same thing again. But it doesn't work, anyone knows why it doesn't work? I'm quite a nuub with autohotkey.
This is a guess but remove the semicolon in front of the line

;ControlSend,,F6,ahk_id %id%

make the line this if that does not work

ControlSend,,{F6},ahk_id %id%

let me know if this helps
i dont use controlSend i just use send and it works for me but let me know. Same mod for all the fkey sends enclose them in {}
Don [/b][/quote]
When you use send it won't work in background now will it?? I dunno... But if you read mr. rattlz reply you saw he already mentioned removing the ; etc. and putting { } around the F-keys and that didn't work :cry: , I feel like a noob. Oh wait, I am.
01/30/2007 07:29 dlerch#6
Quote:
Originally posted by Diabox+Jan 29 2007, 04:00--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (Diabox @ Jan 29 2007, 04:00)</td></tr><tr><td id='QUOTE'>
Quote:
Originally posted by -dlerch@Jan 29 2007, 05:59
<!--QuoteBegin--Diabox
Quote:
@Jan 26 2007, 15:49
Well here's my code:

;WinGet,id, ID,[Conquer2.0]
Gui, Add, Text,, For [Only registered and activated users can see links. Click Here To Register...]
Gui, Add, Text,x10 y42 w100 h20, Auto-summon-guard.
Gui, Add, Text,x15 y62 w190 h20, To start, press F10 on active window,
Gui, Add, Text,x65 y82 w150 h20, now press Ok
Gui, Add, Button, x150 y102 w60 h20 vButton gStart, Ok
Gui, Add, Text,x55 y122 w100 h20, v1.0 by Diabox
Gui, Show

return

Start:

Gui, Submit, Hide
;MsgBox, To start press F10 on active window`n`n Beta version`n v1.0 by Diabox `n`n special for [Only registered and activated users can see links. Click Here To Register...] community
;#NoTrayIcon
*F10::
WinGet,id, ID,[Conquer2.0]
gata := false
MsgBox, Started
loop
{
;ControlSend,,F6,ahk_id %id%
ControlClick,ahk_id %id%,,RIGHT
ControlSend,,F5,ahk_id %id%
Sleep, 60000
}
*F11::ExitApp
;GuiClose:
return






it's supposed to press f6, then right click and then press f5 and then wait 60 seconds to perform the same thing again. But it doesn't work, anyone knows why it doesn't work? I'm quite a nuub with autohotkey.

This is a guess but remove the semicolon in front of the line

;ControlSend,,F6,ahk_id %id%

make the line this if that does not work

ControlSend,,{F6},ahk_id %id%

let me know if this helps
i dont use controlSend i just use send and it works for me but let me know. Same mod for all the fkey sends enclose them in {}
Don
When you use send it won't work in background now will it?? I dunno... But if you read mr. rattlz reply you saw he already mentioned removing the ; etc. and putting { } around the F-keys and that didn't work :cry: , I feel like a noob. Oh wait, I am. [/b][/quote]
I didnt see Mr Rattles reply. I may have been typing my response or I may have just missed it. I doubt send will send to the background window. Im going to enclose a little script i use. It is not pretty or well documented but it maybe helpful.

;settimer arrows, 24000
^2:: settimer arrows, off
^3:: settimer arrows, 24000
XButton1::F1
XBUTTON2::
send {F2}
return
^1::gosub co
#v::gosub vnc
^t::
WinClose, A
Gosub co
return
#q::
Send {LCtrl down}
Return
#e::
Send {RButton down}
Return
~RButton::
;_ClickCount=0
Loop
{
Sleep 60
GetKeyState, RButtonState, RButton, P
if RButtonState = U
break
else
MouseClick, Right
;_ClickCount++
;If (_ClickCount = 15)
; Send, {F2}



}
return


co:
run C:&#092;Program Files&#092;Conquer 2.0&#092;play.exe, C:&#092;Program Files&#092;Conquer 2.0&#092;
Return

vnc:
run C:&#092;Program Files&#092;RealVNC&#092;VNC4&#092;vncviewer.exe
WinWait, VNC Viewer : Connection Details,
IfWinNotActive, VNC Viewer : Connection Details, , WinActivate, VNC Viewer : Connection Details,
WinWaitActive, VNC Viewer : Connection Details,
MouseClick, left, 213, 104
Sleep, 100
WinWait, VNC Viewer : Authentication [No Encryption],
IfWinNotActive, VNC Viewer : Authentication [No Encryption], , WinActivate, VNC Viewer : Authentication [No Encryption],
WinWaitActive, VNC Viewer : Authentication [No Encryption],
MouseClick, left, 203, 75
Sleep, 100
Send, deleted_for_my_safety
MouseClick, left, 324, 43
Sleep, 100
return
arrows:
send {f2}
return


This all works mainly because I am lazy it is a combination of stuff for an archer. It repacks arrows and can do a few other odds and ends. I am mainly posting it to illustrate syntax. Ignore the ;lines. I didnt edit this to make it pretty. I will try and help anyway I can because EPVP has given a lot to me but I am not a programer just a lousy hacking and scripter. Good Luck
01/30/2007 14:11 Diabox#7
I still can't get it to work, anyone around with some ideas?

Edit: I've re-written my script:

;WinGet,id, ID,[Conquer2.0]
Gui, Add, Text,, For [Only registered and activated users can see links. Click Here To Register...]
Gui, Add, Text,x10 y42 w100 h20, Auto-summon-guard.
Gui, Add, Text,x15 y62 w190 h20, To start, press F10 on active window,
Gui, Add, Text,x65 y82 w150 h20, now press Ok
Gui, Add, Button, x150 y102 w60 h20 vButton gStart, Ok
Gui, Add, Text,x55 y122 w100 h20, v1.0 by Diabox
Gui, Show

return

Start:

Gui, Submit, Hide
;MsgBox, To start press F10 on active window`n`n Beta version`n v1.0 by Diabox `n`n special for [Only registered and activated users can see links. Click Here To Register...] community, with help fromvarza1999
;#NoTrayIcon
*F10::
WinGet,id, ID,[Conquer2.0]
gata := false
MsgBox, ...started
ControlClick,ahk_id %id%,,RIGHT
loop
{
loop
{
Sleep, 60000 ; xxxx ms delay
ControlClick, x320 y766,ahk_id %id%,,RIGHT ; f6 key summonguard is put on it
ControlClick, x500 y350,ahk_id %id%,,RIGHT ; rightclicks on the screen to summon
ControlClick, x276 y766,ahk_id %id%,,RIGHT ; f5 to select tornado again
}
}
*F11::ExitApp
p::Pause
;GuiClose:
return

But it still does nothing, this time I make it click on the places where the hotkeys are located (like I did in my archer macro which actually worked :eek: )
02/10/2007 08:02 evanxxxm#8
i didnt read much about ur script, but here is my version


; <COMPILER: v1.0.46.8>

Gui, Add, Text,, Skill trainner - 800x600
Gui, Add, Text,x10 y22 w150 h20, Put F1 for skill:
Gui, Add, Text,x10 y42 w80 h20, Put F2 for Skill:
Gui, Add, Text,x10 y62 w80 h20, Put F3 for Sit:
Gui, Add, Text,x10 y80 w190 h20, Press F11 to Stop
Gui, Add, Button, x150 y92 w60 h20 vButton gStart, Ok

Gui, Show

return

Start:

Gui, Submit, Hide




WinGet,id, ID,[Conquer2.0]
gata := false
MsgBox, Press F11 to Pause

ControlClick, x150 y573,ahk_id %id%,,RIGHT
loop
{
ControlClick, x200 y573,ahk_id %id%,,RIGHT
sleep,1000
ControlClick, x114 y573,ahk_id %id%,,RIGHT
sleep,1000
ControlClick, x150 y573,ahk_id %id%,,RIGHT
sleep,1000
ControlClick, x200 y573,ahk_id %id%,,RIGHT
sleep,1000
ControlClick, x400 y300,ahk_id %id%,,RIGHT
sleep,1000

}


*F11::Pause

return