diff options
author | Kobert <Kassian.Kobert@gmail.com> | 2018-06-04 23:50:02 +0200 |
---|---|---|
committer | Kobert <Kassian.Kobert@gmail.com> | 2018-06-04 23:50:02 +0200 |
commit | 58e3338cf0f1f454f8d59c37d9b1d7986c1cc696 (patch) | |
tree | f6519043d7311588816f92d0f2c26ea2074bd632 /DiscoBot/Commands | |
parent | b07b3dcea813f28a9f0f345352d7bd4e60289c5e (diff) | |
parent | 7f55f6f289b5ab5b7fd4ac42b472b51a9a0e679e (diff) |
Merge
Diffstat (limited to 'DiscoBot/Commands')
-rw-r--r-- | DiscoBot/Commands/CommandTypes.cs | 3 | ||||
-rw-r--r-- | DiscoBot/Commands/FileHandler.cs | 6 | ||||
-rw-r--r-- | DiscoBot/Commands/Gm.cs | 4 | ||||
-rw-r--r-- | DiscoBot/Commands/List.cs | 3 | ||||
-rw-r--r-- | DiscoBot/Commands/MiscCommands.cs | 36 | ||||
-rw-r--r-- | DiscoBot/Commands/NpcCommands.cs | 4 | ||||
-rw-r--r-- | DiscoBot/Commands/ProbenTest.cs | 29 |
7 files changed, 43 insertions, 42 deletions
diff --git a/DiscoBot/Commands/CommandTypes.cs b/DiscoBot/Commands/CommandTypes.cs index 4ff0814..c1d0954 100644 --- a/DiscoBot/Commands/CommandTypes.cs +++ b/DiscoBot/Commands/CommandTypes.cs @@ -7,6 +7,7 @@ Angriff, Parade, Fernkampf, - KeinChar + KeinChar, + Zauber } } diff --git a/DiscoBot/Commands/FileHandler.cs b/DiscoBot/Commands/FileHandler.cs index efebe3f..7885aa9 100644 --- a/DiscoBot/Commands/FileHandler.cs +++ b/DiscoBot/Commands/FileHandler.cs @@ -3,9 +3,9 @@ using System; using System.Linq; using System.Net; - - using DiscoBot.Auxiliary; - using DiscoBot.Characters; + + using DiscoBot.DSA_Game; + using DiscoBot.DSA_Game.Characters; using Discord.Commands; diff --git a/DiscoBot/Commands/Gm.cs b/DiscoBot/Commands/Gm.cs index b426655..2698926 100644 --- a/DiscoBot/Commands/Gm.cs +++ b/DiscoBot/Commands/Gm.cs @@ -4,9 +4,9 @@ using System.Threading.Tasks; using DiscoBot.Auxiliary; + using DiscoBot.DSA_Game; using Discord.Commands; - using Discord.WebSocket; public class Gm : ModuleBase { @@ -27,6 +27,8 @@ return chr.Parade(waffe, erschwernis); case CommandTypes.Fernkampf: return chr.Fernkampf(waffe, erschwernis); + case CommandTypes.Zauber: + return chr.TestZauber(waffe, erschwernis); } return $"{name} verwendet {waffe}"; diff --git a/DiscoBot/Commands/List.cs b/DiscoBot/Commands/List.cs index 8b8b907..3bd03eb 100644 --- a/DiscoBot/Commands/List.cs +++ b/DiscoBot/Commands/List.cs @@ -8,7 +8,8 @@ using DiscoBot.Audio; using DiscoBot.Auxiliary; - using DiscoBot.Characters; + using DiscoBot.DSA_Game; + using DiscoBot.DSA_Game.Characters; using Discord.Commands; diff --git a/DiscoBot/Commands/MiscCommands.cs b/DiscoBot/Commands/MiscCommands.cs index 8c9417c..158882c 100644 --- a/DiscoBot/Commands/MiscCommands.cs +++ b/DiscoBot/Commands/MiscCommands.cs @@ -24,6 +24,7 @@ namespace DiscoBot.Commands using System.Windows.Forms; using DiscoBot.Auxiliary; + using DiscoBot.DSA_Game; using Discord; using Discord.Commands; @@ -111,40 +112,7 @@ namespace DiscoBot.Commands var us = users.Result.Select(x => x.Username); var lines = test.Where(x => !x.Equals(string.Empty)).ToList(); - - string ls = string.Empty; - using (var client = new WebClient()) - { - ls =client.DownloadString(@"https://discordapp.com/assets/8529401dde4ab112e81d.js"); - } - - /*using (ScriptEngine engine = new ScriptEngine("jscript")) - { - ParsedScript parsed = engine.Parse(ls); - Debug.WriteLine(parsed.CallMethod("t", 3)); - }*/ - /*var task = MessageLoopWorker.Run(WebCrawler.DoWorkAsync, - "https://discordapp.com/widget?id=361270203952136203&theme=dark"); - task.Wait(); - var kl =task.Result; - Console.WriteLine("DoWorkAsync completed."); - - - ls = WebCrawler.Crawl("https://discordapp.com/widget?id=361270203952136203&theme=dark"); -*/ - /* - ScrapingBrowser Browser = new ScrapingBrowser(); - Browser.AllowAutoRedirect = true; // Browser has settings you can access in setup - Browser.AllowMetaRedirect = true; - Browser.UserAgent = new FakeUserAgent("The Doctor", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"); - Browser.Timeout = TimeSpan.FromMinutes(1); - WebPage PageResult = Browser.NavigateToPage(new Uri("https://discordapp.com/widget?id=361270203952136203&theme=dark")); - //await Task.Delay(TimeSpan.FromSeconds(10)); - - var dom = new ScrapySharp.Html.Parsing.HtmlDomBuilder(new HtmlDeclarationReader(new CodeReader(PageResult.Html.OuterHtml))); - - HtmlNode TitleNode = PageResult.Html.CssSelect(".widget-header").First(); - string PageTitle = TitleNode.InnerText;*/ + var sc = new SpellCorrect(); diff --git a/DiscoBot/Commands/NpcCommands.cs b/DiscoBot/Commands/NpcCommands.cs index f2b17b6..98f4589 100644 --- a/DiscoBot/Commands/NpcCommands.cs +++ b/DiscoBot/Commands/NpcCommands.cs @@ -6,6 +6,8 @@ using DiscoBot.Auxiliary; using DiscoBot.Characters; + using DiscoBot.DSA_Game; + using DiscoBot.DSA_Game.Characters; using Discord.Commands; @@ -34,4 +36,4 @@ return this.ReplyAsync($"{npcName} wurde als variierte Kopie von {source} erstellt"); } } -} +}
\ No newline at end of file diff --git a/DiscoBot/Commands/ProbenTest.cs b/DiscoBot/Commands/ProbenTest.cs index bdfaf23..1d8f8b0 100644 --- a/DiscoBot/Commands/ProbenTest.cs +++ b/DiscoBot/Commands/ProbenTest.cs @@ -2,12 +2,14 @@ { using System.Threading.Tasks; + using DiscoBot.DSA_Game; + using Discord.Commands; public class ProbenTest : ModuleBase { [Command("t"), Summary("Würfelt ein Talent-/Zauberprobe")] - [Alias("T", "Talent", "talent", "zauber", "z", "versuche")] + [Alias("T", "Talent", "talent", "versuche")] public Task TalentAsync([Summary("Talent oder Zaubername")] string talent, int erschwernis = 0) { string res; @@ -31,6 +33,31 @@ return this.ReplyAsync("```xl\n" + res + "\n```"); } + [Command("Zauber"), Summary("Würfelt ein Zauberprobe")] + [Alias("Z", "zauber", "z")] + public Task ZauberAsync([Summary("Zaubername")] string zauber, int erschwernis = 0) + { + string res; + try + { + res = Gm.CheckCommand( + Dsa.Relation[this.Context.User.Username], + CommandTypes.Zauber, + zauber, + erschwernis); + } + catch + { + res = Gm.CheckCommand( + Dsa.Relation["Tardis"], + CommandTypes.Zauber, + zauber, + erschwernis); + } + + return this.ReplyAsync("```xl\n" + res + "\n```"); + } + [Command("e"), Summary("Würfelt eine Eigenschaftsprobe")] [Alias("E", "Eigenschaft", "eigenschaft", "eigen")] public Task EigenschaftAsync([Summary("Eigenschaftskürzel und Erschwernis")] string talent, int erschwernis = 0) |