Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A complex script question
#1
So I've messed with quickmacros for a good month or so now, I've got down the basics of creating, and writing a function. I'm confused on something though, I'm trying to make a type of macro that when the mouse is set at a certain part of the screen "the center" it presses J. I've tried to make this, but I've failed I'm not sure what I'm doing wrong, or if this macro can even be made. The coordinates for the center path are "513, 385" basically when the mouse gets to that coordinate i just want it to press/spam the letter J. Is this possible?

I'm trying to make some simple commands for a screen dot I made, so I can go through the screens I made easily. Thank you for all the help I really like this program
#2
Function A_complex_script_question
Code:
Copy      Help
function nCode wParam MSLLHOOKSTRUCT&h

;Run this function.
;Move mouse to the point to test.
;Run this function again to end it.
;Change the <CHANGE> parts if need, and run again.


if getopt(nargs)=0 ;;if this function runs not as a hook function
,if getopt(nthreads)>1 ;;if thread running, end it and exit
,,shutdown -6 0 "A_complex_script_question"
,,ret
,
,RECT- r; SetRect &r 510 382 516 388 ;;<CHANGE>
,
,;run thread: add tray icon, set mouse hook, and wait
,AddTrayIcon "$qm$\mouse.ico" "A_complex_script_question"
,int hh=SetWindowsHookEx(WH_MOUSE_LL &A_complex_script_question _hinst 0)
,MessageLoop
,UnhookWindowsHookEx hh
,ret

;---- this code runs on each mouse event while the thread is running -----

if(h.flags&LLMHF_INJECTED) goto gNH ;;ignore macro-generated mouse events

sel wParam
,case WM_MOUSEMOVE
,if PtInRect(&r h.pt.x h.pt.y)
,,out "mouse is at a certain part of the screen" ;;<CHANGE>

;gNH
ret CallNextHookEx(0 nCode wParam &h)


Forum Jump:


Users browsing this thread: 1 Guest(s)