Jump to content
Sign in to follow this  
Athenon

Help Please :)

Recommended Posts

Athenon

Ok, so I have this script set up to minimize and then hide the program and continue to run it but I cannot for the life of me figure out how to get it to right click before doing the other commands. I have been able to get it to right click on the desktop but not in the hidden program also if I could I would like to add coords to click at. I have underlined the area I am having trouble with if anyone can give suggestions or help me out I would be soooooooooo happy. Thanks

HotKeySet("{F8}", "hide")

HotKeySet("{F10}", "show")

AutoItSetOption("WinTitleMatchMode", 4)

While 1

Sleep(1000)

WEnd

Func hide()

Global $Show = 0

Global $handle = WinGetHandle("classname=GxWindowClassD3d")

WinSetState($handle, "", @SW_MINIMIZE)

WinSetState($handle, "", @SW_HIDE)

If @error Then

MsgBox(0, "error", "couldnt find WoW")

Else

While 1

$unique = Random(1, 4, 1)

If $unique = 1 Then

ControlFocus($handle, "", "")

ControlClick($handle, "", "", "{RIGHT}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{UP DOWN}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{UP UP}")

ControlSend($handle, "", "", "{DOWN DOWN}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{DOWN UP}")

Sleep(200000 + Random(5000, 15000, 1))

ElseIf $unique = 2 Then

ControlFocus($handle, "", "")

ControlClick($handle, "", "", "{RIGHT}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{UP DOWN}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{UP UP}")

ControlSend($handle, "", "", "{DOWN DOWN}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{DOWN UP}")

Sleep(200000 + Random(5000, 15000, 1))

ElseIf $unique = 3 Then

ControlFocus($handle, "", "")

ControlClick($handle, "", "", "{RIGHT}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{UP DOWN}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{UP UP}")

ControlSend($handle, "", "", "{DOWN DOWN}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{DOWN UP}")

Sleep(200000 + Random(5000, 15000, 1))

ElseIf $unique = 4 Then

ControlFocus($handle, "", "")

ControlClick($handle, "", "", "{RIGHT}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{UP DOWN}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{UP UP}")

ControlSend($handle, "", "", "{DOWN DOWN}")

Sleep(100 + Random(1, 50, 1))

ControlSend($handle, "", "", "{DOWN UP}")

Sleep(200000 + Random(5000, 15000, 1)) EndIf

If $Show > 0 Then ExitLoop

WEnd

EndIf

EndFunc ;==>hide

Func show()

Global $Show = 1

WinSetState("World of Warcraft", "", @SW_SHOW)

WinSetState("World of Warcraft", "", @SW_RESTORE)

WinActivate($handle, "")

EndFunc ;==>show

Share this post


Link to post
Share on other sites
florisch

Well, without looking too deep into this, my first thought was that your

ControlClick($handle, "", "", "{RIGHT}")

maybe should look like

ControlClick($handle, "", "", "right")

according to the help on ControlClick: "button [optional] The button to click, "left", "right" or "middle". Default is the left button. "

The other thing is that you do not give a controlID to click on. I do not know how ControlClick behaves on this. maybe you should check if the ControlClick-commands are successful.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×