Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; AutoHotkey Version: 1.x
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- ;SetMouseDelay, 2
- #SingleInstance Force
- #Persistent
- #UseHook
- #InstallKeybdHook
- ; ##################################################
- ;
- ; Written by REZEL (aka Treplos / Atavus)
- ; My SKYRIM Clikey Script -- with user input!!
- ;
- ; For faster, automatic bulk/mass activities like:
- ; Forging / Smelting / Wood Cutting / Mining, etc.
- ; or anything that needs repeated clicks in-game.
- ;
- ; ##################################################
- ; ----------------------------------------
- ; Create GUI
- ; ----------------------------------------
- ; Create Hotkey lines
- GUI, Font, c0000CC s10 w500, Verdana ; verdana, blue, size 10, bold 500
- GUI, Add, Text,, HOTKEY to start/stop script? (default END)
- GUI, Font, cBlack s9, Verdana ; verdana, black, size 9
- GUI, Add, Hotkey, w200 vHOTKEY1, END
- GUI, Font, cBlack s1, Verdana
- GUI, Add, Text
- ; Create Loop lines
- GUI, Font, c0000CC s10 w500, Verdana
- GUI, Add, Text,, Number of script LOOPs? (default 500)
- GUI, Font, cBlack s9, Verdana
- GUI, Add, Edit, Number Limit4 r1 w60 vLOOPTIMES, 500
- GUI, Font, cBlack s1, Verdana
- GUI, Add, Text
- ; Create 1st Key lines
- GUI, Font, c0000CC s10 w500, Verdana
- GUI, Add, Text,, 1ST KEY to spam? (default E)
- GUI, Font, cBlack s9, Verdana
- GUI, Add, Edit, Limit2 r1 w40 vKEY1, E
- GUI, Font, cBlack s1, Verdana
- GUI, Add, Text
- ; Create 2nd Key lines
- GUI, Font, c0000CC s10 w500, Verdana
- GUI, Add, Text,, 2ND KEY to spam? (default Y)
- GUI, Font, cBlack s9, Verdana
- GUI, Add, Edit, Limit2 r1 w40 vKEY2, Y
- GUI, Font, cBlack s1, Verdana
- GUI, Add, Text
- ; Create Pause lines
- GUI, Font, c0000CC s10 w500, Verdana
- GUI, Add, Text,, PAUSE duration, in ms, after each key press? (default 20)
- GUI, Font, cBlack s9, Verdana
- GUI, Add, Edit, Number Limit4 r1 w50 vPAUSE1, 20
- ; Create Save button
- GUI, Add, Button, vMyOkButton w100 gButtonOK Default, Save
- GUI +resize
- ; Show GUI and title
- GUI, Show, AutoSize Center, My Clikey Script :D (By Rezel / Treplos)
- return
- ; ----------------------------------------
- ; Move Save button to middle
- ; ----------------------------------------
- GUISize:
- WinGetPos,,, Width, Height, My Clikey Script :D (By Rezel / Treplos)
- Width := Width/2, XPos := Width/2
- GuiControl, Move, MyOkButton, x%XPos% w%Width%
- return
- ; ----------------------------------------
- ; Terminate script on exit action
- ; ----------------------------------------
- GuiEscape: ; if you press Escape on the GUI,
- GuiClose: ; if you press X to close the GUI,
- ButtonCancel: ; if you Close the Button,
- FileExit: ; if you Exit the file,
- ExitApp ; then script will terminate.
- ; ----------------------------------------
- ; Store user input into variables if OK
- ; ----------------------------------------
- ButtonOK:
- GUI, Submit
- ; ----------------------------------------
- ; Display success box
- ; ----------------------------------------
- MsgBox, 0, Woot !!,
- ( LTrim
- Your input is saved.
- You can now start the script.
- \o/ Hi 5 \o/
- )
- ; ----------------------------------------
- ; Assign HOTKEY
- ; ----------------------------------------
- Hotkey, %HOTKEY1%, MyHotKey, Toggle
- Return
- ; ----------------------------------------
- ; Check if Skyrim is on and activate it
- ; ----------------------------------------
- ;If WinExist("ahk_class Skyrim") ; if game is found,
- ;{ ; <-- Open bracket for Game Check
- ; WinActivate ; then, activate game window.
- ; ----------------------------------------
- ; Start of script and loop
- ; ----------------------------------------
- MyHotKey: ; press HOTKEY to start script.
- Suspend on ; <-- disable non-protected hotkeys.
- ; the suspend on command insures that the key won't
- ; retrigger again as a hotkey because it's going inside
- ; to be used the loop to break out.
- Keywait, End ; <-- wait for the key to be released.
- ; DEBUGG: ; uncomment KeyHistory to track key presses.
- ; KeyHistory ; display the history info in a window.
- Sleep 250 ; DO NOT CHANGE ; pause for ### ms.
- Loop, %LOOPTIMES% ; loop for ### time(s).
- { ; >> start loop
- GetKeyState, State, %HOTKEY1%, P ; check HOTKEY state,
- If State = D ; if HOTKEY is presssed down,
- Break ; stop script, else
- ; Sleep %PAUSE1% ; pause for ### ms.
- Send %KEY1% ; click KEY1.
- Sleep %PAUSE1% ; pause for ### ms.
- Send %KEY2% ; click KEY2.
- } ; << end loop
- Suspend Off ; <-- re-enable all the suspended hotkeys.
- Return ; <-- and exit the routine.
- ; ----------------------------------------
- ; End of script and loop
- ; ----------------------------------------
- ;} ; --> Close bracket for Game Check.
- ;else MsgBox, Error: Skyrim not found! ; if game not found, then show error.
- ExitApp ; terminate script.
Advertisement
Add Comment
Please, Sign In to add comment