nnobakht 0 Light Poster

hey guys im trying to modify this code to get it to do a click on a certain spot on the program that it is minimizing but i cant get it to work any help would be great.

HotKeySet("{F9}", "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
            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
            ControlSend($handle, "", "", "{RIGHT DOWN}")
            Sleep(100 + Random(1, 50, 1))
            ControlSend($handle, "", "", "{RIGHT UP}")
            ControlSend($handle, "", "", "{LEFT DOWN}")
            Sleep(100 + Random(1, 50, 1))
            ControlSend($handle, "", "", "{LEFT UP}")
            Sleep(200000 + Random(5000, 15000, 1))
         ElseIf $unique = 3 Then
            ControlSend($handle, "", "", "{DOWN DOWN}")
            Sleep(100 + Random(1, 50, 1))
            ControlSend($handle, "", "", "{DOWN UP}")
            ControlSend($handle, "", "", "{UP DOWN}")
            Sleep(100 + Random(1, 50, 1))
            ControlSend($handle, "", "", "{UP UP}")
            Sleep(200000 + Random(5000, 15000, 1))
         ElseIf $unique = 4 Then
            ControlSend($handle, "", "", "{LEFT DOWN}")
            Sleep(100 + Random(1, 50, 1))
            ControlSend($handle, "", "", "{LEFT UP}")
            ControlSend($handle, "", "", "{RIGHT DOWN}")
            Sleep(100 + Random(1, 50, 1))
            ControlSend($handle, "", "", "{RIGHT 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_MAXIMIZE)
   WinActivate($handle, "")
EndFunc   ;==>show

thanks in advance,

Navid

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.