I think he has the most experience with AHK-scripts, maybe he wants to help you @ll1312ll
I've never tried AHK but I've taken a few java classes at my college so know the basics of programming.
What im trying to make.
Step 1, let user select a location on the screen to lock ( for use on realm you would lock the location of the x on your swf)
Step 2, let the user select a hotkey to correspond to left mouse click, when desired hotkey is held mouse click is held then moved to the center of the screen.
Step 3, when desired hotkey is let go stop holding left mouse click
Not really looking for anyone too just give me the answer, just some tips on ahk before I start would be greatly appreciated.
I'll put pastebin's of the source as I'm going.
Last edited by OblivionPO; 04-26-2016 at 02:46 PM.
I think he has the most experience with AHK-scripts, maybe he wants to help you @ll1312ll
"They say the best weapon is one you never have to fire.
I respectfully disagree.
I prefer the weapon you only have to fire once."
~ Tony Stark
ll1312ll (04-26-2016),OblivionPO (04-26-2016)
Thanks
@OblivionPO
Im not sure if i got your problem right, english is not my first language.
and i have not worked with ahk a while but i try my best.
example code:
F9::
{
MouseGetPos,x,y
sleep, 5000
MouseMove %x%, %y%
}
this code means if you press F9 it gets the mouse position into variables x and y
than sleep 5sec
and than move the mouse back to old position
Ahk has also some easy to use comands to check if the mousebutton is pressed down:
GetKeyState, State, LButton, P
If State = D # D means down
and now let a loop permacheck for the button:
example:
F9::
MouseGetPos,x,y
loop
{
sleep, 5000
GetKeyState, State, LButton, P
If State != D
{
MouseMove %x%, %y%
break
}
}
exitapp
When f9 is pressed this code gets the mouseposition and than checks every 5 seconds if the mousebutton is still down
and if its not down anymore move the mouse back.
Hope this helped you a bit
OblivionPO (05-01-2016)
1- MouseGetPos, using the active window's coords(it does that by default so don't worry)
2- Holding keys down:
Send W : it presses the W a single time
Send {W down} : holds the W key down
Send {W up} : releases the W key
KeyWait W : waits for W to be pressed/released to continue
Making the user choose his X location with Alt + T:
Using the letter T as our hotkey:Code:!T:: MouseGetPos, coordx, coordy return
You may tweak it a bit. I don't think we need to make the user choose the X location everytime, just find the default one and try to put it directly there without variables.Code:T:: MouseMove, coordx, coordy ; moves cursor to the X Send {LButton down} ; holds click MouseMove, 200, 200 ; any coord in the middle of the screen KeyWait, T ; waits for the T to be released Send {LButton up} ; releases click return
edit: lol got ninja'd. I think I made mine simpler, though - the KeyWait makes the usage of loopchecking unnecessary.
Last edited by Plus22; 04-26-2016 at 08:22 PM.
just stop. come with me son.
OblivionPO (05-01-2016)
Plus is right i forgot about keywait should be even simpler with that.
Edit:
Bonustip:
never forget to set an exit hotkey in your test scripts.
like:
F12::
exitapp
because ahk can suck a lot sometimes. The script you want for example could bind your mouse to the center of the screen with just one simple syntax mistake.
U can search for my old releases i just tested 'ASSCursor' and it still works its marked as outdated..
It just dont change the cursor size anymore.. but i think its a windows10 problem.
And check for my autotradebot it uses the mouse a lot and i hope i coded it understandable for beginners..
Maybe it helps u getting the basics.
Last edited by ll1312ll; 04-26-2016 at 08:53 PM.
OblivionPO (05-01-2016)
OblivionPO (05-01-2016)
Ugh i cant tag you guys cus I'm not allowed to for some reason, So ill have to thank you guys separately. I really appreciate you helping me on this, and pointing me to what I need to know to make it work. I'm sorry I havent posted my source yet I've been mad busy with midterms :c once I have something decent to show I'll show you guys what I have.
looks solved.
/closed also 7 days inactivity.
I am not a middleman nor do I buy/sell anything. If you are being contacted by someone off-site from MPGH then it's not me! Please report these to me via PM. Don't be stupid, think first.