diff --git "a/ScriptCenter/id\344\275\234\350\200\205\346\220\234\345\233\276.lua" "b/ScriptCenter/id\344\275\234\350\200\205\346\220\234\345\233\276.lua" new file mode 100644 index 0000000000000000000000000000000000000000..865db9c8b4592b8ef4aedb5f8e3e3aa6a0f14987 --- /dev/null +++ "b/ScriptCenter/id\344\275\234\350\200\205\346\220\234\345\233\276.lua" @@ -0,0 +1,73 @@ +Info={} +Info.name="画师id搜图" +Info.author="chorblack" +Info.version="1.1" +Info.description="试着向机器人发送作者搜图帮助" +Event.onLoad = function(bot) + print("载入画师搜图bot"..bot:getId().."成功") + bot:subscribeFriendMsg(function(bot, msg, sender) + if msg:find("作者搜图帮助") then + sender:sendMsg("暂时无法分辨是否r18,介意勿用\n指令:#画师73152,要不要空格都行,默认6张图") + + end + end) + + bot:subscribeGroupMsg(function(bot, msg, group, sender) + if msg:find("#画师") then + group:sendMsg("正在搜索") + api_id = msg:gsub("#画师","") + api_id = api_id:gsub(" ","") + + function Table_Rand(t) + if t == nil then + return + end + local tRet = {} + local Total = #t + while Total > 0 do + local i = math.random(1,Total) + table.insert(tRet,t[i]) + t[i] = t[Total] + Total = Total -1 + end + + return tRet + + end + + local urls = {} + local count = 0 + while true do + count = count+1 + api_json = ("https://api.imjad.cn/pixiv/v2/?type=member_illust&id=" .. api_id .. "&page=" ..count) + html = net.get(api_json) + if html:find('next_url":null') then + break + end + for i in html:gmatch('"original_image_url":"(.-)"') do + url1 = i:gsub("\\","") + url = url1:gsub("i.pximg.net","i.pixiv.cat") + table.insert(urls,url) + end + + end + group:sendMsg("解析完成") + local list = Table_Rand(urls) + local x = 0 + + for j,k in pairs(list) do + x = x+1 + group:sendMsg(Image(k,group)) + if x>5 then + break + end + end + + end + end) +end + +Event.onFinish = + function () + print("脚本被卸载!") + end \ No newline at end of file diff --git "a/ScriptCenter/id\345\233\276\347\211\207\346\220\234\345\233\276.lua" "b/ScriptCenter/id\345\233\276\347\211\207\346\220\234\345\233\276.lua" new file mode 100644 index 0000000000000000000000000000000000000000..680b50e63eeca64e6c1be0617111cf22db3c5158 --- /dev/null +++ "b/ScriptCenter/id\345\233\276\347\211\207\346\220\234\345\233\276.lua" @@ -0,0 +1,83 @@ +Info={} +Info.name="图片id搜图" +Info.author="chorblack" +Info.version="1.0" +Info.description="试着向机器人发送图片搜图帮助" +Event.onLoad = function(bot) + print("载入idbot"..bot:getId().."成功") + bot:subscribeFriendMsg(function(bot, msg, sender) + if msg:find("图片搜图帮助") then + sender:sendMsg("暂时无法分辨是否r18,介意勿用\n指令:#id+关键词,例如:#id 12154521212,要不要空格都行,默认6张图") + + end + end) + bot:subscribeGroupMsg(function(bot, msg, group, sender) + if msg:find("#id") then + group:sendMsg("正在搜索") + api_id = msg:gsub("#id","") + api_id = api_id:gsub(" ","") + + function Table_Rand(t) + if t == nil then + return + end + local tRet = {} + local Total = #t + while Total > 0 do + local i = math.random(1,Total) + table.insert(tRet,t[i]) + t[i] = t[Total] + Total = Total -1 + end + + return tRet + + end + + local urls = {} + local count = 0 + + while true do + count = count+1 + api_json = ("https://api.imjad.cn/pixiv/v2/?type=illust&id=" .. api_id .. "&page=" ..count) + html = net.get(api_json) + if html:find('next_url":null') then + break + end + for i in html:gmatch('"original_image_url":"(.-)"') do + url1 = i:gsub("\\","") + url = url1:gsub("i.pximg.net","i.pixiv.cat") + table.insert(urls,url) + end + end + + if count>1 then + group:sendMsg("图片过多,将随机发送") + local list = Table_Rand(urls) + local x = 0 + + for j,k in pairs(list) do + x = x+1 + group:sendMsg(Image(k,group)) + if x>5 then + break + end + end + end + + for j,k in pairs(urls) do + x = x+1 + group:sendMsg(Image(k,group)) + if x>5 then + break + end + end + + end + end) +end + +Event.onFinish = + function () + print("脚本被卸载!") + end \ No newline at end of file diff --git "a/ScriptCenter/p\346\220\234\345\233\276.lua" "b/ScriptCenter/p\346\220\234\345\233\276.lua" new file mode 100644 index 0000000000000000000000000000000000000000..d11c3d96034f422c3bc3e4cfadb9338f0294a63d --- /dev/null +++ "b/ScriptCenter/p\346\220\234\345\233\276.lua" @@ -0,0 +1,81 @@ +Info={} +Info.name="p搜图" +Info.author="chorblack" +Info.version="1.0" +Info.description="试着向机器人发送搜图帮助" +Event.onLoad = function(bot) + print("载入p搜图bot"..bot:getId().."成功") + bot:subscribeFriendMsg(function(bot, msg, sender) + if msg:find("搜图帮助") then + sender:sendMsg("暂时无法分辨是否r18,介意勿用\n指令:#搜图+关键词,例如:#搜图 fgo,要不要空格都行,默认6张图,没有品质限制,以后再加") + + end + end) + bot:subscribeGroupMsg(function(bot, msg, group, sender) + if msg:find("#搜图") then + group:sendMsg("正在搜索") + api_value = msg:gsub("#搜图","") + api_value = api_value:gsub(" ","") + + function Table_Rand(t) + if t == nil then + return + end + local tRet = {} + local Total = #t + while Total > 0 do + local i = math.random(1,Total) + table.insert(tRet,t[i]) + t[i] = t[Total] + Total = Total -1 + end + + return tRet + + end + + local urls = {} + local count = 0 + + while true do + count = count+1 + api_json = ("https://api.imjad.cn/pixiv/v2/?type=search&word=" .. api_value .. "&page=" ..count) + html = net.get(api_json) + if html:find('next_url":null') then + break + end + + for i in html:gmatch('"original_image_url":"(.-)"') do + url1 = i:gsub("\\","") + url = url1:gsub("i.pximg.net","i.pixiv.cat") + table.insert(urls,url) + end + + if count>10 then + break + end + + end + + group:sendMsg("解析完成") + + local list = Table_Rand(urls) + local x = 0 + + for j,k in pairs(list) do + if x>5 then + break + end + x = x+1 + group:sendMsg(Image(k,group)) + + end + + end + end) +end + +Event.onFinish = + function () + print("脚本被卸载!") + end \ No newline at end of file diff --git "a/ScriptCenter/\346\214\207\345\256\232\346\266\251\345\233\276-\345\244\232\345\233\276\347\250\263\345\256\232\347\211\210.lua" "b/ScriptCenter/\346\214\207\345\256\232\346\266\251\345\233\276-\345\244\232\345\233\276\347\250\263\345\256\232\347\211\210.lua" index 9ce94f41d826ffc53c12846ed0a9fa5cf372d5d0..ace9e0362f33081469ce17d15b1eb85e9aeb855d 100644 --- "a/ScriptCenter/\346\214\207\345\256\232\346\266\251\345\233\276-\345\244\232\345\233\276\347\250\263\345\256\232\347\211\210.lua" +++ "b/ScriptCenter/\346\214\207\345\256\232\346\266\251\345\233\276-\345\244\232\345\233\276\347\250\263\345\256\232\347\211\210.lua" @@ -1,25 +1,67 @@ Info={} Info.name="指定色图-多图稳定版" Info.author="chorblack" -Info.version="1.2" -Info.description="试着向机器人发送‘st’+关键词" ---[[ 说明:本插件根据ooooonly写的随机涩图进行了一些修改,opensourcefuture进行了一些修正 -apikey的申请需要用到的工具:tg,条件:科学上网 -来源:https://moe.best/cross.html -apikey申请地址:https://t.me/loliconApiBot -_18为r18的控制开关,填写0为无r18,1为全r18,2为混合 -]] +Info.version="1.3" +Info.description="试着向机器人发送涩图帮助" Event.onLoad = function(bot) print("载入涩图bot"..bot:getId().."成功") _apikey = "" --请在""中输入apikey --私聊 + r18 = 0 + master = {123456} --请改为你的QQ,多管理员用,隔开 bot:subscribeFriendMsg(function(bot, msg, sender) - local _r18 = 0 - if msg:find("st") then - api_value = msg:gsub("st","") - api_json = ("https://api.lolicon.app/setu/?apikey=" .. _apikey .. "&r18=" .. _r18 .. "&keyword=" .. api_value .. "&num=3") + if msg:find("涩图帮助") then + sender:sendMsg("apikey的申请需要用到的工具:tg,条件:科学上网\n来源:https://moe.best/cross.html\napikey申请地址:https://t.me/loliconApiBot\n_18为r18的控制开关,填写0为无r18,1为全r18,2为混合") + sender:sendMsg("指令合集:#st+关键词+数量,也可以直接#st+数量得到随机涩图\n例如:#stfgo 3,#st 4\n带不带空格都行,最后的数量要用空格隔开\nr18开启指令:私聊:开启/关闭r18,需要管理员权限,群聊:#开启/关闭r18") + sender:sendMsg("另:不能使用(主要是timeout)时,科学上网\n无apikey时一天只有几次测试机会\n请填写apikey与master") + + end + + if msg:find("开启r18") then + + function isInArray(t, val) + for _, v in ipairs(t) do + if v == val then + return true + end + end + return false + end + + local TF = isInArray(master,sender.id) + + if TF == true then + r18 = 1 + sender:sendMsg("r18开启成功") + else + sender:sendMsg("请联系bot主人授权") + end + end + + if msg:find("关闭r18") then + r18 = 0 + group:sendMsg("r18已关闭") + end + if msg:find("#st") then + sender:sendMsg("start") + api_value = msg:gsub("#st","") + api_value = api_value:sub(1,-3) + api_value = api_value:gsub(" ","") + api_num = msg:match("%d",-2) + if api_value == nil then + api_value = '' + end + if api_num == nil then + api_num = 1 + end + api_json = ("https://api.lolicon.app/setu/?apikey=" .. _apikey .. "&r18=" .. r18 .. "&num=" .. api_num .. "keyword=" ..api_value) html = net.get(api_json) + + if html:find("没有符合条件的色图") then + sender:sendMsg("没有符合条件的色图") + end + for i in html:gmatch('"url":"(.-)"') do url = i:gsub("\\","") sender:sendMsg(Image(url,sender)) @@ -27,17 +69,62 @@ Event.onLoad = function(bot) end end) --群聊 + _r18 = 0 bot:subscribeGroupMsg(function(bot, msg, group, sender) - local _r18 = 0 - if msg:find("st") then - api_value = msg:gsub("st","") - api_json = ("https://api.lolicon.app/setu/?apikey=" .. _apikey .. "&r18=" .. _r18 .. "&keyword=" .. api_value .. "&num=3") + + if msg:find("#开启r18") then + + function isInArray(t, val) + for _, v in ipairs(t) do + if v == val then + return true + end + end + return false + end + + local TF = isInArray(master,sender.id) + + + + if TF == true then + _r18 = 1 + group:sendMsg("r18开启成功") + else + group:sendMsg("请联系bot主人授权") + end + end + + if msg:find("#关闭r18") then + _r18 = 0 + group:sendMsg("r18已关闭") + end + + if msg:find("#st") then + group:sendMsg(Image("/096708CE-21F8-3AAD-B8E5-2223D679DAE4",group)) + api_value = msg:gsub("#st","") + api_value = api_value:sub(1,-3) + api_value = api_value:gsub(" ","") + api_num = msg:match("%d",-2) + if api_value == nil then + api_value = '' + end + if api_num == nil then + api_num = 1 + end + api_json = ("https://api.lolicon.app/setu/?apikey=" .. _apikey .. "&r18=" .. _r18 .. "&num=" .. api_num .."&keyword=" ..api_value) html = net.get(api_json) + + if html:find("没有符合条件的色图") then + group:sendMsg("没有符合条件的色图") + end + --local m = Msg() for i in html:gmatch('"url":"(.-)"') do url = i:gsub("\\","") - --group:sendMsg(url) - group:sendMsg(Image(url,group)) + --m = m+Image(url,group) + group:sendMsg(Image(url,group)) --一次发一张 end + --group:sendMsg(m) --一次发多张 end end) end @@ -45,4 +132,4 @@ end Event.onFinish = function () print("脚本被卸载!") - end \ No newline at end of file + end