添加示例项目

This commit is contained in:
2026-04-16 16:27:53 +08:00
parent 69a2141804
commit 721fb5a992
192 changed files with 10148 additions and 0 deletions

View File

@@ -0,0 +1,145 @@
function _Dps_GmConvenienceConsole_Logic_() {
local Config = GlobalConfig.Get("GM便捷操作台_Lenheart.json");
Gm_InputFunc_Handle[Config["发送道具指令"]] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
local Ret = SUser.GiveItem(handler[1].tointeger(), 1);
if (!Ret) SUser.SendNotiPacketMessage("发送失败背包是不是满了", 8);
} else if (count == 2) {
local Ret = SUser.GiveItem(handler[1].tointeger(), handler[2].tointeger());
if (!Ret) SUser.SendNotiPacketMessage("发送失败背包是不是满了", 8);
}
}
Gm_InputFunc_Handle[Config["转职觉醒指令"]] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
SUser.ChangeGrowType(handler[1].tointeger(), 0);
SUser.SendNotiPacket(0, 2, 0);
SUser.InitSkillW(handler[1].tointeger(), 0);
} else if (count == 2) {
SUser.ChangeGrowType(handler[1].tointeger(), handler[2].tointeger());
SUser.SendNotiPacket(0, 2, 0);
SUser.InitSkillW(handler[1].tointeger(), handler[2].tointeger());
}
}
Gm_InputFunc_Handle[Config["完成任务指令"]] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
SUser.ClearQuest_Gm(handler[1].tointeger());
}
}
Gm_InputFunc_Handle[Config["设置等级指令"]] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
SUser.SetCharacLevel(handler[1].tointeger());
}
}
//获取位置信息
Gm_InputFunc_Handle[Config["获取位置指令"]] <- function(SUser, CmdString) {
local Location = SUser.GetLocation();
SUser.SendNotiPacketMessage("X坐标: " + Location.Pos.X, 8);
SUser.SendNotiPacketMessage("Y坐标: " + Location.Pos.Y, 8);
SUser.SendNotiPacketMessage("城镇编号: " + Location.Town, 8);
SUser.SendNotiPacketMessage("区域编号: " + Location.Area, 8);
};
//踢人下线
Gm_InputFunc_Handle[Config["踢玩家下线指令"]] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
local TUser = World.GetUserByName(handler[1]);
if(TUser)TUser.Kick();
}
};
}
function _Dps_GmConvenienceConsole_Main_() {
_Dps_GmConvenienceConsole_Logic_();
}
function _Dps_GmConvenienceConsole_Main_Reload_(OldConfig) {
foreach (Key,Value in OldConfig) {
try {
Gm_InputFunc_Handle.rawdelete(Key);
} catch (exception){
}
}
_Dps_GmConvenienceConsole_Logic_();
}

View File

@@ -0,0 +1,16 @@
{
"发送道具指令": "GiveItem",
"转职觉醒指令": "GrowType",
"完成任务指令": "MakeQuest",
"设置等级指令": "SetLevel",
"获取位置指令": "GetLocation",
"踢玩家下线指令": "KickPlayer",
"发送道具指令例子": "当有一个空格时跟道具编号 当有两个空格时 跟道具编号和发送数量 例: '//GiveItem 3037' '//GiveItem 3037 100'",
"转职觉醒指令例子": "当有一个空格时跟转职职业 当有两个空格时 跟转职职业和是否觉醒 例: '//GrowType 1' '//GrowType 1 1'",
"完成任务指令例子": "当有一个空格时跟任务编号 例: '//MakeQuest 1'",
"设置等级指令例子": "当有一个空格时跟设定等级 例: '//SetLevel 100'",
"获取位置指令例子": "无特殊用法 '//GetLocation'",
"踢玩家下线指令例子": "当有一个空格时跟想要踢除的玩家名字 例: '//KickPlayer 倾泪寒'",
"说明" : "所有指令都可更改 相对于的触发方式输入自己设定的指令即可"
}

View File

@@ -0,0 +1,11 @@
{
"ProjectName": "GM便捷操作台",
"ProjectDescribe": "本项目提供了许多GM的便捷操作 方便平时调试或写代码 \n输入'//' + 设定的指令即可执行逻辑 ",
"ProjectAuthor": "倾泪寒",
"ProjectVersion": 1.0,
"ProjectConfig": "GM便捷操作台_Lenheart.json",
"ProjectFiles": [
"GM便捷操作台.nut"
],
"ProjectRunFunc": "_Dps_GmConvenienceConsole_Main_"
}