This is the AMP version of this page.
If you want to load the real page instead, click this text.

Help! How to write this frida code into lgl mod and execute it completely?

hzx321

Platinian
{
'type': 'input',
'title': '秘境开始层数',
'val': Mod.var._秘境开始层数.toString(),
'callback': (res) => {
Mod.var._秘境开始层数 = parseInt(res.val);
}
},
{
'type': 'input',
'title': '秘境结束层数',
'val': Mod.var._秘境结束层数.toString(),
'callback': (res) => {
Mod.var._秘境结束层数 = parseInt(res.val);
}
},
{
'type': 'button',
'title': '一键小秘境',
'callback': (val) => {
Mod.var._秘境当前层数 = Mod.var._秘境开始层数;
if (Mod.var._一键秘境定时器) clearInterval(Mod.var._一键秘境定时器);
Mod.var._一键秘境定时器 = setInterval(() => {
Il2Cpp.perform(() => {
var lib = Il2Cpp.Domain.assembly('Assembly-CSharp').image;
let NetManager = lib.class('NetManager').field('_instance').value;
let ApplicationNetworker = NetManager.field('_networker').value;
let dungeonProtocolHandler = ApplicationNetworker.field('dungeonProtocolHandler').value;
let newInnersProtocolHandler = ApplicationNetworker.field('newInnersProtocolHandler').value;

if (Mod.var._秘境当前层数 <= Mod.var._秘境结束层数) {
let level = 1000 + Mod.var._秘境当前层数;
let SystemInt32 = Il2Cpp.Image.corlib.class('System.Byte')
let GenericList = Il2Cpp.Image.corlib.class('System.Collections.Generic.List`1')
let SystemInt32List = GenericList.inflate(SystemInt32);
let ids = SystemInt32List.new();

ids.method('Add').invoke(3);
ids.method('Add').invoke(2);
ids.method('Add').invoke(1);

dungeonProtocolHandler.method("LocalStart").invoke(0, 35, level, 0, 0);
dungeonProtocolHandler.method("LocalEnd").invoke(35, level, 0, 0, 0, 0, 3,0,0,0);
newInnersProtocolHandler.method('Star').invoke(ids);
dungeonProtocolHandler.method("Leave").invoke();
Mod.var._秘境当前层数++;
} else {
clearInterval(Mod.var._一键秘境定时器);
toast('一键小秘境完成');
}
});


}, 100);
}
},
]
},



How to modify it with lgl mod? I You can pay for it. I hope someone can help me.
 
Idk the game and with all these chinese words is hard to understand anyway basically you should
  1. Create a button on LGLModMenu
  2. Create a function on jni that gets methods and fields required
  3. On button press call the function