This commit is contained in:
2025-05-27 21:24:22 +08:00
parent e1528c41bb
commit d71fc5c822
126 changed files with 11382 additions and 1202 deletions

View File

@@ -100,6 +100,49 @@ class R_Utils {
}
return null;
}
//获取Lst文件的返回Array
function GetLstArr(Path, Header) {
local Arr = [];
local LstBuf = R_Utils.GetScriptFileReader(Path);
if (LstBuf) {
local IO = Sq_Point2Blob(L_sq_P2I(LstBuf.Buffer.C_Object), LstBuf.Size);
local i = 2;
while (i< LstBuf.Size) {
if ((LstBuf.Size - i) >= 10) {
IO.seek(i + 6); //内容指示位
local FindKey = IO.readn('i');
local Key = Rindro_Script.GetBinString(FindKey);
if (Key) {
local StrFilePath = Header + Key.tolower();
Arr.append(StrFilePath);
}
} else break;
i += 10;
}
}
return Arr;
}
//通过处理函数获取文件Table
function GetFileTableByHandle(Path, Func) {
local Data = {};
local FileData = R_Utils.GetScriptFileReader(Path);
if (FileData) {
if (FileData.Size >= 7) {
//创建Blob对象
local IO = Sq_Point2Blob(L_sq_P2I(FileData.Buffer.C_Object), FileData.Size);
//以5为单步从第二位开始遍历字节
local i = 2;
while (true) {
if (i< FileData.Size && FileData.Size - i >= 5) {
i = Func(Data, IO, i);
} else break;
}
}
}
return Data;
}
}
@@ -158,11 +201,11 @@ getroottable().DrawCodeCallBackFunc <- {};
// // print("nut:" + format("%02x", args[3]));
// if (args[3]) {
// // for (local i = 0; i< 10000; i++) {
// local DrawCode = NativePointer((args[3])).readUnicodeString();
// // print(DrawCode);
// if (DrawCode in DrawCodeCallBackFunc)
// DrawCodeCallBackFunc[DrawCode](args);
// // print(args[3]);
// // }
// }
// return null;
// },
@@ -173,6 +216,7 @@ getroottable().DrawCodeCallBackFunc <- {};
// return null;
// });
//绘制城镇回调
getroottable().DrawTownCallBackFunc <- {};
Rindro_Haker.LoadHook(0x1108700, ["int", "void"],
@@ -193,8 +237,65 @@ Rindro_Haker.LoadHook(0x1108700, ["int", "void"],
//顺图
function Rindro_Gm_MoveMap()
{
function Rindro_Gm_MoveMap(obj) {
if (sq_IsKeyDown(OPTION_HOTKEY_PAUSE_IN_TOWER, ENUM_SUBKEY_TYPE_ALL) && RINDROLOCAL) {
if (KeyPress.isKeyPress(0)) L_sq_MoveMap(2);
if (KeyPress.isKeyPress(1)) L_sq_MoveMap(0);
if (KeyPress.isKeyPress(2)) L_sq_MoveMap(3);
if (KeyPress.isKeyPress(3)) L_sq_MoveMap(1);
}
}
getroottable()["LenheartFuncTab"].rawset("Rindro_Gm_MoveMapFuncN", Rindro_Gm_MoveMap);
getroottable()["LenheartFuncTab"].rawset("Rindro_Gm_MoveMapFuncN", Rindro_Gm_MoveMap);
//丢弃物品回调
getroottable().DiscardItemCallBackFunc <- {};
function Sq_DiscardItem(Item) {
local Flag = true;
foreach(Func in DiscardItemCallBackFunc) {
local Ret = Func(Item);
if (!Ret) Flag = false;
}
return Flag;
}
//从exe获取字符串
getroottable()["Sq_GetExeStr_Map"] <- {};
function Sq_GetExeStr_Event(Index)
{
if(Index in getroottable()["Sq_GetExeStr_Map"]){
return getroottable()["Sq_GetExeStr_Map"][Index](Index);
}
return Index;
}
// //hook打开窗口
// Rindro_Haker.LoadHook(0xE6E070, ["int","int","int","int","void"],
// function(args) {
// return null;
// },
// function(args) {
// // print(666);
// // print(format("%02x", args.pop()));
// // TTTAni <- args.pop();
// return null;
// });
// Rindro_Haker.LoadHook(0xE6E070, ["int", "int", "int", "int", "int"],
// function(args) {
// print("nut:" + format("%02x", args[0]));
// print("nut:" + format("%02x", args[1]));
// print("nut:" + format("%02x", args[2]));
// print("nut:" + format("%02x", args[3]));
// return null;
// },
// function(args) {
// // print(666);
// // print(format("%02x", args.pop()));
// // TTTAni <- args.pop();
// return null;
// });