Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;If you use this, you have to use absolute screen coordinates.
- CoordMode, Mouse, Screen
- ;Suppose a 100x100 px bounding box for your game inventory.
- ;Eg., from (500, 500) to (600, 600)
- w::
- {
- ;Get current Mouse coords
- MouseGetPos, xCurrent ,yCurrent
- ;Calculate future Mouse coords
- xMoved := xCurrent
- yMoved := yCurrent - 35
- ;Check if the future mouse postion will be
- ;below the top border of your bounding box,
- ;aka still inside it, after it has moved.
- ;If so, proceed and move the mouse,
- ;otherwise do nothing.
- MouseGetPos, CoordXRec, CoordYRec
- MouseMove, xMoved, yMoved
- if(yMoved < 503 && yMoved > 350 && yMoved > 360){
- MouseMove 1846, 166
- }
- if(yMoved < 145){
- MouseMove, %CoordXRec%, %CoordYRec%, 0
- }
- if(yMoved < 718 && yMoved < 720 && yMoved > 680){
- MouseMove 1771, 671
- }
- return
- }
- s::
- {
- ;Get current Mouse coords
- MouseGetPos, xCurrent ,yCurrent
- ;Calculate future Mouse coords
- xMoved := xCurrent
- yMoved := yCurrent +35
- ;Check if the future mouse postion will be
- ;below the top border of your bounding box,
- ;aka still inside it, after it has moved.
- ;If so, proceed and move the mouse,
- ;otherwise do nothing.
- MouseMove, xMoved, yMoved
- if(yMoved > 285 && yMoved < 360){
- MouseMove 1773, 526
- }
- if(yMoved > 697 && yMoved < 715){
- MouseMove 1772, 736
- }
- return
- }
- a::
- {
- ;Get current Mouse coords
- MouseGetPos, xCurrent ,yCurrent
- ;Calculate future Mouse coords
- xMoved := xCurrent -40
- yMoved := yCurrent
- ;Check if the future mouse postion will be
- ;below the top border of your bounding box,
- ;aka still inside it, after it has moved.
- ;If so, proceed and move the mouse,
- ;otherwise do nothing.
- if (xMoved > 1740) {
- MouseMove, xMoved, yMoved
- }
- return
- }
- d::
- {
- ;Get current Mouse coords
- MouseGetPos, xCurrent ,yCurrent
- ;Calculate future Mouse coords
- xMoved := xCurrent +40
- yMoved := yCurrent
- ;Check if the future mouse postion will be
- ;below the top border of your bounding box,
- ;aka still inside it, after it has moved.
- ;If so, proceed and move the mouse,
- ;otherwise do nothing.
- if (xMoved < 1917) {
- MouseMove, xMoved, yMoved
- }
- return
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement