Save
这个提交包含在:
38
AbleSend.js
普通文件
38
AbleSend.js
普通文件
@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Core = __importStar(require("./Core"));
|
||||
var CGI = require("./CGI");
|
||||
(function () {
|
||||
var SendAble = Core.frame.ReadSystemConfig("SendAble");
|
||||
var Ks = 1;
|
||||
Core.AddListener(function (c, i) {
|
||||
if (CGI.HOOK) {
|
||||
return;
|
||||
}
|
||||
var delete_msg = (function (msgid) {
|
||||
if (i.group_id != undefined) {
|
||||
Core.frame.SendMsg(c, i, "[!][警告]有一个未备案消息被发送,请管理员自行验证此消息是否合理。");
|
||||
}
|
||||
});
|
||||
if (!(i.group_id != 588932037)) {
|
||||
if (SendAble[Core.GetUser(i.user_id)] != true) {
|
||||
delete_msg(i.message_id);
|
||||
Core.frame.Ban(c, i, 5 * 60 * Ks);
|
||||
Ks = Ks + 1;
|
||||
Core.frame.SendMsg(c, i, Core.frame.At(Core.GetUser(i.user_id)) + ",\u4F60\u7684\u6D88\u606F\u5C5E\u4E8E\u672A\u5907\u6848\u6D88\u606F\uFF0C\u8BF7\u79C1\u4FE1Ai\u53D1\u9001\"\u5907\u6848\"\u6765\u83B7\u53D6\u6D88\u606F\u5907\u6848\u3002");
|
||||
}
|
||||
}
|
||||
if (i.group_id == undefined && i.message == "备案") {
|
||||
SendAble[i.user_id.valueOf()] = true;
|
||||
Core.frame.WriteSystemConfig("SendAble", SendAble);
|
||||
Core.frame.SendMsg(c, i, "你已完成备案。现在你可以在主群中发表你的合理的、合法的、有建设性的意见或建议。");
|
||||
}
|
||||
});
|
||||
})();
|
||||
29
AbleSend.ts
普通文件
29
AbleSend.ts
普通文件
@ -0,0 +1,29 @@
|
||||
import * as Core from "./Core";
|
||||
const CGI = require("./CGI");
|
||||
(()=>{
|
||||
var SendAble = Core.frame.ReadSystemConfig("SendAble") as any;
|
||||
var Ks = 1;
|
||||
Core.AddListener((c,i)=>{
|
||||
if(CGI.HOOK){
|
||||
return;
|
||||
}
|
||||
var delete_msg = ((msgid:Number)=>{
|
||||
if(i.group_id != undefined){
|
||||
Core.frame.SendMsg(c,i,"[!][警告]有一个未备案消息被发送,请管理员自行验证此消息是否合理。");
|
||||
}
|
||||
});
|
||||
if(!(i.group_id != 588932037)){
|
||||
if(SendAble[Core.GetUser(i.user_id)] != true){
|
||||
delete_msg(i.message_id);
|
||||
Core.frame.Ban(c,i,5*60*Ks);
|
||||
Ks = Ks + 1;
|
||||
Core.frame.SendMsg(c,i,`${Core.frame.At(Core.GetUser(i.user_id))},你的消息属于未备案消息,请私信Ai发送"备案"来获取消息备案。`);
|
||||
}
|
||||
}
|
||||
if(i.group_id == undefined&&i.message == "备案"){
|
||||
SendAble[i.user_id.valueOf()] = true
|
||||
Core.frame.WriteSystemConfig("SendAble",SendAble);
|
||||
Core.frame.SendMsg(c,i,"你已完成备案。现在你可以在主群中发表你的合理的、合法的、有建设性的意见或建议。");
|
||||
}
|
||||
});
|
||||
})()
|
||||
2
CGI.js
2
CGI.js
@ -47,7 +47,7 @@ wss.on("connect",(connect)=>{
|
||||
if(s["request_type"]!="group"){
|
||||
connect.send(`{"action":"set_friend_add_request","params":{"flag":"${s["flag"]}","approve":true}}`)
|
||||
}else{
|
||||
connect.send(`{"action":"set_group_add_request","params":{"flag":"${s["flag"]}","sub_type":"${s["sub_type"]}","approve":true}}`)
|
||||
connect.send(`{"action":"set_group_add_request","params":{"flag":"${s["flag"]}","sub_type":"${s["sub_type"]}","approve":true}}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
2
Core.d.ts
vendored
2
Core.d.ts
vendored
@ -65,6 +65,8 @@ declare interface InfoSocket{}
|
||||
/** 读取某个配置项目
|
||||
* @param ConfigName 配置项名称
|
||||
*/function NReadSystemConfig(ConfigName:String|string):Config<any>;
|
||||
function ReadSystemConfig(ConfigName:String|string):any;
|
||||
function WriteSystemConfig(ConfigName:String|string,value:any):any;
|
||||
/**写入某个配置项目
|
||||
* @param ConfigName 配置名称
|
||||
* @param ConfigValue 配置内容
|
||||
|
||||
二进制文件未显示。
44
板砖.js
44
板砖.js
@ -23,11 +23,25 @@ exports.add = {
|
||||
if(Money.add.Interfaces.GetUserMoney(Core.GetUser(info["user_id"]))>100){
|
||||
Money.add.Interfaces.CostUserMoney(Core.GetUser(info["user_id"]),100);
|
||||
exports.add.Interfaces.GiveUser板砖(Core.GetUser(info["user_id"]),1);
|
||||
Core.frame.SendMsg(connect,info,`<获得板砖>\\r\\n[板砖]*1\\r\\n<持有板砖>\\r\\n[板砖]*${exports.add.Interfaces.GetUser板砖(Core.GetUser(info["user_id"]))}`);
|
||||
Core.frame.SendMsg(connect,info,`消耗金币 * 100\\r\\n<获得板砖>\\r\\n[板砖]*1\\r\\n<持有板砖>\\r\\n[板砖]*${exports.add.Interfaces.GetUser板砖(Core.GetUser(info["user_id"]))}`);
|
||||
}else{
|
||||
Core.frame.SendMsg(connect,info,"你的金币不足100。");
|
||||
}
|
||||
}
|
||||
if(message.substr(0,4)=="批发板砖"||message.substr(0,6)=="批量购买板砖"){
|
||||
var count = new Number(message.replace("批发板砖","").replace("批量购买板砖",""));
|
||||
if(count<0||isNaN(count)){
|
||||
Core.frame.SendMsg(connect,info,"Are you kidding me?");
|
||||
return;
|
||||
}
|
||||
if(!(Money.add.Interfaces.GetUserMoney(Core.GetUser(info.user_id))>count*100)){
|
||||
Core.frame.SendMsg(connect,info,"你再批发就破产了。");
|
||||
}else{
|
||||
Money.add.Interfaces.CostUserMoney(Core.GetUser(info.user_id),100*count);
|
||||
exports.add.Interfaces.GiveUser板砖(Core.GetUser(info.user_id),count);
|
||||
Core.frame.SendMsg(connect,info,`消耗金币 * ${100*count}\\r\\n<获得板砖>\\r\\n[板砖]*${count}\\r\\n<持有板砖>\\r\\n[板砖]*${exports.add.Interfaces.GetUser板砖(Core.GetUser(info["user_id"]))}`);
|
||||
}
|
||||
}
|
||||
if(message.substr(0,3)=="敲板砖"){
|
||||
var Tuser = message.replace("敲板砖","");
|
||||
Tuser = Tuser.replace("[CQ:at,qq=","");
|
||||
@ -55,5 +69,33 @@ exports.add = {
|
||||
Core.frame._Ban(connect,info,Tuser,BT);
|
||||
Core.frame.SendMsg(connect,info,`敲板砖成功,已禁言${Core.frame.At(Tuser)}长达${BT}秒。你剩余${exports.add.Interfaces.GetUser板砖(Core.GetUser(info["user_id"]))}个板砖。`);
|
||||
}
|
||||
if(message.substr(0,4)=="批量砸人"||message.substr(0,5)=="批量敲板砖"){
|
||||
var Tuser = message.replace("批量砸人","").replace("批量敲板砖","");
|
||||
var E = Tuser.split("|");
|
||||
var TuserZ = E[0].replace("[CQ:at,qq=","");
|
||||
TuserZ = TuserZ.replace("]","");
|
||||
TuserZ = TuserZ.replace(" ","");
|
||||
if(TuserZ == Core.GetUser(info["user_id"])){
|
||||
Core.frame.SendMsg(connect,info,"不可以敲自己");
|
||||
return;
|
||||
}
|
||||
if(!exports.add.Interfaces.GetUser板砖(Core.GetUser(info["user_id"]))>=new Number(E[1])){
|
||||
Core.frame.SendMsg(connect,info,"你没有板砖,快去购买一个吧!");
|
||||
return;
|
||||
}
|
||||
if(Debug.add.Interfaces.IsAdmin(Core.GetUser(TuserZ))){
|
||||
if(Debug.add.Interfaces.IsAdmin(Core.GetUser(info["user_id"]))){
|
||||
Core.frame.SendMsg(connect,info,`${Core.frame.At(Core.GetUser(info["user_id"]))},你们AI管理员别内斗了行不!?`);
|
||||
}else{
|
||||
Core.frame.SendMsg(connect,info,"AI管理员不可以被板砖攻击。");
|
||||
Core.frame.Ban(connect,info,60);
|
||||
}
|
||||
return;
|
||||
}
|
||||
var BT = Math.floor(Math.random()*300) * E[1];
|
||||
exports.add.Interfaces.GiveUser板砖(Core.GetUser(info["user_id"]),-E[1]);
|
||||
Core.frame._Ban(connect,info,TuserZ,BT);
|
||||
Core.frame.SendMsg(connect,info,`敲板砖成功,已禁言${Core.frame.At(TuserZ)}长达${BT}秒。你剩余${exports.add.Interfaces.GetUser板砖(Core.GetUser(info["user_id"]))}个板砖。`);
|
||||
}
|
||||
}
|
||||
}
|
||||
53
赢青插件.ts
普通文件
53
赢青插件.ts
普通文件
@ -0,0 +1,53 @@
|
||||
import * as Core from "./Core";
|
||||
export namespace 赢青{
|
||||
export interface 位置{
|
||||
名称:String|string;
|
||||
东:位置|undefined;
|
||||
南:位置|undefined;
|
||||
西:位置|undefined;
|
||||
北:位置|undefined;
|
||||
}
|
||||
export interface 物品配置{
|
||||
名称:String;
|
||||
}
|
||||
export interface 物品数据配置{
|
||||
实例:物品配置;
|
||||
数量:Number;
|
||||
}
|
||||
export interface 玩家信息{
|
||||
物品:物品数据配置[];
|
||||
位置:位置;
|
||||
}
|
||||
export class 玩家信息 implements 玩家信息{
|
||||
constructor(that:玩家信息){
|
||||
this.位置 = that.位置;
|
||||
this.物品 = []
|
||||
for(var i=0;i<that.物品.length;i++){
|
||||
this.物品[i] = that.物品[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export var InterFaces = {
|
||||
获取信息:((PlayerID:Number|number)=>{
|
||||
var InfoData = Core.frame.ReadSystemConfig("赢青设定") as 赢青.玩家信息[];
|
||||
if(InfoData[PlayerID.valueOf()]!=undefined){
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
})
|
||||
};
|
||||
(()=>{
|
||||
Core.AddListener((c,i)=>{
|
||||
if(i.message.substr(0,2)!="赢青"){
|
||||
return;
|
||||
}
|
||||
var C = i.message.replace("赢青","");
|
||||
if(C == "信息"){
|
||||
var PlayerData = InterFaces.获取信息(Core.GetUser(i.user_id));
|
||||
var message = `<赢青插件>\r\n玩家名:${Core.frame.At(Core.GetUser(i.user_id))}\r\n$当前地图:${void 0}`
|
||||
}
|
||||
});
|
||||
})();
|
||||
在新工单中引用
屏蔽一个用户