public void SetSetting(string[] path, string value) { if (path[0].Equals("enabled", StringComparison.CurrentCultureIgnoreCase)) { if (BotUtil.Bool(value)) { this.Enable(); } } }
private void updateMenuItems() { //antidle bool enabled = BotUtil.Bool(bot.GetSetting("/antidle/enabled")); antiidleToolStripMenuItem.Checked = enabled; //eat food enabled = BotUtil.Bool(bot.GetSetting("/eatfood/enabled")); eatFoodToolStripMenuItem.Checked = enabled; }
public void SetSetting(string[] path, string value) { if (path[0].Equals("enabled", StringComparison.CurrentCultureIgnoreCase)) { // Console.WriteLine("|Runemaker module: Enable: " + value); settings.Enabled = BotUtil.Bool(value); if (settings.Enabled) { this.Enable(); } else { this.Disable(); } } else if (path[0].Equals("hand", StringComparison.CurrentCultureIgnoreCase)) { if (!ItemLocation.IsInventory(value)) { return; } Console.WriteLine("seeting inventory location: " + value); settings.InventoryLocation = value; } else if (path[0].Equals("spell", StringComparison.CurrentCultureIgnoreCase)) { Spell spell = game.GetSpell(value); if (spell == null) { return; } settings.Spell = spell; } else if (path[0].Equals("value", StringComparison.CurrentCultureIgnoreCase)) { int val = BotUtil.Number(value); if (val < 0) { return; } settings.Value = val; } else if (path[0].Equals("condition", StringComparison.CurrentCultureIgnoreCase)) { value = value.ToLower(); switch (value) { case "mana percent above": settings.Condition = PlayerConditions.ManaPercentAbove; break; case "mana above": settings.Condition = PlayerConditions.ManaAbove; break; } } else if (path[0].Equals("logout", StringComparison.CurrentCultureIgnoreCase)) { settings.LogoutBlankRunes = BotUtil.Bool(value); } }