Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance, force
- DetectHiddenWindows, on
- Thread, Interrupt, 0
- angle := 0
- sX := 0
- sY := 0
- isLeftClick = 0
- setTimer, checkMouse, 1
- checkMouse:
- if WinActive("TITAN SOULS")
- {
- MouseGetPos, mX, mY
- WinGetPos,,,gW,gH
- if (Abs(mX - gW/2) > 5 or Abs(mY - gH/2) > 5)
- {
- sX := gW/2 - mX
- sY := gH/2 - mY
- angle := ATan(sY/sX)
- if (sX < 0)
- {
- if (sY >= 0)
- angle += 3.14159265358979
- else
- angle -= 3.14159265358979
- }
- angle *= 180/3.14159265358979
- ;Tooltip, % angle
- }
- Key1p = %Key1%
- Key1 =
- Key2p = %Key2%
- Key2 =
- if (isLeftClick = 1) {
- if angle between -67.5 and 67.5
- Key1 = Left
- if (angle > 112.5 or angle < -112.5)
- Key1 = Right
- if angle between -157.5 and -22.5
- Key2 = Down
- if angle between 22.5 and 157.5
- Key2 = Up
- }
- if (Key1 <> Key1p)
- {
- if Key1 <>
- Send {%Key1% down}
- if Key1p <>
- Send {%Key1p% up}
- }
- if (Key2 <> Key2p)
- {
- if Key2 <>
- Send {%Key2% down}
- if Key2p <>
- Send {%Key2p% up}
- }
- MouseMove, gW/2, gH/2
- }
- return
- +z::
- ExitApp
- return
- #IfWinActive TITAN SOULS
- LButton::
- send {c down}
- isLeftClick := 1
- return
- LButton up::
- send {c up}
- isLeftClick := 0
- return
- RButton::x
- Space::x
- w::Up
- s::Down
- a::Left
- d::Right
- ; If you want to add your own keybindings, you can just put them here, following suit.
- ; The following code binds numpad2 and j to the x key. You can just add on to it.
- ; Be sure to add the 'up' key, as well: "j up" releases the x key when you release j.
- Numpad2::
- j::
- send {x down}
- return
- Numpad2 up::
- j up::
- send {x up}
- return
- Numpad3::
- k::
- send {c down}
- return
- Numpad3 up::
- k up::
- send {c up}
- return
Advertisement
Add Comment
Please, Sign In to add comment