From 79e7446eb94ea82f2af6e866bee06f580feed83f Mon Sep 17 00:00:00 2001 From: Akamaru Date: Sun, 13 Nov 2016 22:40:24 +0100 Subject: [PATCH] Ein paar fixes --- miku/plugins/mal_user.lua | 29 +++++++++++++++++++---------- miku/plugins/random.lua | 5 ++++- miku/plugins/special.lua | 8 ++++---- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/miku/plugins/mal_user.lua b/miku/plugins/mal_user.lua index 73f0747..55d800d 100644 --- a/miku/plugins/mal_user.lua +++ b/miku/plugins/mal_user.lua @@ -13,21 +13,30 @@ end mal_user.command = 'malu ' function mal_user:get_infos(user) - local url = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D%22http%3A%2F%2Fmyanimelist.net%2Fmalappinfo.php%3Fu%3D'..user..'%22&format=json&diagnostics=true&callback=' + local url = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D%22http%3A%2F%2Fmyanimelist.net%2Fmalappinfo.php%3Fu%3D'..user..'%22&format=json' local res, code = https.request(url) if code ~= 200 then return nil end local data = json.decode(res).query.results.myanimelist.myinfo if not data then return nil end - local name = data.user_name - local watching = data.user_watching - local pause = data.user_onhold - local dropped = data.user_dropped - local complete = data.user_completed - local planed = data.user_plantowatch - local mal_url = 'http://myanimelist.net/profile/'..data.user_name - local text = ''..name..' schaut derzeit '..watching..' Animes, hat '..pause..' pausiert, '..dropped..' abgebrochen und '..complete..' beendet. '..planed..' stehen auf der Watchlist.\nProfil aufrufen' - + local name = ''..data.user_name..'' + local id = ' (ID '..data.user_id..')' + if data.user_watching == '1' then + watching = ''..data.user_watching..' Anime' + else + watching = ''..data.user_watching..' Animes' + end + local pause = ''..data.user_onhold..' pausiert' + local dropped = ''..data.user_dropped..' abgebrochen' + local complete = ''..data.user_completed..' beendet' + if data.user_plantowatch == '1' then + planed = ''..data.user_plantowatch..' steht' + else + planed = ''..data.user_plantowatch..' stehen' + end + local mal_url = 'Profil aufrufen' + + local text = name..id..' schaut derzeit '..watching..', hat '..pause..', '..dropped..' und '..complete..'. '..planed..' auf der Watchlist.\n'..mal_url return text end diff --git a/miku/plugins/random.lua b/miku/plugins/random.lua index 7efe43e..068896d 100644 --- a/miku/plugins/random.lua +++ b/miku/plugins/random.lua @@ -52,7 +52,10 @@ function fun:choose_random(user_name, other_user) user_name..' schickt '..other_user..' nach Bikini Bottom.', user_name..' beamt '..other_user..' hoch.', user_name..' und '..other_user..' sind taube Nüsschen. Yeah!', - user_name..' schmiert Hundescheiße auf '..other_user..'’s Nike Air.' + user_name..' schmiert Hundescheiße auf '..other_user..'’s Nike Air.', + user_name..' erstellt eine falsche Route auf '..other_user..'’s Navi.', + user_name..' zieht '..other_user..' die Hose aus.', + user_name..' schenkt '..other_user..' Bibis Beauty-Cream.' } math.randomseed(os.time()) math.randomseed(os.time()) diff --git a/miku/plugins/special.lua b/miku/plugins/special.lua index b7552bb..74ecbfd 100644 --- a/miku/plugins/special.lua +++ b/miku/plugins/special.lua @@ -2,6 +2,8 @@ local special = {} special.triggers = { "[Rr][Ii][Cc][Hh] [Bb][Ii][Tt][Cc][Hh]", + "[Mm]ö[Dd][Cc][Hh][Ee][Nn]", + "[Mm]Ö[Dd][Cc][Hh][Ee][Nn]", "^[Mm][Ii][Kk][Uu]%??$", "^/[Oo][Ll][Dd]$", "^[Nn][Yy][Uu]$", @@ -22,8 +24,6 @@ special.triggers = { "^[Yy][Oo][Ll][Oo]$", "[Ii] [Ww][Ii][Ss][Hh] [Ss][Qq][Uu][Ii][Dd][Ss] [Ww][Ee][Rr][Ee] [Rr][Ee][Aa][Ll]", "^/[Kk][Ii][Ll][Ll] (.*)", - "[Mm]ö[Dd][Cc][Hh][Ee][Nn]", - "[Mm]Ö[Dd][Cc][Hh][Ee][Nn]", "^[Pp][Ee]$", "^[Vv][Aa]$", "^[Mm][Uu]$", @@ -43,6 +43,8 @@ function special:action(msg, config, matches) if msg_text:match("[Rr][Ii][Cc][Hh] [Bb][Ii][Tt][Cc][Hh]") then output = 'Akamaru ist nicht reich!' + elseif msg_text:match("[Mm]ö[Dd][Cc][Hh][Ee][Nn]") or msg_text:match("[Mm]Ö[Dd][Cc][Hh][Ee][Nn]") then + output = 'Es heißt MÄDCHEN!' elseif string.match(msg.text, "[Mm][Ii][Kk][Uu]%??") then local alive_answers = {'Ja?','Was gibts, '..user_name..'?','Ja '..user_name..', was ist?', 'Ich bin noch da.', user_name, 'Nein!','So heiße ich', 'Nerv mich nicht!','Was.'} local random_alive = math.random(9) @@ -101,8 +103,6 @@ function special:action(msg, config, matches) return elseif msg_text:match("[Kk][Ii][Ll][Ll]") then output = user_name..' tötet '..matches[1] - elseif msg_text:match("[Mm]ö[Dd][Cc][Hh][Ee][Nn]") or msg_text:match("[Mm]Ö[Dd][Cc][Hh][Ee][Nn]") then - output = 'Es heißt MÄDCHEN!' elseif msg_text:match("[Pp][Ee]") then output = 'nis' elseif msg_text:match("[Vv][Aa]") then