Advertisement
Guest User

d2stats_hotkey_handling

a guest
Feb 23rd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.27 KB | None | 0 0
  1. --- D2Stats.au3.0   2017-02-22 14:10:02.000000000 +0100
  2. +++ D2Stats.au3 2017-02-23 10:30:42.000000000 +0100
  3. @@ -113,7 +113,7 @@
  4.  endfunc
  5.  
  6.  func HotKeyCheck()
  7. -   if (not IsIngame()) then return _Debug("Enter a game first.")
  8. +   if (not IsIngame()) then return false
  9.     return True
  10.  endfunc
  11.  
  12. @@ -156,20 +156,35 @@
  13.  endfunc
  14.  
  15.  func HotKey_ShowIlvl()
  16. -   if (not HotKeyCheck()) then return
  17. +   if (not HotKeyCheck()) then
  18. +       HotKeySet("{DEL}")
  19. +       Send("{DEL}")
  20. +       HotKeySet("{DEL}","HotKey_ShowIlvl")
  21. +       return
  22. +   endif
  23.  
  24.     local $ilvl = GetIlvl()
  25.     if ($ilvl) then PrintString(StringFormat("ilvl: %02s", $ilvl))
  26.  endfunc
  27.  
  28.  func HotKey_ToggleShowItems()
  29. -   if (not HotKeyCheck()) then return
  30. +   if (not HotKeyCheck()) then
  31. +       HotKeySet("{HOME}")
  32. +       Send("{HOME}")
  33. +       HotKeySet("{HOME}", "HotKey_ToggleShowItems")
  34. +       return
  35. +   endif
  36.     ToggleShowItems()
  37.  endfunc
  38.  
  39.  func HotKey_DropFilter()
  40. +   if (not HotKeyCheck()) then
  41. +       HotKeySet("+{HOME}")
  42. +       Send("+{HOME}")
  43. +       HotKeySet("+{HOME}","HotKey_DropFilter")
  44. +       return
  45. +   endif
  46.     if (not FileExists("DropFilter.dll")) then return PrintString("Couldn't find DropFilter.dll. Make sure it's in the same folder as " & @ScriptName & ".", 1)
  47. -   if (not HotKeyCheck()) then return
  48.  
  49.     local $handle = GetDropFilterHandle()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement