Advertisement
EzFlow997

Super Scriblenauts Keyboard

Mar 17th, 2024 (edited)
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. #Persistent
  3. #SingleInstance Force
  4. SetBatchLines, -1
  5. SendMode Input
  6.  
  7. Coordmode, Mouse, Screen
  8.  
  9. Hotkey, ^1, Exit
  10. Hotkey, ^2, PauseScript
  11.  
  12. PauseScript(){
  13.     Suspend
  14. }
  15.  
  16. global tolerance := 10
  17. global timerDelay := 40
  18.  
  19. global keyRepeatDelay := 75
  20.  
  21. global KeysArray := {Q:{X:431, Y:338}
  22.                             , W:{X:555, Y:338}
  23.                             , E:{X:673, Y:338}
  24.                             , R:{X:797, Y:338}
  25.                             , T:{X:913, Y:338}
  26.                             , Y:{X:1035, Y:338}
  27.                             , U:{X:1146, Y:338}
  28.                             , I:{X:1252, Y:338}
  29.                             , O:{X:1356, Y:338}
  30.                             , P:{X:1474, Y:338}
  31.                             , A:{X:507, Y:559}
  32.                             , S:{X:623, Y:559}
  33.                             , D:{X:773, Y:559}
  34.                             , F:{X:865, Y:559}
  35.                             , G:{X:960, Y:559}
  36.                             , H:{X:1089, Y:559}
  37.                             , J:{X:1218, Y:559}
  38.                             , K:{X:1336, Y:559}
  39.                             , L:{X:1436, Y:559}
  40.                             , Z:{X:602, Y:736}
  41.                             , X:{X:743, Y:736}
  42.                             , C:{X:849, Y:736}
  43.                             , V:{X:972, Y:736}
  44.                             , B:{X:1107, Y:736}
  45.                             , N:{X:1223, Y:736}
  46.                             , M:{X:1323, Y:736}
  47.                             , BackSpace:{X:1341, Y:989}
  48.                             , Space:{X:1141, Y:989}
  49.                             , Enter:{X:1579, Y:989}
  50.                             , Escape:{X:340, Y:989}}
  51.  
  52. ;tempValue := KeysArray["Q"]["X"]
  53. ;MsgBox, %tempValue%
  54.  
  55.  
  56. global WidthRatio := A_ScreenWidth/1920
  57. global HeightRatio := A_ScreenHeight/1080
  58.  
  59. global BufferedPresses := []
  60. global key := ""
  61.  
  62. Exit(){
  63.     ExitApp
  64. }
  65.  
  66. CheckIfMousePositionIsReached(mouseX, mouseY){
  67.     Loop, {
  68.         MouseGetPos, pX, pY
  69.         if((pX - tolerance <= mouseX and pX + tolerance >= mouseX) and (pY - tolerance <= mouseY and pY + tolerance >= mouseY)){
  70.             break
  71.         }
  72.         else{
  73.             MouseMove, mouseX, MouseY, 0
  74.         }
  75.         ;Tooltip, %pX%.%pY%
  76.     }  
  77. }
  78.  
  79. ClickMouseLeft(){
  80.     Sleep, %timerDelay%
  81.     Click, Down
  82.     Sleep, %timerDelay%
  83.     Click, Up
  84. }
  85.  
  86. ScreenKeyPress(key_X, key_Y){
  87.     ;MsgBox, %key_X%.%key_Y%
  88.     MouseMove key_X, key_Y, 0
  89.     CheckIfMousePositionIsReached(key_X,key_Y)
  90.     ClickMouseLeft()
  91. }
  92.  
  93. BufferKeyPress(keyPressed){
  94.     BufferedPresses.Push(keyPressed)
  95. }
  96.  
  97. SetTimer, CheckBufferKeysPressed, 10
  98. CheckBufferKeysPressed(){
  99.     maxValue := BufferedPresses.MaxIndex()
  100.     if(maxValue > 0){
  101.         keyPressed := BufferedPresses[1]
  102.         ScreenKeyPress(KeysArray[keyPressed]["X"]*WidthRatio,KeysArray[keyPressed]["Y"]*HeightRatio)
  103.         removed := BufferedPresses.RemoveAt(1)
  104.         ;Tooltip, %removed%
  105.     }
  106. }
  107.  
  108. CheckThisHotKeyToString(){
  109.         key = %A_ThisHotKey%
  110.     StringUpper, key, key
  111. }
  112.  
  113. q::
  114.     CheckThisHotKeyToString()
  115.     BufferKeyPress(key)
  116.     Sleep, %keyRepeatDelay%
  117. return
  118.  
  119. w::
  120.     CheckThisHotKeyToString()
  121.     BufferKeyPress(key)
  122.     Sleep, %keyRepeatDelay%
  123. return
  124.  
  125. e::
  126.     CheckThisHotKeyToString()
  127.     BufferKeyPress(key)
  128.     Sleep, %keyRepeatDelay%
  129. return
  130.  
  131. r::
  132.     CheckThisHotKeyToString()
  133.     BufferKeyPress(key)
  134.     Sleep, %keyRepeatDelay%
  135. return
  136.  
  137. t::
  138.     CheckThisHotKeyToString()
  139.     BufferKeyPress(key)
  140.     Sleep, %keyRepeatDelay%
  141. return
  142.  
  143. y::
  144.     CheckThisHotKeyToString()
  145.     BufferKeyPress(key)
  146.     Sleep, %keyRepeatDelay%
  147. return
  148.  
  149. u::
  150.     CheckThisHotKeyToString()
  151.     BufferKeyPress(key)
  152.     Sleep, %keyRepeatDelay%
  153. return
  154.  
  155. i::
  156.     CheckThisHotKeyToString()
  157.     BufferKeyPress(key)
  158.     Sleep, %keyRepeatDelay%
  159. return
  160.  
  161. o::
  162.     CheckThisHotKeyToString()
  163.     BufferKeyPress(key)
  164.     Sleep, %keyRepeatDelay%
  165. return
  166.  
  167. p::
  168.     CheckThisHotKeyToString()
  169.     BufferKeyPress(key)
  170.     Sleep, %keyRepeatDelay%
  171. return
  172.  
  173. a::
  174.     CheckThisHotKeyToString()
  175.     BufferKeyPress(key)
  176.     Sleep, %keyRepeatDelay%
  177. return
  178.  
  179. s::
  180.     CheckThisHotKeyToString()
  181.     BufferKeyPress(key)
  182.     Sleep, %keyRepeatDelay%
  183. return
  184.  
  185. d::
  186.     CheckThisHotKeyToString()
  187.     BufferKeyPress(key)
  188.     Sleep, %keyRepeatDelay%
  189. return
  190.  
  191. f::
  192.     CheckThisHotKeyToString()
  193.     BufferKeyPress(key)
  194.     Sleep, %keyRepeatDelay%
  195. return
  196.  
  197. g::
  198.     CheckThisHotKeyToString()
  199.     BufferKeyPress(key)
  200.     Sleep, %keyRepeatDelay%
  201. return
  202.  
  203. h::
  204.     CheckThisHotKeyToString()
  205.     BufferKeyPress(key)
  206.     Sleep, %keyRepeatDelay%
  207. return
  208.  
  209. j::
  210.     CheckThisHotKeyToString()
  211.     BufferKeyPress(key)
  212.     Sleep, %keyRepeatDelay%
  213. return
  214.  
  215. k::
  216.     CheckThisHotKeyToString()
  217.     BufferKeyPress(key)
  218.     Sleep, %keyRepeatDelay%
  219. return
  220.  
  221. l::
  222.     CheckThisHotKeyToString()
  223.     BufferKeyPress(key)
  224.     Sleep, %keyRepeatDelay%
  225. return
  226.  
  227. z::
  228.     CheckThisHotKeyToString()
  229.     BufferKeyPress(key)
  230.     Sleep, %keyRepeatDelay%
  231. return
  232.  
  233. x::
  234.     CheckThisHotKeyToString()
  235.     BufferKeyPress(key)
  236.     Sleep, %keyRepeatDelay%
  237. return
  238.  
  239. c::
  240.     CheckThisHotKeyToString()
  241.     BufferKeyPress(key)
  242.     Sleep, %keyRepeatDelay%
  243. return
  244.  
  245. v::
  246.     CheckThisHotKeyToString()
  247.     BufferKeyPress(key)
  248.     Sleep, %keyRepeatDelay%
  249. return
  250.  
  251. b::
  252.     CheckThisHotKeyToString()
  253.     BufferKeyPress(key)
  254.     Sleep, %keyRepeatDelay%
  255. return
  256.  
  257. n::
  258.     CheckThisHotKeyToString()
  259.     BufferKeyPress(key)
  260.     Sleep, %keyRepeatDelay%
  261. return
  262.  
  263. m::
  264.     CheckThisHotKeyToString()
  265.     BufferKeyPress(key)
  266.     Sleep, %keyRepeatDelay%
  267. return
  268.  
  269. Enter::
  270.     CheckThisHotKeyToString()
  271.     BufferKeyPress(key)
  272.     Sleep, %keyRepeatDelay%
  273. return
  274.  
  275. BackSpace::
  276.     CheckThisHotKeyToString()
  277.     BufferKeyPress(key)
  278.     Sleep, %keyRepeatDelay%
  279. return
  280.  
  281. Escape::
  282.     CheckThisHotKeyToString()
  283.     BufferKeyPress(key)
  284.     Sleep, %keyRepeatDelay%
  285. return
  286.  
  287. Space::
  288.     CheckThisHotKeyToString()
  289.     BufferKeyPress(key)
  290.     Sleep, %keyRepeatDelay%
  291. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement