private void OnUse() { if (spell.Circle != 100) { KeyData key = HotKey.Get(spell.Name); if (key == null) { spell.OnCast(new CastSpellFromMacro((ushort)spell.GetID())); } else { key.Callback(); } OpenEUO.SetAsync("LSpell", spell.GetID() - 1); } else { OpenEUO.CallAsync("Macro", spell.Number == 0 ? 35 : 36, 0); } }
private static bool Hotkey(string command, Variable[] vars, bool quiet, bool force) { if (vars.Length < 1) { throw new RunTimeError("Usage: hotkey ('name of hotkey') OR (hotkeyId)"); } string query = vars[0].AsString(); KeyData hk = HotKey.GetByNameOrId(query); if (hk == null) { throw new RunTimeError($"{command} - Hotkey '{query}' not found"); } hk.Callback(); return(true); }
private static bool Hotkey(string command, Argument[] args, bool quiet, bool force) { if (args.Length < 1) { throw new RunTimeError(null, "Usage: hotkey ('name of hotkey') OR (hotkeyId)"); } string query = args[0].AsString(); KeyData hk = HotKey.GetByNameOrId(query); if (hk == null) { throw new RunTimeError(null, $"Hotkey '{query}' not found"); } hk.Callback(); return(true); }