public override void OnLoad(int version, int subversion, int buildversion) { /* * Setting[0] = new StringSetting("Owner name/uuid", "Player that the bots will follow.", ""); * Setting[1] = new NumberSetting("Clicks per second", "How fast should the bot attack?", 5, 1, 60, 1); * Setting[2] = new NumberSetting("Miss rate", "How often does the bot miss?", 15, 0, 100, 1); * Setting[3] = new StringSetting("Friendly name(s)/uuid(s)", "Uuids of the user that own't be hit. Split by spaces'", ""); * Setting[4] = new BoolSetting("Auto equip best armor?", "Should the bot auto equip the best armor it has?", true); * Setting[5] = new BoolSetting("Equip best weapon?", "Should the best item be auto equiped?", true); * Setting[6] = new ComboSetting("Mode", null, new string[] {"Passive", "Aggressive"}, 0); */ Setting.Add(new StringSetting("Owner name/uuid", "Player that the bots will follow.", "")); Setting.Add(new StringListSetting("Friendly name(s)/uuid(s)", "Uuids of the user that own't be hit. Split by spaces'", "")); Setting.Add(new ComboSetting("Mode", null, new string[] { "Passive", "Aggressive" }, 0)); var clickGroup = new GroupSetting("Clicks", ""); clickGroup.Add(new NumberSetting("Clicks per second", "How fast should the bot attack?", 5, 1, 60, 1)); clickGroup.Add(new NumberSetting("Miss rate", "How often does the bot miss?", 15, 0, 100, 1)); Setting.Add(clickGroup); var equipmentGroup = new GroupSetting("Equipment", ""); equipmentGroup.Add(new BoolSetting("Auto equip best armor?", "Should the bot auto equip the best armor it has?", true)); equipmentGroup.Add(new BoolSetting("Equip best weapon?", "Should the best item be auto equiped?", true)); Setting.Add(equipmentGroup); }
public override void OnLoad(int version, int subversion, int buildversion) { /* * Setting[0] = new NumberSetting("Height", "Height level that the bots should mine at", 12, 1, 256); * Setting[1] = new ComboSetting("Pattern", "", new[] { PATTERNS[0].GetName(), PATTERNS[1].GetName(), PATTERNS[2].GetName() }, 1); * Setting[2] = new StringSetting("Macro on inventory full", "Starts the macro when the bots inventory is full.", ""); * Setting[3] = new BoolSetting("Diamond ore", "", true); * Setting[4] = new BoolSetting("Emerald ore", "", true); * Setting[5] = new BoolSetting("Iron ore", "", true); * Setting[6] = new BoolSetting("Gold ore", "", true); * Setting[7] = new BoolSetting("Redstone ore", "", false); * Setting[8] = new BoolSetting("Lapis Lazuli ore", "", false); * Setting[9] = new BoolSetting("Coal ore", "", false); */ Setting.Add(new NumberSetting("Height", "Height level that the bots should mine at", 12, 1, 256)); Setting.Add(new ComboSetting("Pattern", "", new[] { PATTERNS[0].GetName(), PATTERNS[1].GetName(), PATTERNS[2].GetName() }, 1)); Setting.Add(new StringSetting("Macro on inventory full", "Starts the macro when the bots inventory is full.", "")); var group = new GroupSetting("Ore", "Select which ore types should the bot focus"); group.Add(new BoolSetting("Diamond ore", "", true)); group.Add(new BoolSetting("Emerald ore", "", true)); group.Add(new BoolSetting("Iron ore", "", true)); group.Add(new BoolSetting("Gold ore", "", true)); group.Add(new BoolSetting("Redstone ore", "", false)); group.Add(new BoolSetting("Lapis Lazuli ore", "", false)); group.Add(new BoolSetting("Coal ore", "", false)); Setting.Add(group); }
private static async Task SetGroupSettings(CreateGroupRequest request, CreateGroupResponse response, TraceWriter log) { GraphServiceClient client = ConnectADAL.GetGraphClient(); try { if (!request.AllowToAddGuests) { var groupUnifiedGuestSetting = new GroupSetting() { DisplayName = "Group.Unified.Guest", TemplateId = "08d542b9-071f-4e16-94b0-74abb372e3d9", Values = new List <SettingValue> { new SettingValue() { Name = "AllowToAddGuests", Value = "false" } } }; log.Info($"Setting setting in Group.Unified.Guest (08d542b9-071f-4e16-94b0-74abb372e3d9), AllowToAddGuests = false"); await client.Groups[response.GroupId].Settings.Request().AddAsync(groupUnifiedGuestSetting); } } catch (Exception e) { log.Error($"Error setting AllowToAddGuests for group {response.GroupId}: {e.Message }\n\n{e.StackTrace}"); } }
public GameConfig() { kill_point_30_60 = new IntArray(); kill_point_60 = new IntArray(); delta_level_exp = new IntArray(); carriage_list = new IntArray(); best_carriage_list = new IntArray(); clear_cd_skill_list = new IntArray(); pickup_item_notice = new IntArray(); learn_skill = new LearnSkillConfig(); equip_endure_cost = new EquipEndureCost(); strings = new ConstString(); battlefield = new BattlefieldConfig(); jizhou_battlefield = new JiZhouBattlefieldConfig(); huangjin_battlefield = new HuangJinBattlefieldConfig(); card_mgr = new CardMgr(); group_setting = new GroupSetting(); store_setting = new IBStoreSettings(); relationship = new RelationshipConfig(); OfflineExpItems = new OfflineExpItemCfgArray(); OfflineExpPerLevels = new OfflineExpPerLevelArray(); group_league = new GroupLeagueConfig(); country = new CountryConfig(); auto_equip_when_enter_map_config = new AutoEquipWhenEnterMapConfig(); sign_manager = new SignManager(); }
public override void OnLoad(int version, int subversion, int buildversion) { this.Setting.Add(new LocationSetting("Start x y z", "")); this.Setting.Add(new LocationSetting("End x y z", "")); this.Setting.Add(new StringSetting("Macro on inventory full", "Starts the macro when the bots inventory is full.", "")); this.Setting.Add(new StringSetting("Macro on out of tools", "Starts the macro when the bot runs out of pickaxes.", "")); this.Setting.Add(new ComboSetting("Speed mode", null, new string[] { "Accurate", "Fast" }, 0)); this.Setting.Add(new ComboSetting("Path mode", null, new string[] { "Advanced (mining & building)", "Basic" }, 0)); var blockGroup = new GroupSetting("Blocks", "Block related settings can be found here."); blockGroup.Add(new BlockCollectionSetting("Ignore ids", "What blocks should be ignored.", "", true)); this.Setting.Add(blockGroup); /* * this.Setting.Add(new LocationSetting("--TEMP", "--DESC", new Location(0, 0, 0))); * this.Setting.Add(new StringListSetting("--TEMP2", "--DESC2", "")); * this.Setting.Add(new BlockCollectionSetting("--TEMP3", "--DESC3", "", true)); * * var group = new GroupSetting("Testing groups", "group description"); * group.Add(new StringSetting("wow", "dab", "haters")); * * var temp = new ComboSetting("TEST SETTING", null, new string[] {"TEST 1", "TEST 2"}, 0); * temp.Add(0, new StringSetting("1.1", "What blocks should be ignored.", "1.1")); * temp.Add(0, new StringSetting("1.2", "What blocks should be ignored.", "1.2")); * temp.Add(0, new StringSetting("1.3", "What blocks should be ignored.", "1.3")); * temp.Add(1, new StringSetting("1.1", "What blocks should be ignored.", "1.1")); * group.Add(temp); * * this.Setting.Add(group); */ }
public static void ChatSystemUpdate() { Console.WriteLine("----------------ChatSystemUpdate----------------"); new Thread(() => PrivateChat.GetPage().Update()).Start(); new Thread(() => Chat.GetPage().Update()).Start(); new Thread(() => GroupChat.GetPage().Update()).Start(); new Thread(() => GroupSetting.GetPage().Update()).Start(); new Thread(() => Group.getPage().Update()).Start(); }
public override void OnLoad(int version, int subversion, int buildversion) { Setting.Add(new NumberSetting("Radius (crop, x-radius):", "Radius around the initial bot spawn position that it will look around.", 64, 1, 1000, 1)); Setting.Add(new NumberSetting("Radius (crop, y-radius):", "What can be the Y difference for the bot for it to find valid crops.", 4, 1, 256, 1)); Setting.Add(new ComboSetting("Speed mode", null, new string[] { "Accurate", "Fast" }, 0)); var automationGroup = new GroupSetting("Automation", "Use these settings to automate actions."); var storeSetting = new ComboSetting("On Inventory Full", "What should the bot do once it's inventory is full.", new[] { "Nothing", "Store Inventory In Closest Chest", "Run Macro" }, 1); storeSetting.Add(2, new StringSetting("On Inventory Full Macro", null, "")); automationGroup.Add(storeSetting); this.Setting.Add(automationGroup); }
public static async Task <AllowExternalMembersInGroupResponse> Run([HttpTrigger(AuthorizationLevel.Function, "post")] AllowExternalMembersInGroupRequest request, TraceWriter log) { GraphServiceClient client = ConnectADAL.GetGraphClient(); try { const string externalTemplateId = "08d542b9-071f-4e16-94b0-74abb372e3d9"; GroupSetting externalMemberSetting = new GroupSetting { TemplateId = externalTemplateId }; SettingValue setVal = new SettingValue { Name = "AllowToAddGuests", Value = request.ExternalAllowed.ToString() }; externalMemberSetting.Values = new List <SettingValue> { setVal }; var existingSettings = await client.Groups[request.GroupId].Settings.Request().GetAsync(); bool hasExistingSetting = false; foreach (GroupSetting groupSetting in existingSettings) { if (!groupSetting.TemplateId.Equals(externalTemplateId, StringComparison.InvariantCultureIgnoreCase)) { continue; } await client.Groups[request.GroupId].Settings[groupSetting.Id].Request().UpdateAsync(externalMemberSetting); hasExistingSetting = true; break; } if (!hasExistingSetting) { await client.Groups[request.GroupId].Settings.Request().AddAsync(externalMemberSetting); } return(new AllowExternalMembersInGroupResponse { ExternalAllowed = request.ExternalAllowed }); } catch (Exception e) { log.Error(e.Message); throw; } }
/// <summary> /// Reetrieve the first WMI MSBTS_GroupSetting object in the collection /// </summary> private void RetrieveGroupSettings() { try { GroupSetting.StaticScope = ManagementHelper.GetScope(typeof(GroupSetting), sqlInstanceName, databaseName); foreach (GroupSetting setting in GroupSetting.GetInstances()) { groupSettings = setting; break; } } finally { GroupSetting.StaticScope = null; } }
/// <summary> /// Add new entity to groupSettings /// <param name="body"></param> /// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param> /// </summary> public RequestInformation CreatePostRequestInformation(GroupSetting body, Action <GroupSettingsRequestBuilderPostRequestConfiguration> requestConfiguration = default) { _ = body ?? throw new ArgumentNullException(nameof(body)); var requestInfo = new RequestInformation { HttpMethod = Method.POST, UrlTemplate = UrlTemplate, PathParameters = PathParameters, }; requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); if (requestConfiguration != null) { var requestConfig = new GroupSettingsRequestBuilderPostRequestConfiguration(); requestConfiguration.Invoke(requestConfig); requestInfo.AddRequestOptions(requestConfig.Options); requestInfo.AddHeaders(requestConfig.Headers); } return(requestInfo); }
public override void OnLoad(int version, int subversion, int buildversion) { /* * Setting[0] = new StringSetting("User or Channel ID", "Enable developer mode: Settings->Appearance->Developer mode. Copy id: right click channel and click 'Copy ID'.", ""); * Setting[1] = new BoolSetting("Local notifications", "", true); * Setting[2] = new BoolSetting("Explosion notifications", "", true); * Setting[3] = new BoolSetting("Wither notifications", "", true); * Setting[4] = new BoolSetting("Creeper notifications", "", true); * Setting[5] = new BoolSetting("Player notifications", "", true); * Setting[6] = new StringSetting("Friendly uuid(s)/name(s)", "Uuids/name(s) split by space.", ""); * Setting[7] = new StringSetting("Lamp coordinates", "Coordinates in the [X Y Z] format, split by a space", "[-1 -1 -1] [0 0 0] [1 1 1]"); * Setting[8] = new ComboSetting("Mode", "Notification mode", new []{"none", "@everyone", "@everyone + tts"}, 1); * Setting[9] = new LinkSetting("Add bot", "Adds the bot to your discord channel (you must have administrator permissions).", "https://discordapp.com/oauth2/authorize?client_id=299708378236583939&scope=bot&permissions=6152"); * Setting[10] = new BoolSetting("Detect falling blocks", "Should the bot detected falling sand and falling tnt", true); */ Setting.Add(new StringSetting("User or Channel ID", "Enable developer mode: Settings->Appearance->Developer mode. Copy id: right click channel and click 'Copy ID'.", "")); Setting.Add(new BoolSetting("Local notifications", "", true)); var notificationGroup = new GroupSetting("Notifications", "Select which notifications you wish to get here."); notificationGroup.Add(new BoolSetting("Explosion notifications", "", true)); notificationGroup.Add(new BoolSetting("Wither notifications", "", true)); notificationGroup.Add(new BoolSetting("Creeper notifications", "", true)); notificationGroup.Add(new BoolSetting("Player notifications", "", true)); notificationGroup.Add(new BoolSetting("Detect falling tnt", "Should the bot detected falling tnt", true)); notificationGroup.Add(new BoolSetting("Detect falling sand", "Should the bot detected falling sand", true)); Setting.Add(notificationGroup); var otherGroup = new GroupSetting("Miscellaneous", ""); otherGroup.Add(new StringListSetting("Friendly uuid(s)/name(s)", "Uuids/name(s) split by space.", "")); otherGroup.Add(new StringListSetting("Lamp coordinates", "Coordinates in the [X Y Z] format, split by a space", "[-1 -1 -1] [0 0 0] [1 1 1]")); otherGroup.Add(new ComboSetting("Mode", "Notification mode", new[] { "none", "@everyone", "@everyone + tts" }, 1)); Setting.Add(otherGroup); Setting.Add(new LinkSetting("Add bot", "Adds the bot to your discord channel (you must have administrator permissions).", "https://discordapp.com/oauth2/authorize?client_id=299708378236583939&scope=bot&permissions=6152")); }
private void PrepareSettings(Data data) { groupSettings = new GroupSettings(); settingsStackPanel.Children.Clear(); foreach (GroupContainer i in data.Groups.GroupContainers) { GroupSetting groupSetting = new GroupSetting(i.AppliesTo, i.Name, i.Items[0].Code); groupSetting.PropertyChanged += groupSetting_PropertyChanged; groupSettings.Settings.Add(groupSetting); List <string> settingNames = new List <string>(); foreach (Group group in i.Items) { settingNames.Add(group.Name); } Setting setting = new Setting(i.Name, settingNames); setting.CurrentSetting = groupSettings.Settings[groupSettings.Settings.Count - 1]; settingsStackPanel.Children.Add(setting.Drawable); } }
private void initGroupSettings() { _groupSetting = new GroupSetting(); }
public void Save() { GroupSetting.Save(ctx.PostValue <GroupSetting>("x")); echoRedirectPart(lang("opok")); }
public static async Task <HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "post")] CreateGroupRequest request, TraceWriter log) { try { if (string.IsNullOrWhiteSpace(request.Name)) { throw new ArgumentException("Parameter cannot be null", "Name"); } if (string.IsNullOrWhiteSpace(request.Description)) { throw new ArgumentException("Parameter cannot be null", "Description"); } string mailNickName = await GetUniqueMailAlias(request); string displayName = GetDisplayName(request); GraphServiceClient client = ConnectADAL.GetGraphClient(GraphEndpoint.Beta); var newGroup = new Group { DisplayName = displayName, Description = GetDescription(request.Description, 1000), MailNickname = mailNickName, MailEnabled = true, SecurityEnabled = false, Visibility = request.Public ? "Public" : "Private", GroupTypes = new List <string> { "Unified" }, Classification = request.Classification }; var addedGroup = await client.Groups.Request().AddAsync(newGroup); var createGroupResponse = new CreateGroupResponse { GroupId = addedGroup.Id, DisplayName = displayName, Mail = addedGroup.Mail }; try { if (!request.AllowToAddGuests) { var groupUnifiedGuestSetting = new GroupSetting() { DisplayName = "Group.Unified.Guest", TemplateId = "08d542b9-071f-4e16-94b0-74abb372e3d9", Values = new List <SettingValue> { new SettingValue() { Name = "AllowToAddGuests", Value = "false" } } }; log.Info($"Setting setting in Group.Unified.Guest (08d542b9-071f-4e16-94b0-74abb372e3d9), AllowToAddGuests = false"); await client.Groups[addedGroup.Id].Settings.Request().AddAsync(groupUnifiedGuestSetting); } } catch (Exception e) { log.Error($"Error setting AllowToAddGuests for group {addedGroup.Id}: {e.Message }\n\n{e.StackTrace}"); } return(await Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <CreateGroupResponse>(createGroupResponse, new JsonMediaTypeFormatter()) })); } catch (Exception e) { log.Error($"Error: {e.Message }\n\n{e.StackTrace}"); return(await Task.FromResult(new HttpResponseMessage(HttpStatusCode.ServiceUnavailable) { Content = new ObjectContent <string>(e.Message, new JsonMediaTypeFormatter()) })); } }