Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv
- #SingleInstance Force
- SendMode Input
- SetBatchLines -1
- CoordMode Pixel
- #MaxHotkeysPerInterval 9000
- IniRead, hotkey, Configuration.ini, activation, hotkey
- Hotkey, %hotkey%, switch
- return
- switch:
- IniRead, hold, Configuration.ini, activation, hold
- toggle := !toggle
- if (toggle) OR (hold)
- SetTimer WatchSpells, 10
- else
- SetTimer WatchSpells, Off
- if (hold)
- loop
- if !getkeystate(hotkey, "P")
- {
- SetTimer WatchSpells, Off
- break
- }
- return
- WatchSpells() {
- IniRead, X1, Configuration.ini, ScanArea, X1
- IniRead, Y1, Configuration.ini, ScanArea, Y1
- IniRead, X2, Configuration.ini, ScanArea, X2
- IniRead, Y2, Configuration.ini, ScanArea, Y2
- If(X2 = -1)
- X2 := A_ScreenWidth
- If(Y2 = -1)
- Y2 := A_ScreenHeight
- IniRead, SPELLS, Configuration.ini, SpellHotkeys
- SPELL_KEYMAP := []
- Loop, Parse, SPELLS, "`n"
- {
- Array := StrSplit(A_LoopField, "=", , 2)
- SPELL_KEYMAP[Array[1]] := Array[2]
- }
- for spell, key in SPELL_KEYMAP
- {
- if detect_Skill()=1{
- Send % key
- }
- }
- }
- return
- detect_Skill(){
- ImageSearch, , , X1, Y1, X2, Y2, % "C:\Aimee\DKK\" spell ".png"
- if (ErrorLevel=0)
- {
- return, 1
- }
- else
- {
- return, 0
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement