|
#1
|
|||
|
|||
I don\'t know how to use coordmode in my script. Here is my script.
This is the joystick as a mouse script and I just added stuff at the bottom. I know it's a mess, but I had to try and figure all this stuff out.
The hotkeys will not click the right coordinates unless the PokerStars table is at maximum size and it will only work if the table is the active window. I want to be able to play the table on it's default size. I also want the mouse to click on a certain part of the screen no matter what windows are active or what part of the screen the window is at. Right now the cursor will just shoot to the bottom or sides of the screen when I click fold, call, raise, ect. (if the table is not maximum size.) I can't figure out where to type coordmode and what to type. So I just need to know how to use those two different coordmodes, ( being able to use the table on it's defualt size, and being able to click a certain part of the screen no matter what the windows are doing) because I use two diferent scripts Also, I would like to be able to have a fast scroll option so it would make the mouse scroll faster when I hold down a certain button. And my mouse will keep scrolling up if I have my controller unplugged and the script is turned on. If someone knows what I need to do then maybe you could show me what I need to type in my script. The main problem is the coordmode though. ; Using a Joystick as a Mouse ; http://www.autohotkey.com ; This script converts a joystick into a three-button mouse. It allows each ; button to drag just like a mouse button and it uses virtually no CPU time. ; Also, it will move the cursor faster depending on how far you push the joystick ; from center. You can personalize various settings at the top of the script. ; Increase the following value to make the mouse cursor move faster: JoyMultiplier = 0.30 ; Decrease the following value to require less joystick displacement-from-center ; to start moving the mouse. However, you may need to calibrate your joystick ; -- ensuring it's properly centered -- to avoid cursor drift. A perfectly tight ; and centered joystick could use a value of 1: JoyThreshold = 10 ; Change the following to true to invert the Y-axis, which causes the mouse to ; move vertically in the direction opposite the stick: InvertYAxis := false ; Change these values to use joystick button numbers other than 1, 2, and 3 for ; the left, right, and middle mouse buttons. Available numbers are 1 through 32. ; Use the Joystick Test Script to find out your joystick's numbers more easily. ButtonLeft = 1 ButtonRight = 10 ; If your joystick has a POV control, you can use it as a mouse wheel. The ; following value is the number of milliseconds between turns of the wheel. ; Decrease it to have the wheel turn faster: WheelDelay = 75 ; If your system has more than one joystick, increase this value to use a joystick ; other than the first: JoystickNumber = 1 ; END OF CONFIG SECTION -- Don't change anything below this point unless you want ; to alter the basic nature of the script. #SingleInstance JoystickPrefix = %JoystickNumber%Joy Hotkey, %JoystickPrefix%%ButtonLeft%, ButtonLeft Hotkey, %JoystickPrefix%%ButtonRight%, ButtonRight ; Calculate the axis displacements that are needed to start moving the cursor: JoyThresholdUpper := 50 + JoyThreshold JoyThresholdLower := 50 - JoyThreshold if InvertYAxis YAxisMultiplier = -1 else YAxisMultiplier = 1 SetTimer, WatchJoystick, 10 ; Monitor the movement of the joystick. GetKeyState, JoyInfo, %JoystickNumber%JoyInfo IfInString, JoyInfo, P ; Joystick has POV control, so use it as a mouse wheel. SetTimer, MouseWheel, %WheelDelay% return ; End of auto-execute section. ; The subroutines below do not use KeyWait because that would sometimes trap the ; WatchJoystick quasi-thread beneath the wait-for-button-up thread, which would ; effectively prevent mouse-dragging with the joystick. ButtonLeft: SetMouseDelay, -1 ; Makes movement smoother. MouseClick, left,,, 1, 0, D ; Hold down the left mouse button. SetTimer, WaitForLeftButtonUp, 10 return ButtonRight: SetMouseDelay, -1 ; Makes movement smoother. MouseClick, right,,, 1, 0, D ; Hold down the right mouse button. SetTimer, WaitForRightButtonUp, 10 return WaitForLeftButtonUp: if GetKeyState(JoystickPrefix . ButtonLeft) return ; The button is still, down, so keep waiting. ; Otherwise, the button has been released. SetTimer, WaitForLeftButtonUp, off SetMouseDelay, -1 ; Makes movement smoother. MouseClick, left,,, 1, 0, U ; Release the mouse button. return WaitForRightButtonUp: if GetKeyState(JoystickPrefix . ButtonRight) return ; The button is still, down, so keep waiting. ; Otherwise, the button has been released. SetTimer, WaitForRightButtonUp, off MouseClick, right,,, 1, 0, U ; Release the mouse button. return WatchJoystick: MouseNeedsToBeMoved := false ; Set default. SetFormat, float, 03 GetKeyState, joyx, %JoystickNumber%JoyX GetKeyState, joyy, %JoystickNumber%JoyY if joyx > %JoyThresholdUpper% { MouseNeedsToBeMoved := true DeltaX := joyx - JoyThresholdUpper } else if joyx < %JoyThresholdLower% { MouseNeedsToBeMoved := true DeltaX := joyx - JoyThresholdLower } else DeltaX = 0 if joyy > %JoyThresholdUpper% { MouseNeedsToBeMoved := true DeltaY := joyy - JoyThresholdUpper } else if joyy < %JoyThresholdLower% { MouseNeedsToBeMoved := true DeltaY := joyy - JoyThresholdLower } else DeltaY = 0 if MouseNeedsToBeMoved { SetMouseDelay, -1 ; Makes movement smoother. MouseMove, DeltaX * JoyMultiplier, DeltaY * JoyMultiplier * YAxisMultiplier, 0, R } return MouseWheel: GetKeyState, JoyPOV, %JoystickNumber%JoyPOV if JoyPOV = -1 ; No angle. return if (JoyPOV > 31500 or JoyPOV < 4500) ; Forward Send {WheelUp} else if JoyPOV between 13500 and 22500 ; Back Send {WheelDown} joy2:: mousemove, 933, 686, 0 joy3:: mousemove, 20, 500, 0 joy4:: mousemove, 815, 685, 0 joy8:: click, 550, 100, 1 joy6:: MouseClickDrag, Left, 935, 635, 1065, 635, 0 joy5:: mouseclickdrag, left, 912, 640, 45, 665, 0 joy7:: click, 1000, 90, 1 joy9:: click, 30, 60, 1 f5:: mousemove, 0, -12, 0, r f6:: mousemove, 0, 12, 0, r f7:: mousemove, -27, 0, 0, r f8:: mousemove, 27, 0, 0, r f1:: click, -20, 200 f2:: click, 1260, 200 f3:: click, 920, 635, 1 f4:: click, 1070, 640, 1 |
|
|