AutoHotkey Community

It is currently May 26th, 2012, 3:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: ControlClick in game
PostPosted: January 18th, 2008, 5:32 am 
Offline

Joined: May 10th, 2007, 2:52 am
Posts: 194
Location: China/ Canada
  • Try setting Sleep, value to release mouse button
    Code:
    ^t::
    ControlClick, x%CoordX% y%CoordY%, ahk_id %JX2WinID%,,,, D
    Sleep, 350
    ControlClick, x%CoordX% y%CoordY%, ahk_id %JX2WinID%,,,, U
    return
  • If still not working, try using MouseMove command to ensure cursor at the pixel to click, or using both the Sleep value and MouseMove
    Code:
    CoordMode, Mouse, Screen

    ^g::
    MouseGetPos, CoordX_S, CoordY_S, WindowID
    WinGetPos, WinPosX, WinPosY,,, ahk_id %WindowID%
    CoordX := CoordX_S - WinPosX
    CoordY := CoordY_S - WinPosY
    return

    ^t::
    MouseMove, %CoordX_S%, %CoordY_S%
    ControlClick, x%CoordX% y%CoordY%, ahk_id %WindowID%,,,, NA
    return
Sample
Code:
CoordMode, Mouse, Screen
Gui -MinimizeBox -MaximizeBox
Gui, Add, Text, x10, Press F6 to refine item
Gui, Add, Text, x10, Delay Time:
Gui, Add, Edit, xp+69 vVarSleepTime w64 ReadOnly
Gui, Add, UpDown, vSleepTimeAdjust gSleepTimeAdjust Range0-60, 23
GuiControlGet, SleepTimeAdjust
Gosub, SleepTimeAdjust
Gui, Add, Text, x10, Refine Num:
Gui, Add, Edit, xp+69 w64
Gui, Add, UpDown, vRefineNum Range1-1000, 10
Gui, Add, Button, xp+69 gRefineItem, Refine
Gui, Add, Text, x10, Press Up/ Down to Adjust delay, or with Ctrl to higher the adjust
Gui, Add, Button, x10 gReload, Reload
Gui, Add, Button, xp+150 gExit, Exit
Gui, Show,, Item Refine Script for JX2Online`, by Rhapsody
return

SleepTimeAdjust:
If SleepTimeAdjust = 0
 GuiControl,, VarSleepTime, % Round(0.3, 1)
Else
 GuiControl,, VarSleepTime, % Round(SleepTimeAdjust * 0.5, 1)
GuiControlGet, VarSleepTime
VarSleepTime *= 1000
return

F6::
GuiControlGet, RefineNum
MouseGetPos, CoordX_S, CoordY_S, JX2WinID
WinGetPos, WinPosX, WinPosY,,, ahk_id %JX2WinID%
CoordX := CoordX_S - WinPosX
CoordY := CoordY_S - WinPosY
Hotkey, F6, PauseScript
RefineItem:
Loop %RefineNum%
{
 MouseGetPos, CoordXRec, CoordYRec
 MouseMove, %CoordX_S%, %CoordY_S%
 ControlClick, x%CoordX% y%CoordY%, ahk_id %JX2WinID%,,,, NA
 MouseMove, %CoordXRec%, %CoordYRec%
 Sleep, %VarSleepTime%
}
Msgbox, 8256, Item Refine, Done
return

PauseScript:
Pause
return

^Up::
^Down::
~Up::
~Down::
IfInString, A_ThisHotkey, Up
 SleepTimeA := 1
else
 SleepTimeA := -1
IfInString, A_ThisHotkey, ^
 SleepTimeA *= 4
GuiControl,, SleepTimeAdjust, + %SleepTimeA%
GuiControlGet, SleepTimeAdjust
Gosub, SleepTimeAdjust
return

Reload:
Reload
return

Exit:
ExitApp
return
P.S. Probably still would not work on some game(s) ...

_________________
Sakurako ^_^


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], Google Feedfetcher, oldbrother and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group