Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. #NoEnv
  2. #SingleInstance Force
  3. SendMode Input
  4. SetBatchLines -1
  5. CoordMode Pixel
  6. #MaxHotkeysPerInterval 9000
  7.  
  8. IniRead, hotkey, Configuration.ini, activation, hotkey
  9.  
  10. Hotkey, %hotkey%, switch
  11.  
  12. return
  13.  
  14. switch:
  15. IniRead, hold, Configuration.ini, activation, hold
  16.  
  17. toggle := !toggle
  18. if (toggle) OR (hold)
  19. SetTimer WatchSpells, 10
  20. else
  21. SetTimer WatchSpells, Off
  22. if (hold)
  23. loop
  24. if !getkeystate(hotkey, "P")
  25. {
  26. SetTimer WatchSpells, Off
  27. break
  28. }
  29. return
  30.  
  31. WatchSpells() {
  32. IniRead, X1, Configuration.ini, ScanArea, X1
  33. IniRead, Y1, Configuration.ini, ScanArea, Y1
  34. IniRead, X2, Configuration.ini, ScanArea, X2
  35. IniRead, Y2, Configuration.ini, ScanArea, Y2
  36. If(X2 = -1)
  37. X2 := A_ScreenWidth
  38. If(Y2 = -1)
  39. Y2 := A_ScreenHeight
  40. IniRead, SPELLS, Configuration.ini, SpellHotkeys
  41. SPELL_KEYMAP := []
  42. Loop, Parse, SPELLS, "`n"
  43. {
  44. Array := StrSplit(A_LoopField, "=", , 2)
  45. SPELL_KEYMAP[Array[1]] := Array[2]
  46. }
  47.  
  48. for spell, key in SPELL_KEYMAP
  49. {
  50. if detect_Skill()=1{
  51. Send % key
  52. }
  53. }
  54. }
  55. return
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. detect_Skill(){
  64. ImageSearch, , , X1, Y1, X2, Y2, % "C:\Aimee\DKK\" spell ".png"
  65. if (ErrorLevel=0)
  66. {
  67. return, 1
  68. }
  69. else
  70. {
  71. return, 0
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement