Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Requires AutoHotkey v2.0
- #InputLevel 1
- #SingleInstance Force
- PID := DllCall("GetCurrentProcessId")
- ProcessSetPriority "High", PID
- A_HotkeyInterval := 0
- NewMouseSpeeder := MouseSpeeder()
- CapsLock::{
- NewMouseSpeeder.updateMouseSpeed()
- }
- ^i::{
- NewMouseSpeeder.increaseMultiplier()
- NewMouseSpeeder.showUpdate()
- }
- ^d::{
- NewMouseSpeeder.decreaseMultiplier()
- NewMouseSpeeder.showUpdate()
- }
- +CapsLock:: Reload
- ^CapsLock:: ExitApp
- class MouseSpeeder {
- oldX := 0
- oldY := 0
- newX := 0
- newY := 0
- multiplier := 1.25
- increaseMultiplier(){
- this.multiplier := Round(this.multiplier + 0.010000, 2)
- }
- decreaseMultiplier(){
- if(this.multiplier > 1.01){
- this.multiplier := Round(this.multiplier - 0.010000, 2)
- }
- }
- showUpdate(){
- Tooltip Format("Speed: {1}", this.multiplier)
- Sleep 200
- Tooltip
- }
- updateMouseSpeed(){
- Loop {
- if (A_Index = 1){
- this.oldX := 0
- this.oldY := 0
- }
- Sleep 1
- MouseGetPos &x, &y
- this.newX := x
- this.newY := y
- CoordMode "Mouse", "Screen"
- diffX := this.newX-this.oldX
- diffY := this.newY-this.oldY
- MouseMove this.newX+(diffX*this.multiplier), this.newY+(diffY*this.multiplier)
- MouseGetPos &x, &y
- this.oldX := x
- this.oldY := y
- ;Tooltip Format("oldX: {1}, oldY: {2}`nnewX: {3}, newY: {4}", this.oldx, this.oldy, this.newX, this.newY)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement