Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv
- #singleinstance force
- Process, Priority, , High
- SetWorkingDir, %A_ScriptDir%
- file = %A_ScriptDir%\settings.ini
- loop, 28
- {
- IniRead, Inv%A_Index%, settings.ini, Foodsettings, Inv%A_Index%
- }
- loop, 28
- {
- IniRead, Inv2k%A_Index%, settings.ini, Foodsettings, Inv2k%A_Index%
- }
- loop, 28
- {
- IniRead, Inv3k%A_Index%, settings.ini, Foodsettings, Inv3k%A_Index%
- }
- loop, 28
- {
- IniRead, Inv4k%A_Index%, settings.ini, Foodsettings, Inv4k%A_Index%
- }
- loop, 28
- {
- IniRead, Inv5k%A_Index%, settings.ini, Foodsettings, Inv5k%A_Index%
- }
- IniRead, prot1, settings.ini, settings, prot1
- IniRead, prot2, settings.ini, settings, prot2
- IniRead, prot3, settings.ini, settings, prot3
- IniRead, prot4, settings.ini, settings, prot4
- IniRead, prot5, settings.ini, settings, prot5
- IniRead, prot6, settings.ini, settings, prot6
- IniRead, prot7, settings.ini, settings, prot7
- IniRead, arm1, settings.ini, settings, arm1
- IniRead, arm2, settings.ini, settings, arm2
- IniRead, arm3, settings.ini, settings, arm3
- IniRead, arm4, settings.ini, settings, arm4
- IniRead, arm5, settings.ini, settings, arm5
- IniRead, arm6, settings.ini, settings, arm6
- IniRead, arm7, settings.ini, settings, arm7
- IniRead, Steelskins, settings.ini, settings, Steelskins
- IniRead, mysticMight, settings.ini, settings, mysticMight
- IniRead, ItemProtects, settings.ini, settings, ItemProtects
- IniRead, Radio1, settings.ini, Armors, Radio1
- IniRead, Radio2, settings.ini, Armors, Radio2
- IniRead, Radio3, settings.ini, Armors, Radio3
- IniRead, Radio4, settings.ini, Armors, Radio4
- IniRead, Invs, settings.ini, Icons, Invs
- IniRead, Origin, settings.ini, Icons, origin
- IniRead, Frunning, settings.ini, settings, Frunning
- IniRead, Fsleep, settings.ini, settings, Fsleep
- IniRead, Fbinds, settings.ini, settings, Fbinds
- IniRead, Un1, settings.ini, settings, Un1
- IniRead, Un2, settings.ini, settings, Un2
- IniRead, Un3, settings.ini, settings, Un3
- IniRead, Un4, settings.ini, settings, Un4
- IniRead, Un5, settings.ini, settings, Un5
- IniRead, Un6, settings.ini, settings, Un6
- IniRead, Un7, settings.ini, settings, Un7
- Sleep1= 50 ; Random Range Of sleep time
- Sleep2= 100 ; Used after pressing the F-Key to switch to run/prayer tab.
- ;Mouse Positions X/Y Coordinates For Orion, AB For RSclient, change them if needed.
- X1=684 ; melee prayer
- Y1=396 ; mouse position
- X2=643 ; range prayer
- y2=396 ; mouse position
- x3=608 ; mage prayer
- y3=396 ; mouse position
- x4=681 ; steel skin
- y4=359 ; mouse position
- x5=570 ; item protect
- y5=354 ; mouse position
- x6=571 ; mystic might
- y6=430 ; mouse position
- x7=639 ; final Mouse Position
- y7=237 ; after finishing prayer clicks
- x8=583 ; Run icon
- y8=191 ; mouse position
- x9=750 ; clicks Mouse Top right of screen
- y9=197 ; to cancel "cast bind" before activating prayer.
- X10=560 ; Quicker minimap orb icon cords
- y10=165 ; Clicks quick prayer
- x11=582 ; Invslot No.1 - Armor
- y11=280 ; mouse posion
- x12=625 ; InvSlot No.2 - Armor
- y12=280 ; mouse position
- x13=665 ; InvSlot No.3 - Armor
- y13=280 ; mouse position
- x14=707 ; InvSlot No.4 - Armor
- y14=280 ; mouse position
- X15=653 ; Platebody Equip - armor
- Y15=359 ; mouse position
- X16=653 ; Platelgs Equip - Armor
- Y16=395 ; mouse position
- X17=700 ; kite - armor
- Y17=350 ; mouse position
- X18=650 ; helm - armor
- Y18=279 ; mouse position
- YI5=1 : mouse position
- ;RSClient Coods
- XR1=694
- YR1=369
- XR2=654
- YR2=369
- XR3=618
- YR3=369
- XR4=694
- YR4=332
- XR5=580
- YR5=335
- XR6=582
- YR6=410
- XR7=656
- YR7=208
- XR8=595
- YR8=160
- XR9=763
- YR9=174
- xr10=571
- yr10=122
- xr11=591
- yr11=250
- xr12=633
- yr12=250
- xr13=675
- yr13=250
- xr14=715
- yr14=250
- XR15=650
- YR15=330
- XR16=650
- YR16=366
- XR17=700
- YR17=330
- XR18=650
- YR18=255
- offset=2
- YRi5=285
- YRI9=325
- YRi13=360
- YRi17=390
- YRI21=427
- YR25=468
- goto ^g
- return
- ^g::
- GUI Destroy
- GoSub GUI
- return
- Gui:
- Gui, Add, Button, x6 y7 w100 h20 , About
- Gui, Add, Button, x6 y27 w100 h20 , Resize RSclient
- Gui, Font, S10 CDefault, Verdana
- Gui, Add, Button, x5 y100 w100 h25 , Key setup
- Gui, Add, Text, x516 y107 w90 h20 , Protections:
- Gui, Add, Text, x116 y107 w20 h20 , F1
- Gui, Add, Text, x196 y107 w20 h20 , F2
- Gui, Add, Text, x256 y107 w20 h20 , F3
- Gui, Font, S8 CDefault, Verdana
- Gui, Font, S6 CDefault, Verdana
- Gui, Font, S7 CDefault, Verdana
- Gui, Add, DropDownList, x96 y137 w70 h90 vF1downs choose1 , Quick|Melee|Range|Mage|None
- Gui, Add, CheckBox, x116 y167 w10 h10 vProt1 checked%prot1% , Protections f1
- Gui, Add, CheckBox, x116 y197 w10 h10 vArm1 checked%arm1%, Armor equip f1
- Gui, Add, Text, x6 y137 w80 h20 , Prayer type:
- Gui, Add, DropDownList, x176 y137 w60 h130 vF2downs choose2 , Quick|Melee|Range|Mage|None
- Gui, Add, CheckBox, x196 y167 w10 h10 vprot2 checked%prot2%, Protections f2
- Gui, Add, CheckBox, x196 y197 w10 h10 varm2 checked%arm2%, Armor equipf2
- Gui, Add, DropDownList, x236 y137 w60 h110 vF3downs choose3 , Quick|Melee|Range|Mage|None
- Gui, Add, CheckBox, x256 y167 w10 h10 vprot3 checked%prot3% , Protections f3
- Gui, Add, Text, x6 y197 w100 h20 , Equip armor equip?
- Gui, Add, CheckBox, x256 y197 w10 h10 varm3 checked%arm3%, Armor equipf3
- Gui, Add, Text, x316 y107 w20 h20 , F4
- Gui, Add, Text, x366 y107 w20 h20 , F5
- Gui, Add, Text, x416 y107 w20 h20 , F6
- Gui, Add, Text, x466 y107 w20 h20 , F7
- Gui, Add, DropDownList, x296 y137 w60 h140 vf4downs choose2, Quick|Melee|Range|Mage|None
- Gui, Add, DropDownList, x356 y137 w50 h120 vF5downs choose3, Quick|Melee|Range|Mage|None
- Gui, Add, DropDownList, x406 y137 w50 h130 vF6downs choose4, Quick|Melee|Range|Mage|None
- Gui, Add, DropDownList, x456 y137 w50 h120 vF7downs choose5, Quick|Melee|Range|Mage|None
- Gui, Add, CheckBox, x316 y167 w10 h10 vprot4 checked%prot4%, Protections f4
- Gui, Add, CheckBox, x366 y167 w10 h10 vprot5 checked%prot5% , Protections f5
- Gui, Add, CheckBox, x416 y167 w10 h10 vprot6 checked%prot6% , Protections f6
- Gui, Add, CheckBox, x466 y167 w10 h10 vprot7 checked%prot7%, Protections f7
- Gui, Add, CheckBox, x316 y197 w10 h10 varm4 checked%arm4%, Armor equipf4
- Gui, Add, CheckBox, x366 y197 w10 h10 varm5 checked%arm5%, Armor equipf5
- Gui, Add, CheckBox, x416 y197 w10 h10 varm6 checked%arm6%, Armor equipf6
- Gui, Add, CheckBox, x466 y197 w10 h10 varm7 checked%arm7%, Armor equipf7
- Gui, Add, Text, x496 y87 w110 h0 , Text
- Gui, Add, Text, x616 y87 w-170 h-10 , Text
- Gui, Add, Text, x146 y247 w140 h-20 , Mouse position when done
- Gui, Add, Text, x6 y257 w60 h20 , Settings:
- Gui, Add, CheckBox, x6 y287 w90 h20 vFrunning checked%Frunning%, ~ toggles run
- Gui, Add, CheckBox, x6 y317 w90 h20 vFsleep checked%Fsleep%, Sleep time
- Gui, Add, CheckBox, x6 y347 w90 h20 vFbinds checked%Fbinds%, Bind unclick
- Gui, Add, Radio, x416 y287 w60 h20 vRadio1 checked%Radio1% , One
- Gui, Add, Radio, x416 y317 w60 h20 VRadio2 checked%Radio2%, Two
- Gui, Add, Radio, x526 y287 w60 h20 VRadio3 checked%Radio3%, Three
- Gui, Add, Radio, x526 y317 w60 h20 vRadio4 checked%Radio4%, Four
- Gui, Font, S12 CDefault, Verdana
- Gui, Add, Button, x206 y357 w220 h60 , Click here when done!
- Gui, Font, S10 CDefault, Verdana
- Gui, Add, Button, x6 y397 w110 h20 , Resize RSclient
- Gui, Font, S16 CDefault, Verdana
- Gui, Add, Text, x166 y27 w280 h40 , OSRS Prayer: By Samerdl
- Gui, Font, S8 CDefault, Verdana
- Gui, Add, Text, x6 y167 w100 h20 , Use protections ?
- Gui, Add, CheckBox, x516 y197 w100 h20 vmysticMight checked%mysticmight%, Mystic might
- Gui, Font, S7 CDefault, Verdana
- Gui, Font, S8 CDefault, Verdana
- Gui, Add, CheckBox, x516 y167 w100 h20 vItemProtects checked%itemprotects%, Item protect
- Gui, Add, CheckBox, x516 y137 w100 h20 vSteelskins checked%Steelskins%, Steel skin
- Gui, Add, Text, x446 y247 w100 h20 , Armor Equpping:
- Gui, Add, Text, x156 y247 w160 h30 , Mouse position when done:
- Gui, Add, Radio, x126 y287 w80 h40 vinvs checked%invs%, Inventory icon
- Gui, Add, Radio, x256 y287 w80 h40 vOrigin checked%origin% , Original position
- Gui, Add, Button, x526 y387 w100 h30 gSave1, Save
- Gui, Add, Text, x6 y227 w100 h20 , Armor un-equip?
- Gui, Add, CheckBox, x116 y227 w10 h10 vUn1 Checked%un1%, Un1
- Gui, Add, CheckBox, x196 y227 w10 h10 vUn2 Checked%un2%, Un2
- Gui, Add, CheckBox, x256 y227 w10 h10 vUn3 Checked%un3%, Un3
- Gui, Add, CheckBox, x316 y227 w10 h10 vUn4 Checked%un4%, Un4
- Gui, Add, CheckBox, x366 y227 w10 h10 vUn5 Checked%un5%, Un5
- Gui, Add, CheckBox, x416 y227 w10 h10 vUn6 Checked%un6%, Un6
- Gui, Add, CheckBox, x466 y227 w10 h10 vUn7 Checked%un7%, un7
- Gui, Add, DropDownList, x536 y347 w70 h140 vArmUn Choose2, One|Two|Three|Four
- Gui, Font, S8 CDefault, Verdana
- Gui, Add, Text, x466 y347 w60 h20 , un-equip:
- Gui, Add, Button, x6 y377 w110 h20 , Food Setup
- ; Generated using SmartGUI Creator 4.0
- Gui, Show, x279 y148 h422 w629, New GUI Window
- Gosub, ReadConfiguration
- Return
- Save1:
- Gui, Submit, NoHide
- IniWrite, %F1downs%, %file%, DDL1, Quick|Melee|Range|Mage|None
- IniWrite, %F2downs%, %file%, DDL2, Quick|Melee|Range|Mage|None
- IniWrite, %F3downs%, %file%, DDL3, Quick|Melee|Range|Mage|None
- IniWrite, %F4downs%, %file%, DDL4, Quick|Melee|Range|Mage|None
- IniWrite, %F5downs%, %file%, DDL5, Quick|Melee|Range|Mage|None
- IniWrite, %F6downs%, %file%, DDL6, Quick|Melee|Range|Mage|None
- IniWrite, %F7downs%, %file%, DDL7, Quick|Melee|Range|Mage|None
- IniWrite, %ArmUn%, %file%, DDL8, One|Two|Three|Four
- IniWrite, %prot1%, settings.ini, settings, prot1
- IniWrite, %prot2%, settings.ini, settings, prot2
- IniWrite, %prot3%, settings.ini, settings, prot3
- IniWrite, %prot4%, settings.ini, settings, prot4
- IniWrite, %prot5%, settings.ini, settings, prot5
- IniWrite, %prot6%, settings.ini, settings, prot6
- IniWrite, %prot7%, settings.ini, settings, prot7
- IniWrite, %arm1%, settings.ini, settings, arm1
- IniWrite, %arm2%, settings.ini, settings, arm2
- IniWrite, %arm3%, settings.ini, settings, arm3
- IniWrite, %arm4%, settings.ini, settings, arm4
- IniWrite, %arm5%, settings.ini, settings, arm5
- IniWrite, %arm6%, settings.ini, settings, arm6
- IniWrite, %arm7%, settings.ini, settings, arm7
- IniWrite, %itemprotects%, settings.ini, settings, itemprotects
- IniWrite, %steelskins%, settings.ini, settings, steelskins
- IniWrite, %mysticMight%, settings.ini, settings, mysticMight
- IniWrite, %Radio1%, settings.ini, Armors, Radio1
- IniWrite, %Radio2%, settings.ini, Armors, Radio2
- IniWrite, %Radio3%, settings.ini, Armors, Radio3
- IniWrite, %Radio4%, settings.ini, Armors, Radio4
- IniWrite, %invs%, settings.ini, Icons, invs
- IniWrite, %origin%, settings.ini, Icons,origin
- IniWrite, %Frunning%, settings.ini, settings, frunning
- IniWrite, %Fsleep%, settings.ini, settings, Fsleep
- IniWrite, %Fbinds%, settings.ini, settings, Fbinds
- IniWrite, %un1%, settings.ini, settings, un1
- IniWrite, %un2%, settings.ini, settings, un2
- IniWrite, %un3%, settings.ini, settings, un3
- IniWrite, %un4%, settings.ini, settings, un4
- IniWrite, %un5%, settings.ini, settings, un5
- IniWrite, %un6%, settings.ini, settings, un6
- IniWrite, %un7%, settings.ini, settings, un7
- return
- ReadConfiguration: ;Read the saved configuration
- IfExist, %file% ;First check if it was saved.
- {
- IniRead, F1downs, %file%, DDL1, Quick|Melee|Range|Mage|None
- GuiControl, ChooseString, F1downs, %F1downs% ;Submit
- IniRead, F2downs, %file%, DDL2, Quick|Melee|Range|Mage|None
- GuiControl, ChooseString, F2downs, %F2downs% ;Submit
- IniRead, F3downs, %file%, DDL3, Quick|Melee|Range|Mage|None
- GuiControl, ChooseString, F3downs, %F3downs% ;Submit
- IniRead, F4downs, %file%, DDL4, Quick|Melee|Range|Mage|None
- GuiControl, ChooseString, F4downs, %F4downs% ;Submit
- IniRead, F5downs, %file%, DDL5, Quick|Melee|Range|Mage|None
- GuiControl, ChooseString, F5downs, %F5downs% ;Submit
- IniRead, F6downs, %file%, DDL6, Quick|Melee|Range|Mage|None
- GuiControl, ChooseString, F6downs, %F6downs% ;Submit
- IniRead, F7downs, %file%, DDL7, Quick|Melee|Range|Mage|None
- GuiControl, ChooseString, F7downs, %F7downs% ;Submit
- IniRead, ArmUn, %file%, DDL8, One|Two|Three|Four
- GuiControl, ChooseString, Armun, %Armun% ;Submit
- }
- return
- GuiClose:
- ExitApp
- ButtonClickherewhendone!:
- gosub Save1
- MsgBox, 0, OSRS Prayer, You can restore and re-edit this interface at anytime by Pressing Control +G.`n`Remember to suspend the script when you have no use for it.`n`n`If you are using Jagex's RSclient Be sure to click the resize button so the clicks can work correctl (or press Control + F12 while your RSclient SCreen is on top).
- gosub, ButtonKeysetup
- gosub 3ButtonSaveandClose
- Gui, Destroy
- return
- SetupScript:
- gosub, ButtonKeysetup
- gosub 3ButtonSaveandClose
- return
- ButtonResizeRsClient:
- MsgBox, 1,OSRS Prayer, If you Click Ok the script will locate the Jagex RS client and resize it so the Hotkeys can work correctly. Orion needs to remain at defaul size - compact mode.`n`n`(Note you can also press Control + F12 To resize the rs client as well without clicking this message).
- IfMsgBox Ok
- IfWinExist Old School RuneScape
- {
- WinActivate
- ResizeWin(793,571)
- }
- return
- return
- ButtonAbout:
- gui, 2:Default
- Gui, 2:Margin, 10, 10
- Gui, 2:Add, Text, center w240 h15, OSRS Prayer: By Samerdl
- Gui, 2:Add, Button, xp+5 yp+20,F-keys_And_Overheads
- Gui, 2:Add, button, default,Resizing_The_Rs_Client
- Gui, 2:Add, Button, default w+120,Run_toggling_feature
- Gui, 2:Add, Button, default w+140,Bind_Unclicking_Feature
- Gui, 2:Add, Button, default w+120,Mouse_Positioning_When_Done_Feature
- Gui, 2:Add, Button, default w+120,Sleep_time_feature
- Gui, 2:Add, Button, default xp+150 yp-100,General_Info
- Gui, 2:Add, Button, W240 xs-5 Close,Close
- Gui, 2:Show, w250, About ~ OSRS Prayer: By Samerdl
- return
- 2ButtonClose:
- gui, 2:submit
- return
- 2ButtonGeneral_Info:
- MsgBox, 0,OSRS Prayer, OSRS-Prayer is an Oldschool RS utility designed to speed up the act of Activating and De-activating Prayer & Run in the game.`n`n`It's is designed for the Orion client & the Rs client - use it at your own risk (against the rules).`n`n`{{ DO NOT USE IT ON BROWSERS!}}.
- return
- 2ButtonF-keys_And_Overheads:
- MsgBox, 0,OSRS Prayer, F1-F3 Keys funciton as full on prayer activator, they will turn on: overhead, item protect, steel skin & Mystic might.`n`n`F4-F6 turns on Overheads only, coordinates for mouse clicks can be changed from within the script.
- return
- 2buttonResizing_The_Rs_Client:
- MsgBox, 0,OSRS Prayer, The Resize feature (From the gui or just press Control + f12) will resize the RSClient to a pre-selected size so all the clicks will register properly and accordingly to the desired positions.`n`n` This feature is only needed for the Rsclient, as the Orion Client doesn't require a resize (yet).
- return
- 2buttonRun_toggling_feature:
- MsgBox, 0,OSRS Prayer, This feature will turn run on and off when you press the backquote key.`n`n`Although the Gui shows the tilde (~) key is required for activation, you dont need to press shift to activate it - as the key bind is set to the backtick key (backquote, the tilde without shift I.E "`",`. Its just too hard to see it.
- return
- 2buttonMouse_Positioning_When_Done_Feature:
- MsgBox, 0,OSRS Prayer, There are two options for the mouse position once the script finishes performing prayer/run toggles, it can eiher be the same position you've had it before, or it will move To X7/Y7 coords - the top of inventory close to the Inventory icon, you can change that within the script to any position you please.
- return
- 2buttonBind_Unclicking_Feature:
- MsgBox, 0,OSRS Prayer, This feature will make sure to click at the top right of the screen before performing run/prayer activation/deactivation.`n`n`This is done to prevent the clicks from unregistering when you have 'cast bind' held (if you're a mager), not recommened to use this feature.
- return
- 2buttonSleep_time_feature:
- msgbox,0,OSRS PRAYER, Sleep Time ads a wait time after & Before F-Keying between tabs, the Wait time is set in Sleep1, Sleep2.`n`n` By default the Sleep time is set to a random range between 100 to 150 MS.`n`Such Feature is needed to prevent bad clicks/failed clicks.
- return
- ButtonKeysetup:
- #ctrls = 7 ;How many Hotkey controls to add?
- Loop,% #ctrls {
- Gui, 3:Add, Text, xm, Enter Activation key #%A_Index%:
- IniRead, savedHK%A_Index%, settings.ini, Hotkeys, %A_Index%, %A_Space%
- If savedHK%A_Index% ;Check for saved hotkeys in INI file.
- Hotkey,% savedHK%A_Index%, Label%A_Index% ;Activate saved hotkeys if found.
- StringReplace, noMods, savedHK%A_Index%, ~ ;Remove tilde (~) and Win (#) modifiers...
- StringReplace, noMods, noMods, #,,UseErrorLevel ;They are incompatible with hotkey controls (cannot be shown).
- Gui, 3:Add, Hotkey, x+5 vHK%A_Index% gGuiLabel, %noMods% ;Add hotkey controls and show saved hotkeys.
- } ;Check the box if Win modifier is used.
- Gui, 3:Add, Button, , Save and Close
- Gui, 3:Show,,Dynamic Hotkeys
- return
- 3ButtonSaveandClose:
- Gui, 3:Submit
- savedHK%num% := HK%num%
- Gui, 3:Destroy
- return
- GuiLabel:
- If %A_GuiControl% in +,^,!,+^,+!,^!,+^! ;If the hotkey contains only modifiers, return to wait for a key.
- return
- If InStr(%A_GuiControl%,"vk07") ;vk07 = MenuMaskKey (see below)
- GuiControl,,%A_GuiControl%, % lastHK ;Reshow the hotkey, because MenuMaskKey clears it.
- Else
- validateHK(A_GuiControl)
- return
- validateHK(GuiControl) {
- global lastHK
- Gui, Submit, NoHide
- lastHK := %GuiControl% ;Backup the hotkey, in case it needs to be reshown.
- num := SubStr(GuiControl,3) ;Get the index number of the hotkey control.
- If (HK%num% != "") { ;If the hotkey is not blank...
- StringReplace, HK%num%, HK%num%, SC15D, AppsKey ;Use friendlier names,
- StringReplace, HK%num%, HK%num%, SC154, PrintScreen ; instead of these scan codes.
- If CB%num% ; If the 'Win' box is checked, then add its modifier (#).
- HK%num% := "#" HK%num%
- If !RegExMatch(HK%num%,"[#!\^\+]") ; If the new hotkey has no modifiers, add the (~) modifier.
- HK%num% := "~" HK%num% ; This prevents any key from being blocked.
- checkDuplicateHK(num)
- }
- If (savedHK%num% || HK%num%) ;Unless both are empty,
- setHK(num, savedHK%num%, HK%num%) ; update INI/GUI
- }
- checkDuplicateHK(num) {
- global #ctrls
- Loop,% #ctrls
- If (HK%num% = savedHK%A_Index%) {
- dup := A_Index
- Loop,6 {
- GuiControl,% "Disable" b:=!b, HK%dup% ;Flash the original hotkey to alert the user.
- Sleep,200
- }
- GuiControl,,HK%num%,% HK%num% :="" ;Delete the hotkey and clear the control.
- break
- }
- }
- setHK(num,INI,GUI) {
- If INI ;If previous hotkey exists,
- Hotkey, %INI%, Label%num%, Off ; disable it.
- If GUI ;If new hotkey exists,
- Hotkey, %GUI%, Label%num%, On ; enable it.
- IniWrite,% GUI ? GUI:null, settings.ini, Hotkeys, %num%
- savedHK%num% := HK%num%
- }
- #MenuMaskKey vk07 ;Requires AHK_L 38+
- #If ctrl := HotkeyCtrlHasFocus()
- *AppsKey:: ;Add support for these special keys,
- *BackSpace:: ; which the hotkey control does not normally allow.
- *Delete::
- *Enter::
- *Escape::
- *Pause::
- *PrintScreen::
- *Space::
- *Tab::
- modifier := ""
- If GetKeyState("Shift","P")
- modifier .= "+"
- If GetKeyState("Ctrl","P")
- modifier .= "^"
- If GetKeyState("Alt","P")
- modifier .= "!"
- Gui, Submit, NoHide ;If BackSpace is the first key press, Gui has never been submitted.
- If (A_ThisHotkey == "*BackSpace" && %ctrl% && !modifier) ;If the control has text but no modifiers held,
- GuiControl,,%ctrl% ; allow BackSpace to clear that text.
- Else ;Otherwise,
- GuiControl,,%ctrl%, % modifier SubStr(A_ThisHotkey,2) ; show the hotkey.
- validateHK(ctrl)
- return
- #If
- HotkeyCtrlHasFocus() {
- GuiControlGet, ctrl, Focus ;ClassNN
- If InStr(ctrl,"hotkey") {
- GuiControlGet, ctrl, FocusV ;Associated variable
- Return, ctrl
- }
- }
- buttonFoodSetup:
- #If WinActive("Orion") or WinActive("Old School RuneScape") or WinActive("OSBot") or WinActive("Runescape") or WinActive("Tribot") or WinActive("SwiftKit")
- #ctrls = 5 ;How many Hotkey controls to add?
- Loop,% #ctrls {
- Gui, 4:Add, button, xm, Food Key%A_Index%
- IniRead, savedFK%A_Index%, settings.ini, Hotkeys2, %A_Index%, %A_Space%
- If savedFK%A_Index% ;Check for saved hotkeys in INI file.
- Hotkey,% savedFK%A_Index%, Labels%A_Index% ;Activate saved hotkeys if found.
- StringReplace, noMods, savedFK%A_Index%, ~ ;Remove tilde (~) and Win (#) modifiers...
- StringReplace, noMods, noMods, #,,UseErrorLevel ;They are incompatible with hotkey controls (cannot be shown).
- Gui, 4:Add, Hotkey, x+5 vFK%A_Index% gGuiLabels2, %noMods% ;Add hotkey controls and show saved hotkeys.
- }
- Gui, 4:Add, Button, , Save and exit ;Check the box if Win modifier is used.
- Gui, 4:Show,,Dynamic Hotkeys
- return
- 4ButtonSaveandExit:
- Gui, 4:Submit
- savedFK%num% := FK%num%
- Gui, 4:Destroy
- return
- 4ButtonFoodKey1:
- gui, 5:default
- Gui, 5:Font, S16 CDefault, Verdana
- Gui, 5:Add, Text, x146 y27 w180 h40 , Key setup#1
- Gui, 5:Font, S6 CDefault, Verdana
- Gui, 5:Font, S7 CDefault, Verdana
- Gui, 5:Add, CheckBox, x376 y77 w80 h20 vInv1 checked%Inv1% , Inv1
- Gui, 5:Add, CheckBox, x266 y77 w80 h20 vInv2 checked%Inv2%, Inv2
- Gui, 5:Add, CheckBox, x136 y77 w80 h20 vInv3 checked%Inv3%, Inv3
- Gui, 5:Add, CheckBox, x26 y77 w80 h20 vInv4 checked%Inv4%, Inv4
- Gui, 5:Add, CheckBox, x376 y127 w80 h20 vInv5 checked%Inv5%, Inv5
- Gui, 5:Add, CheckBox, x266 y127 w80 h20 vInv6 checked%Inv6%, Inv6
- Gui, 5:Add, CheckBox, x136 y127 w80 h20 vInv7 checked%Inv7%, Inv7
- Gui, 5:Add, CheckBox, x26 y127 w80 h20 vInv8 checked%Inv8%, Inv8
- Gui, 5:Add, CheckBox, x376 y177 w80 h20 vInv9 checked%Inv9%, Inv9
- Gui, 5:Add, CheckBox, x256 y177 w80 h20 vInv10 checked%Inv10%, Inv10
- Gui, 5:Add, CheckBox, x136 y177 w80 h20 vInv11 checked%Inv11%, Inv11
- Gui, 5:Add, CheckBox, x26 y177 w80 h20 vInv12 checked%Inv12%, Inv12
- Gui, 5:Add, CheckBox, x376 y227 w80 h20 vInv13 checked%Inv13%, Inv13
- Gui, 5:Add, CheckBox, x256 y227 w80 h20 vInv14 checked%Inv14%, Inv14
- Gui, 5:Add, CheckBox, x136 y227 w80 h20 vInv15 checked%Inv15%, Inv15
- Gui, 5:Add, CheckBox, x26 y227 w80 h20 vInv16 checked%Inv16%, Inv16
- Gui, 5:Add, CheckBox, x376 y277 w80 h20 vInv17 checked%Inv17%, Inv17
- Gui, 5:Add, CheckBox, x256 y277 w80 h20 vInv18 checked%Inv18%, Inv18
- Gui, 5:Add, CheckBox, x136 y277 w80 h20 vInv19 checked%Inv19%, Inv19
- Gui, 5:Add, CheckBox, x26 y277 w80 h20 vInv20 checked%Inv20%, Inv20
- Gui, 5:Add, CheckBox, x376 y327 w80 h20 vInv21 checked%Inv21%, Inv21
- Gui, 5:Add, CheckBox, x256 y327 w80 h20 vInv22 checked%Inv22%, Inv22
- Gui, 5:Add, CheckBox, x136 y327 w80 h20 vInv23 checked%Inv23%, Inv23
- Gui, 5:Add, CheckBox, x26 y327 w80 h20 vInv24 checked%Inv24%, Inv24
- Gui, 5:Add, CheckBox, x376 y367 w80 h20 vInv25 checked%Inv25%, Inv25
- Gui, 5:Add, CheckBox, x256 y367 w80 h20 vInv26 checked%Inv26%, Inv26
- Gui, 5:Add, CheckBox, x136 y367 w80 h20 vInv27 checked%Inv27%, Inv27
- Gui, 5:Add, CheckBox, x26 y367 w80 h20 vInv28 checked%Inv28%, Inv28
- Gui, 5:Add, Button,w100 h30 xm x+70 gSave3, Save
- Gui, 5:Show, h500 w500, About ~ OSRS Prayer: By Samerdl
- Return
- Save3:
- Gui, 5:Submit, NoHide
- loop, 28
- {
- IniWrite, % Inv%a_index%, settings.ini, Foodsettings, Inv%a_index%
- }
- Gui, 5:Destroy
- return
- 4ButtonFoodKey2:
- gui, 5:default
- Gui, 5:Font, S16 CDefault, Verdana
- Gui, 5:Add, Text, x146 y27 w180 h40 , Key setup #2
- Gui, 5:Font, S6 CDefault, Verdana
- Gui, 5:Font, S7 CDefault, Verdana
- Gui, 5:Add, CheckBox, x376 y77 w80 h20 vInv2k1 checked%Inv2k1% , Inv2k1
- Gui, 5:Add, CheckBox, x266 y77 w80 h20 vInv2k2 checked%Inv2k2%, Inv2k2
- Gui, 5:Add, CheckBox, x136 y77 w80 h20 vInv2k3 checked%Inv2k3%, Inv2k3
- Gui, 5:Add, CheckBox, x26 y77 w80 h20 vInv2k4 checked%Inv2k4%, Inv2k4
- Gui, 5:Add, CheckBox, x376 y127 w80 h20 vInv2k5 checked%Inv2k5%, Inv2k5
- Gui, 5:Add, CheckBox, x266 y127 w80 h20 vInv2k6 checked%Inv2k6%, Inv2k6
- Gui, 5:Add, CheckBox, x136 y127 w80 h20 vInv2k7 checked%Inv2k7%, Inv2k7
- Gui, 5:Add, CheckBox, x26 y127 w80 h20 vInv2k8 checked%Inv2k8%, Inv2k8
- Gui, 5:Add, CheckBox, x376 y177 w80 h20 vInv2k9 checked%Inv2k9%, Inv2k9
- Gui, 5:Add, CheckBox, x256 y177 w80 h20 vInv2k10 checked%Inv2k10%, Inv2k10
- Gui, 5:Add, CheckBox, x136 y177 w80 h20 vInv2k11 checked%Inv2k11%, Inv2k11
- Gui, 5:Add, CheckBox, x26 y177 w80 h20 vInv2k12 checked%Inv2k12%, Inv2k12
- Gui, 5:Add, CheckBox, x376 y227 w80 h20 vInv2k13 checked%Inv2k13%, Inv2k13
- Gui, 5:Add, CheckBox, x256 y227 w80 h20 vInv2k14 checked%Inv2k14%, Inv2k14
- Gui, 5:Add, CheckBox, x136 y227 w80 h20 vInv2k15 checked%Inv2k15%, Inv2k15
- Gui, 5:Add, CheckBox, x26 y227 w80 h20 vInv2k16 checked%Inv2k16%, Inv2k16
- Gui, 5:Add, CheckBox, x376 y277 w80 h20 vInv2k17 checked%Inv2k17%, Inv2k17
- Gui, 5:Add, CheckBox, x256 y277 w80 h20 vInv2k18 checked%Inv2k18%, Inv2k18
- Gui, 5:Add, CheckBox, x136 y277 w80 h20 vInv2k19 checked%Inv2k19%, Inv2k19
- Gui, 5:Add, CheckBox, x26 y277 w80 h20 vInv2k20 checked%Inv2k20%, Inv2k20
- Gui, 5:Add, CheckBox, x376 y327 w80 h20 vInv2k21 checked%Inv2k21%, Inv2k21
- Gui, 5:Add, CheckBox, x256 y327 w80 h20 vInv2k22 checked%Inv2k22%, Inv2k22
- Gui, 5:Add, CheckBox, x136 y327 w80 h20 vInv2k23 checked%Inv2k23%, Inv2k23
- Gui, 5:Add, CheckBox, x26 y327 w80 h20 vInv2k24 checked%Inv2k24%, Inv2k24
- Gui, 5:Add, CheckBox, x376 y367 w80 h20 vInv2k25 checked%Inv2k25%, Inv2k25
- Gui, 5:Add, CheckBox, x256 y367 w80 h20 vInv2k26 checked%Inv2k26%, Inv2k26
- Gui, 5:Add, CheckBox, x136 y367 w80 h20 vInv2k27 checked%Inv2k27%, Inv2k27
- Gui, 5:Add, CheckBox, x26 y367 w80 h20 vInv2k28 checked%Inv2k28%, Inv2k28
- Gui, 5:Add, Button,w100 h30 xm x+70 gSave4, Save
- Gui, 5:Show, h500 w500, About ~ OSRS Prayer: By Samerdl
- Return
- Save4:
- Gui, 5:Submit, NoHide
- loop, 28
- {
- IniWrite, % Inv2k%a_index%, settings.ini, Foodsettings, Inv2k%a_index%
- }
- Gui, 5:Destroy
- return
- 4ButtonFoodKey3:
- gui, 5:default
- Gui, 5:Font, S16 CDefault, Verdana
- Gui, 5:Add, Text, x146 y27 w180 h40 , Key setup#3
- Gui, 5:Font, S6 CDefault, Verdana
- Gui, 5:Font, S7 CDefault, Verdana
- Gui, 5:Add, CheckBox, x376 y77 w80 h20 vInv3k1 checked%Inv3k1% , Inv3k1
- Gui, 5:Add, CheckBox, x266 y77 w80 h20 vInv3k2 checked%Inv3k2%, Inv3k2
- Gui, 5:Add, CheckBox, x136 y77 w80 h20 vInv3k3 checked%Inv3k3%, Inv3k3
- Gui, 5:Add, CheckBox, x26 y77 w80 h20 vInv3k4 checked%Inv3k4%, Inv3k4
- Gui, 5:Add, CheckBox, x376 y127 w80 h20 vInv3k5 checked%Inv3k5%, Inv3k5
- Gui, 5:Add, CheckBox, x266 y127 w80 h20 vInv3k6 checked%Inv3k6%, Inv3k6
- Gui, 5:Add, CheckBox, x136 y127 w80 h20 vInv3k7 checked%Inv3k7%, Inv3k7
- Gui, 5:Add, CheckBox, x26 y127 w80 h20 vInv3k8 checked%Inv3k8%, Inv3k8
- Gui, 5:Add, CheckBox, x376 y177 w80 h20 vInv3k9 checked%Inv3k9%, Inv3k9
- Gui, 5:Add, CheckBox, x256 y177 w80 h20 vInv3k10 checked%Inv3k10%, Inv3k10
- Gui, 5:Add, CheckBox, x136 y177 w80 h20 vInv3k11 checked%Inv3k11%, Inv3k11
- Gui, 5:Add, CheckBox, x26 y177 w80 h20 vInv3k12 checked%Inv3k12%, Inv3k12
- Gui, 5:Add, CheckBox, x376 y227 w80 h20 vInv3k13 checked%Inv3k13%, Inv3k13
- Gui, 5:Add, CheckBox, x256 y227 w80 h20 vInv3k14 checked%Inv3k14%, Inv3k14
- Gui, 5:Add, CheckBox, x136 y227 w80 h20 vInv3k15 checked%Inv3k15%, Inv3k15
- Gui, 5:Add, CheckBox, x26 y227 w80 h20 vInv3k16 checked%Inv3k16%, Inv3k16
- Gui, 5:Add, CheckBox, x376 y277 w80 h20 vInv3k17 checked%Inv3k17%, Inv3k17
- Gui, 5:Add, CheckBox, x256 y277 w80 h20 vInv3k18 checked%Inv3k18%, Inv3k18
- Gui, 5:Add, CheckBox, x136 y277 w80 h20 vInv3k19 checked%Inv3k19%, Inv3k19
- Gui, 5:Add, CheckBox, x26 y277 w80 h20 vInv3k20 checked%Inv3k20%, Inv3k20
- Gui, 5:Add, CheckBox, x376 y327 w80 h20 vInv3k21 checked%Inv3k21%, Inv3k21
- Gui, 5:Add, CheckBox, x256 y327 w80 h20 vInv3k22 checked%Inv3k22%, Inv3k22
- Gui, 5:Add, CheckBox, x136 y327 w80 h20 vInv3k23 checked%Inv3k23%, Inv3k23
- Gui, 5:Add, CheckBox, x26 y327 w80 h20 vInv3k24 checked%Inv3k24%, Inv3k24
- Gui, 5:Add, CheckBox, x376 y367 w80 h20 vInv3k25 checked%Inv3k25%, Inv3k25
- Gui, 5:Add, CheckBox, x256 y367 w80 h20 vInv3k26 checked%Inv3k26%, Inv3k26
- Gui, 5:Add, CheckBox, x136 y367 w80 h20 vInv3k27 checked%Inv3k27%, Inv3k27
- Gui, 5:Add, CheckBox, x26 y367 w80 h20 vInv3k28 checked%Inv3k28%, Inv3k28
- Gui, 5:Add, Button,w100 h30 xm x+70 gSave5, Save
- Gui, 5:Show, h500 w500, About ~ OSRS Prayer: By Samerdl
- Return
- Save5:
- Gui, 5:Submit, NoHide
- loop, 28
- {
- IniWrite, % Inv3k%a_index%, settings.ini, Foodsettings, Inv3k%a_index%
- }
- Gui, 5:Destroy
- return
- 4ButtonFoodKey4:
- gui, 5:default
- Gui, 5:Font, S16 CDefault, Verdana
- Gui, 5:Add, Text, x146 y27 w180 h40 , Key setup#4
- Gui, 5:Font, S6 CDefault, Verdana
- Gui, 5:Font, S7 CDefault, Verdana
- Gui, 5:Add, CheckBox, x376 y77 w80 h20 vInv4K1 checked%Inv4K1% , Inv4K1
- Gui, 5:Add, CheckBox, x266 y77 w80 h20 vInv4K2 checked%Inv4K2%, Inv4K2
- Gui, 5:Add, CheckBox, x136 y77 w80 h20 vInv4K3 checked%Inv4K3%, Inv4K3
- Gui, 5:Add, CheckBox, x26 y77 w80 h20 vInv4K4 checked%Inv4K4%, Inv4K4
- Gui, 5:Add, CheckBox, x376 y127 w80 h20 vInv4K5 checked%Inv4K5%, Inv4K5
- Gui, 5:Add, CheckBox, x266 y127 w80 h20 vInv4K6 checked%Inv4K6%, Inv4K6
- Gui, 5:Add, CheckBox, x136 y127 w80 h20 vInv4K7 checked%Inv4K7%, Inv4K7
- Gui, 5:Add, CheckBox, x26 y127 w80 h20 vInv4K8 checked%Inv4K8%, Inv4K8
- Gui, 5:Add, CheckBox, x376 y177 w80 h20 vInv4K9 checked%Inv4K9%, Inv4K9
- Gui, 5:Add, CheckBox, x256 y177 w80 h20 vInv4K10 checked%Inv4K10%, Inv4K10
- Gui, 5:Add, CheckBox, x136 y177 w80 h20 vInv4K11 checked%Inv4K11%, Inv4K11
- Gui, 5:Add, CheckBox, x26 y177 w80 h20 vInv4K12 checked%Inv4K12%, Inv4K12
- Gui, 5:Add, CheckBox, x376 y227 w80 h20 vInv4K13 checked%Inv4K13%, Inv4K13
- Gui, 5:Add, CheckBox, x256 y227 w80 h20 vInv4K14 checked%Inv4K14%, Inv4K14
- Gui, 5:Add, CheckBox, x136 y227 w80 h20 vInv4K15 checked%Inv4K15%, Inv4K15
- Gui, 5:Add, CheckBox, x26 y227 w80 h20 vInv4K16 checked%Inv4K16%, Inv4K16
- Gui, 5:Add, CheckBox, x376 y277 w80 h20 vInv4K17 checked%Inv4K17%, Inv4K17
- Gui, 5:Add, CheckBox, x256 y277 w80 h20 vInv4K18 checked%Inv4K18%, Inv4K18
- Gui, 5:Add, CheckBox, x136 y277 w80 h20 vInv4K19 checked%Inv4K19%, Inv4K19
- Gui, 5:Add, CheckBox, x26 y277 w80 h20 vInv4K20 checked%Inv4K20%, Inv4K20
- Gui, 5:Add, CheckBox, x376 y327 w80 h20 vInv4K21 checked%Inv4K21%, Inv4K21
- Gui, 5:Add, CheckBox, x256 y327 w80 h20 vInv4K22 checked%Inv4K22%, Inv4K22
- Gui, 5:Add, CheckBox, x136 y327 w80 h20 vInv4K23 checked%Inv4K23%, Inv4K23
- Gui, 5:Add, CheckBox, x26 y327 w80 h20 vInv4K24 checked%Inv4K24%, Inv4K24
- Gui, 5:Add, CheckBox, x376 y367 w80 h20 vInv4K25 checked%Inv4K25%, Inv4K25
- Gui, 5:Add, CheckBox, x256 y367 w80 h20 vInv4K26 checked%Inv4K26%, Inv4K26
- Gui, 5:Add, CheckBox, x136 y367 w80 h20 vInv4K27 checked%Inv4K27%, Inv4K27
- Gui, 5:Add, CheckBox, x26 y367 w80 h20 vInv4K28 checked%Inv4K28%, Inv4K28
- Gui, 5:Add, Button,w100 h30 xm x+70 gSave6, Save
- Gui, 5:Show, h500 w500, About ~ OSRS Prayer: By Samerdl
- Return
- Save6:
- Gui, 5:Submit, NoHide
- loop, 28
- {
- IniWrite, % Inv4k%a_index%, settings.ini, Foodsettings, Inv4k%a_index%
- }
- Gui, 5:Destroy
- return
- 4ButtonFoodKey5:
- gui, 5:default
- Gui, 5:Font, S16 CDefault, Verdana
- Gui, 5:Add, Text, x146 y27 w180 h40 , Keysetup #5
- Gui, 5:Font, S6 CDefault, Verdana
- Gui, 5:Font, S7 CDefault, Verdana
- Gui, 5:Add, CheckBox, x376 y77 w80 h20 vInv5k1 checked%Inv5k1% , Inv5k1
- Gui, 5:Add, CheckBox, x266 y77 w80 h20 vInv5k2 checked%Inv5k2%, Inv5k2
- Gui, 5:Add, CheckBox, x136 y77 w80 h20 vInv5k3 checked%Inv5k3%, Inv5k3
- Gui, 5:Add, CheckBox, x26 y77 w80 h20 vInv5k4 checked%Inv5k4%, Inv5k4
- Gui, 5:Add, CheckBox, x376 y127 w80 h20 vInv5k5 checked%Inv5k5%, Inv5k5
- Gui, 5:Add, CheckBox, x266 y127 w80 h20 vInv5k6 checked%Inv5k6%, Inv5k6
- Gui, 5:Add, CheckBox, x136 y127 w80 h20 vInv5k7 checked%Inv5k7%, Inv5k7
- Gui, 5:Add, CheckBox, x26 y127 w80 h20 vInv5k8 checked%Inv5k8%, Inv5k8
- Gui, 5:Add, CheckBox, x376 y177 w80 h20 vInv5k9 checked%Inv5k9%, Inv5k9
- Gui, 5:Add, CheckBox, x256 y177 w80 h20 vInv5k10 checked%Inv5k10%, Inv5k10
- Gui, 5:Add, CheckBox, x136 y177 w80 h20 vInv5k11 checked%Inv5k11%, Inv5k11
- Gui, 5:Add, CheckBox, x26 y177 w80 h20 vInv5k12 checked%Inv5k12%, Inv5k12
- Gui, 5:Add, CheckBox, x376 y227 w80 h20 vInv5k13 checked%Inv5k13%, Inv5k13
- Gui, 5:Add, CheckBox, x256 y227 w80 h20 vInv5k14 checked%Inv5k14%, Inv5k14
- Gui, 5:Add, CheckBox, x136 y227 w80 h20 vInv5k15 checked%Inv5k15%, Inv5k15
- Gui, 5:Add, CheckBox, x26 y227 w80 h20 vInv5k16 checked%Inv5k16%, Inv5k16
- Gui, 5:Add, CheckBox, x376 y277 w80 h20 vInv5k17 checked%Inv5k17%, Inv5k17
- Gui, 5:Add, CheckBox, x256 y277 w80 h20 vInv5k18 checked%Inv5k18%, Inv5k18
- Gui, 5:Add, CheckBox, x136 y277 w80 h20 vInv5k19 checked%Inv5k19%, Inv5k19
- Gui, 5:Add, CheckBox, x26 y277 w80 h20 vInv5k20 checked%Inv5k20%, Inv5k20
- Gui, 5:Add, CheckBox, x376 y327 w80 h20 vInv5k21 checked%Inv5k21%, Inv5k21
- Gui, 5:Add, CheckBox, x256 y327 w80 h20 vInv5k22 checked%Inv5k22%, Inv5k22
- Gui, 5:Add, CheckBox, x136 y327 w80 h20 vInv5k23 checked%Inv5k23%, Inv5k23
- Gui, 5:Add, CheckBox, x26 y327 w80 h20 vInv5k24 checked%Inv5k24%, Inv5k24
- Gui, 5:Add, CheckBox, x376 y367 w80 h20 vInv5k25 checked%Inv5k25%, Inv5k25
- Gui, 5:Add, CheckBox, x256 y367 w80 h20 vInv5k26 checked%Inv5k26%, Inv5k26
- Gui, 5:Add, CheckBox, x136 y367 w80 h20 vInv5k27 checked%Inv5k27%, Inv5k27
- Gui, 5:Add, CheckBox, x26 y367 w80 h20 vInv5k28 checked%Inv5k28%, Inv5k28
- Gui, 5:Add, Button,w100 h30 xm x+70 gSave7, Save
- Gui, 5:Show, h500 w500, About ~ OSRS Prayer: By Samerdl
- Return
- Save7:
- Gui, 5:Submit, NoHide
- loop, 28
- {
- IniWrite, % Inv5k%a_index%, settings.ini, Foodsettings, Inv5k%a_index%
- }
- Gui, 5:Destroy
- return
- GuiLabels2:
- If %A_GuiControl% in +,^,!,+^,+!,^!,+^! ;If the hotkey contains only modifiers, return to wait for a key.
- return
- If InStr(%A_GuiControl%,"vk07") ;vk07 = MenuMaskKey (see below)
- GuiControl,,%A_GuiControl%, % lastFK ;Reshow the hotkey, because MenuMaskKey clears it.
- Else
- validateFK(A_GuiControl)
- return
- validateFK(GuiControl) {
- global lastFK
- Gui, Submit, NoHide
- lastFK := %GuiControl% ;Backup the hotkey, in case it needs to be reshown.
- num := SubStr(GuiControl,3) ;Get the index number of the hotkey control.
- If (FK%num% != "") { ;If the hotkey is not blank...
- StringReplace, FK%num%, FK%num%, SC15D, AppsKey ;Use friendlier names,
- StringReplace, FK%num%, FK%num%, SC154, PrintScreen ; instead of these scan codes.
- If CB%num% ; If the 'Win' box is checked, then add its modifier (#).
- FK%num% := "#" FK%num%
- If !RegExMatch(FK%num%,"[#!\^\+]") ; If the new hotkey has no modifiers, add the (~) modifier.
- FK%num% := "~" FK%num% ; This prevents any key from being blocked.
- checkDuplicateFK(num)
- }
- If (savedFK%num% || FK%num%) ;Unless both are empty,
- setFK(num, savedFK%num%, FK%num%) ; update INI/GUI
- }
- checkDuplicateFK(num) {
- global #ctrls
- Loop,% #ctrls
- If (FK%num% = savedFK%A_Index%) {
- dup := A_Index
- Loop,6 {
- GuiControl,% "Disable" b:=!b, FK%dup% ;Flash the original hotkey to alert the user.
- Sleep,200
- }
- GuiControl,,FK%num%,% FK%num% :="" ;Delete the hotkey and clear the control.
- break
- }
- }
- setFK(num,INI,GUI) {
- If INI ;If previous hotkey exists,
- Hotkey, %INI%, Labels%num%, Off ; disable it.
- If GUI ;If new hotkey exists,
- Hotkey, %GUI%, Labels%num%, On ; enable it.
- IniWrite,% GUI ? GUI:null, settings.ini, Hotkeys2, %num%
- savedFK%num% := FK%num%
- }
- #MenuMaskKey vk07 ;Requires AFK_L 38+
- #If ctrl := HotkeyCtrlHasFocus1()
- modifier := ""
- If GetKeyState("Shift","P")
- modifier .= "+"
- If GetKeyState("Ctrl","P")
- modifier .= "^"
- If GetKeyState("Alt","P")
- modifier .= "!"
- Gui, Submit, NoHide ;If BackSpace is the first key press, Gui has never been submitted.
- If (A_ThisHotkey == "*BackSpace" && %ctrl% && !modifier) ;If the control has text but no modifiers held,
- GuiControl,,%ctrl% ; allow BackSpace to clear that text.
- Else ;Otherwise,
- GuiControl,,%ctrl%, % modifier SubStr(A_ThisHotkey,2) ; show the hotkey.
- validateFK(ctrl)
- return
- #If
- HotkeyCtrlHasFocus1() {
- GuiControlGet, ctrl, Focus ;ClassNN
- If InStr(ctrl,"hotkey") {
- GuiControlGet, ctrl, FocusV ;Associated variable
- Return, ctrl
- }
- }
- #If WinActive("Orion") || WinActive("Old School RuneScape") || WinActive("OSBot") || WinActive("Runescape") || WinActive("Tribot") || WinActive("SwiftKit")
- labels1:
- Blockinput on
- gosub MouseArea
- Blockinput off
- return
- labels2:
- Blockinput on
- gosub MouseArea
- Blockinput off
- return
- labels3:
- Blockinput on
- gosub MouseArea
- Blockinput off
- return
- labels4:
- Blockinput on
- gosub MouseArea
- Blockinput off
- return
- labels5:
- Blockinput on
- gosub MouseArea
- Blockinput off
- return
- #If WinActive("Orion") || WinActive("Old School RuneScape") || WinActive("OSBot") || WinActive("Runescape") || WinActive("Tribot") || WinActive("SwiftKit")
- Label1:
- Blockinput on
- MouseGetPos, XX, YY
- gosub binding
- gosub %F1downs%
- if prot1 {
- gosub checkboxes
- } else {
- send {esc}
- }
- if arm1 {
- gosub armors
- }
- if Un1 {
- gosub %Armun%
- }
- gosub MouseArea
- Blockinput off
- return
- Label2:
- Blockinput on
- MouseGetPos, XX, YY
- gosub binding
- gosub %F2downs%
- if prot2 {
- gosub checkboxes
- } else {
- send {esc}
- }
- if arm2 {
- gosub armors
- }
- if Un2 {
- gosub %Armun%
- }
- gosub MouseArea
- Blockinput off
- return
- Label3:
- Blockinput on
- MouseGetPos, XX, YY
- gosub binding
- gosub %F3downs%
- if prot3 {
- gosub checkboxes
- } else {
- send {esc}
- }
- if arm3 {
- gosub armors
- }
- if Un3 {
- gosub %Armun%
- }
- gosub MouseArea
- Blockinput off
- return
- Label4:
- Blockinput on
- MouseGetPos, XX, YY
- gosub binding
- gosub %F4downs%
- if prot4 {
- gosub checkboxes
- } else {
- send {esc}
- }
- if arm4 {
- gosub armors
- }
- if Un4 {
- gosub %Armun%
- }
- gosub MouseArea
- Blockinput off
- return
- Label5:
- Blockinput on
- MouseGetPos, XX, YY
- gosub binding
- gosub %F5downs%
- if prot5 {
- gosub checkboxes
- } else {
- send {esc}
- }
- if arm5 {
- gosub armors
- }
- if Un5 {
- gosub %Armun%
- }
- gosub MouseArea
- Blockinput off
- return
- Label6:
- Blockinput on
- MouseGetPos, XX, YY
- gosub binding
- gosub %F6downs%
- if prot6 {
- gosub checkboxes
- } else {
- send {esc}
- }
- if arm6 {
- gosub armors
- }
- if Un6 {
- gosub %Armun%
- }
- gosub MouseArea
- Blockinput off
- return
- Label7:
- Blockinput on
- MouseGetPos, XX, YY
- gosub binding
- gosub %F7downs%
- if prot7 {
- gosub checkboxes
- } else {
- send {esc}
- }
- if arm7 {
- gosub armors
- }
- if Un7 {
- gosub %Armun%
- }
- gosub MouseArea
- Blockinput off
- return
- #If WinActive("Orion") || WinActive("Old School RuneScape") || WinActive("OSBot") || WinActive("Runescape") || WinActive("Tribot") || WinActive("SwiftKit")
- Quick:
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X10+ Ran(offset), Y10+ Ran(offset)
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , Ran(offset)+ XR10, Ran(offset)+ Yr10
- }
- return
- Melee:
- send {f5}
- Gosub Sleeping
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X1+ Ran(offset), Y1+ Ran(offset)
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , Ran(offset)+ XR1, Ran(offset)+ Yr1
- }
- return
- Range:
- send {f5}
- Gosub Sleeping
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X2+ Ran(offset), Y2+ Ran(offset)
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , Ran(offset)+ XR2, Ran(offset)+ Yr2
- }
- return
- Mage:
- send {f5}
- Gosub Sleeping
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X3+ Ran(offset), Y3+ Ran(offset)
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , Ran(offset)+ XR3, Ran(offset)+ Yr3
- }
- return
- #If WinActive("Orion") || WinActive("Old School RuneScape") || WinActive("OSBot") || WinActive("Runescape") || WinActive("Tribot") || WinActive("SwiftKit")
- `::
- BlockInput on
- if FRunning {
- MouseGetPos, XX, YY
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X8+ Ran(offset), Y8+ Ran(offset)
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , Ran(offset)+ XR8, Ran(offset)+ Yr8
- }
- }
- gosub MouseArea
- BlockInput off
- return
- checkboxes:
- send {f5}
- if SteelSkins {
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X4+ Ran(offset), Y4+ Ran(offset)
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , Ran(offset)+ XR4, Ran(offset)+ Yr4
- }
- }
- if ItemProtects {
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X5+ Ran(offset), Y5+ Ran(offset)
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , Ran(offset)+ XR5, Ran(offset)+ Yr5
- }
- }
- if MysticMight {
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X6+ Ran(offset), Y6+ Ran(offset)
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , Ran(offset)+ XR6, Ran(offset)+ Yr6
- }
- }
- send {esc}
- return
- One:
- send {F4}
- gosub sleeping
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X15+ Ran(offset), Y15+ Ran(offset),,2
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , XR15 + Ran(offset), YR15 + Ran(offset),, 2
- }
- send {esc}
- return
- Two:
- send {F4}
- gosub sleeping
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X15+ Ran(offset), Y15+ Ran(offset),,2
- MouseClick , Left , X16+ Ran(offset), Y16+ Ran(offset),,2
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , XR15 + Ran(offset), YR15 + Ran(offset),, 2
- MouseClick , Left , XR16 + Ran(offset), YR16 + Ran(offset),, 2
- }
- send {esc}
- return
- Three:
- send {F4}
- gosub sleeping
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X15+ Ran(offset), Y15+ Ran(offset),,2
- MouseClick , Left , X16+ Ran(offset), Y16+ Ran(offset),,2
- MouseClick , Left , X17+ Ran(offset), Y17+ Ran(offset),,2
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , XR15 + Ran(offset), YR15 + Ran(offset),, 2
- MouseClick , Left , XR16 + Ran(offset), YR16 + Ran(offset),, 2
- MouseClick , Left , XR17 + Ran(offset), YR17 + Ran(offset),, 2
- }
- send {esc}
- return
- Four:
- send {F4}
- gosub sleeping
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X15+ Ran(offset), Y15+ Ran(offset),,2
- MouseClick , Left , X16+ Ran(offset), Y16+ Ran(offset),,2
- MouseClick , Left , X17+ Ran(offset), Y17+ Ran(offset),,2
- MouseClick , Left , X18+ Ran(offset), Y18+ Ran(offset),,2
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , XR15 + Ran(offset), YR15 + Ran(offset),, 2
- MouseClick , Left , XR16 + Ran(offset), YR16 + Ran(offset),, 2
- MouseClick , Left , XR17 + Ran(offset), YR17 + Ran(offset),, 2
- MouseClick , Left , XR18 + Ran(offset), YR18 + Ran(offset),, 2
- }
- send {esc}
- return
- Armors:
- if Radio1 {
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X11+ Ran(offset), Y11+ Ran(offset),,2
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , XR11 + Ran(offset), YR11 + Ran(offset),, 2
- }
- }
- if Radio2 {
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X11+ Ran(offset), Y11+ Ran(offset),,2
- gosub sleeping
- MouseClick , Left , X12+ Ran(offset), Y12+ Ran(offset),,2
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , XR11 + Ran(offset), YR11 + Ran(offset),, 2
- gosub sleeping
- MouseClick , Left , XR12+ Ran(offset), YR12+ Ran(offset),,2
- }
- }
- if Radio3 {
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X11+ Ran(offset), Y11+ Ran(offset),,2
- gosub sleeping
- MouseClick , Left , X12+ Ran(offset), Y12+ Ran(offset),,2
- gosub sleeping
- MouseClick , Left , X13+ Ran(offset), Y13+ Ran(offset),,2
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , XR11 + Ran(offset), YR11 + Ran(offset),, 2
- gosub sleeping
- MouseClick , Left , XR12+ Ran(offset), YR12+ Ran(offset),,2
- gosub sleeping
- MouseClick , Left , XR13+ Ran(offset), YR13+ Ran(offset),,2
- }
- }
- if Radio4 {
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X11+ Ran(offset), Y11+ Ran(offset),,2
- gosub sleeping
- MouseClick , Left , X12+ Ran(offset), Y12+ Ran(offset),,2
- gosub sleeping
- MouseClick , Left , X13+ Ran(offset), Y13+ Ran(offset),,2
- gosub sleeping
- MouseClick , Left , X14+ Ran(offset), Y14+ Ran(offset),,2
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , XR11 + Ran(offset), YR11 + Ran(offset),, 2
- gosub sleeping
- MouseClick , Left , XR12+ Ran(offset), YR12+ Ran(offset),,2
- gosub sleeping
- MouseClick , Left , XR13+ Ran(offset), YR13+ Ran(offset),,2
- gosub sleeping
- MouseClick , Left , XR14+ Ran(offset), YR14+ Ran(offset),,2
- }
- }
- return
- ^F12::
- IfWinExist Old School RuneScape
- {
- WinActivate
- ResizeWin(793,571)
- gosub sleeping
- ResizeWin(793,571)
- }
- return
- Mousearea:
- if Invs {
- IfWinNotActive Old School RuneScape
- {
- MouseMove, X7+ Ran(offset), Y7+ Ran(offset), 0
- }
- IfWinActive Old School RuneScape
- {
- MouseMove, Ran(offset)+ XR7, Ran(offset)+ Yr7, 0
- }
- }
- if Origin {
- IfWinNotActive Old School RuneScape
- {
- MouseMove, XX+ Ran(offset), YY+ Ran(offset), 0
- }
- IfWinActive Old School RuneScape
- {
- MouseMove, xx+ Ran(offset), yy+ Ran(offset), 0
- }
- }
- return
- Binding:
- if Fbinds {
- IfWinNotActive Old School RuneScape
- {
- MouseClick , Left , X9+ Ran(offset), Y9+ Ran(offset),,0
- }
- IfWinActive Old School RuneScape
- {
- MouseClick , Left , Ran(offset)+ XR9, Ran(offset)+ Yr9,,0
- }
- }
- return
- none:
- sleep 50
- return
- Sleeping:
- if Fsleep {
- Random, Rand, Sleep1, Sleep2
- sleep %rand%
- }
- return
- Ran(Num)
- {
- Random, r, -1*Num, Num
- Return r
- }
- ResizeWin(Width = 0,Height = 0)
- {
- WinGetPos,X,Y,W,H,A
- If %Width% = 0
- Width := W
- If %Height% = 0
- Height := H
- WinMove,A,,%X%,%Y%,%Width%,%Height%
- }
Advertisement
Add Comment
Please, Sign In to add comment