Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv
- #Persistent
- #SingleInstance Force
- SetBatchLines, -1
- SendMode Input
- Coordmode, Mouse, Screen
- Hotkey, ^1, Exit
- Hotkey, ^2, PauseScript
- PauseScript(){
- Suspend
- }
- global tolerance := 10
- global timerDelay := 40
- global keyRepeatDelay := 75
- global KeysArray := {Q:{X:431, Y:338}
- , W:{X:555, Y:338}
- , E:{X:673, Y:338}
- , R:{X:797, Y:338}
- , T:{X:913, Y:338}
- , Y:{X:1035, Y:338}
- , U:{X:1146, Y:338}
- , I:{X:1252, Y:338}
- , O:{X:1356, Y:338}
- , P:{X:1474, Y:338}
- , A:{X:507, Y:559}
- , S:{X:623, Y:559}
- , D:{X:773, Y:559}
- , F:{X:865, Y:559}
- , G:{X:960, Y:559}
- , H:{X:1089, Y:559}
- , J:{X:1218, Y:559}
- , K:{X:1336, Y:559}
- , L:{X:1436, Y:559}
- , Z:{X:602, Y:736}
- , X:{X:743, Y:736}
- , C:{X:849, Y:736}
- , V:{X:972, Y:736}
- , B:{X:1107, Y:736}
- , N:{X:1223, Y:736}
- , M:{X:1323, Y:736}
- , BackSpace:{X:1341, Y:989}
- , Space:{X:1141, Y:989}
- , Enter:{X:1579, Y:989}
- , Escape:{X:340, Y:989}}
- ;tempValue := KeysArray["Q"]["X"]
- ;MsgBox, %tempValue%
- global WidthRatio := A_ScreenWidth/1920
- global HeightRatio := A_ScreenHeight/1080
- global BufferedPresses := []
- global key := ""
- Exit(){
- ExitApp
- }
- CheckIfMousePositionIsReached(mouseX, mouseY){
- Loop, {
- MouseGetPos, pX, pY
- if((pX - tolerance <= mouseX and pX + tolerance >= mouseX) and (pY - tolerance <= mouseY and pY + tolerance >= mouseY)){
- break
- }
- else{
- MouseMove, mouseX, MouseY, 0
- }
- ;Tooltip, %pX%.%pY%
- }
- }
- ClickMouseLeft(){
- Sleep, %timerDelay%
- Click, Down
- Sleep, %timerDelay%
- Click, Up
- }
- ScreenKeyPress(key_X, key_Y){
- ;MsgBox, %key_X%.%key_Y%
- MouseMove key_X, key_Y, 0
- CheckIfMousePositionIsReached(key_X,key_Y)
- ClickMouseLeft()
- }
- BufferKeyPress(keyPressed){
- BufferedPresses.Push(keyPressed)
- }
- SetTimer, CheckBufferKeysPressed, 10
- CheckBufferKeysPressed(){
- maxValue := BufferedPresses.MaxIndex()
- if(maxValue > 0){
- keyPressed := BufferedPresses[1]
- ScreenKeyPress(KeysArray[keyPressed]["X"]*WidthRatio,KeysArray[keyPressed]["Y"]*HeightRatio)
- removed := BufferedPresses.RemoveAt(1)
- ;Tooltip, %removed%
- }
- }
- CheckThisHotKeyToString(){
- key = %A_ThisHotKey%
- StringUpper, key, key
- }
- q::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- w::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- e::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- r::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- t::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- y::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- u::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- i::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- o::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- p::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- a::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- s::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- d::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- f::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- g::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- h::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- j::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- k::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- l::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- z::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- x::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- c::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- v::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- b::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- n::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- m::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- Enter::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- BackSpace::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- Escape::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
- Space::
- CheckThisHotKeyToString()
- BufferKeyPress(key)
- Sleep, %keyRepeatDelay%
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement