Jump to content

MCbearbear

Members
  • Content Count

    14
  • Donations

    $0.00 
  • Joined

  • Last visited

Community Reputation

2 n00b

3 Followers

About MCbearbear

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. MCbearbear

    LUA scripting

    @Enyby how to use gg.FILES_DIR() ? My one line of code returned this error Script ended: Perhaps this script needs the latest version of GameGuardian. Try to update to the latest version. Script error: org.luaj.vm2.LuaError: @/storage/emulated/0/Lua scripts/sdcardpath.lua:1 `gg.alert(gg.FILES_DIR())` attempt to call string stack traceback: /storage/emulated/0/Lua scripts/sdcardpath.lua:1: in main chunk [Java]: in ? at org.luaj.vm2.LuaValue.checkmetatag(LuaValue.java:2882) at org.luaj.vm2.LuaValue.callmt(LuaValue.java:2039) at org.luaj.vm2.LuaValue.invoke(LuaValue.java:1759) at org.luaj.vm2.LuaClosure.execute(LuaClosure.java:398) at org.luaj.vm2.LuaClosure.call(LuaClosure.java:137) at android.ext.Script.runScript(Script.java:3635) at android.ext.Script$ScriptThread.run(Script.java:3556)
  2. MCbearbear

    LUA scripting

    Hello @Enyby. Sorry to bother you again. Here is a part of my code: function findnyanya () mobmaxHP = gg.getValues(mobmaxHP) for i = 1, 60 do if tonumber(mobmaxHP[i].value) == 3 then emp = tonumber(mob[i].value) empadd = mob[i].address break end end if emp == nil then gg.toast('No Nyanya Plant nearby') print(mobmaxHP) return false else return true end end Just imagine that mobmaxHP are a table of 60 values of mob's max HP. I mad the script print the whole table if it didn't find a value equal to 3, but when I looked at it, I saw a 3. Why didn't my script find that value? I attached a screenshot of the table.
  3. MCbearbear

    LUA scripting

    Thank you @Enyby. It works fine now.
  4. MCbearbear

    LUA scripting

    @Enyby in the latest version, does gg.getFile return the path without the '@'?
  5. MCbearbear

    LUA scripting

    I have another problem @Enyby. My script returns this error: The second line is the directory of the current script. The third line is the error for gg.saveList. It is on the same directory but the script can't find it. If I replaced '/storage/emulated/0/' with '/sdcard/' it works just fine. Maybe it's because the script is running on nox? I haven't tried it on a phone. This is the part of the code: getPath=function(str,sep) sep=sep or'/' return str:match("(.*"..sep..")") end macinator = gg.getFile() macpath = getPath(macinator) print(macpath) gg.loadList(macpath .. 'srcflMACinator.txt') srcfl = gg.getListItems() if srcfl[1] ~= nil then gg.toast("Source file loaded") skllfl = assert(loadfile(macpath .. 'mercskillsave.lua'))() else while gg.getResultCount() ~= 1 do gg.searchNumber(808465268, gg.TYPE_QWORD, false, gg.SIGN_EQUAL, 0, -1) if gg.getResultCount() == 0 then print(lang.failsearch) os.exit() end end srcfl = gg.getResults(1) gg.addListItems(srcfl) print(gg.saveList(macpath .. 'srcflMACinator.txt')) gg.toast("Source file saved") skllfl = {} skllfl[1] = 188 skllfl[2] = 194 skllfl[3] = 188 skllfl[4] = 194 gg.saveVariable(skllfl, macpath .. 'mercskillsave.lua') end
  6. MCbearbear

    LUA scripting

    @Enyby if I want to use the gg.getFile, how do I delete characters from the right of the string until it detects a slash? So I can save a file in the same folder
  7. MCbearbear

    LUA scripting

    Thanks @Enyby. I'll try it tomorrow.
  8. MCbearbear

    LUA scripting

    Hi @Enyby. Sorry for the mess there. I can't figure out how to remove that on phone. I'll fix it later on my laptop. My question is how do I fix this error? I used saveVariable and loadfile on my script. But it causes an error on some devices because their file directory is different. I used sdcard/notes in my script. Others have /storage/emulated/0/notes. Is there a way to make a script that works for both? I attached a screenshot of the error message.
  9. MCbearbear

    LUA scripting

    Make a table of the values you want to remove from the list and make that the parameter of gg.removeListItems().
  10. MCbearbear

    LUA scripting

    Thank you @Enyby. I'll be waiting for that.
  11. MCbearbear

    LUA scripting

    @Enyby this is probably a dumb question, please don't burn me for this, does gg support Lua socket?
  12. MCbearbear

    LUA scripting

    @Enyby is there a changelog for lua gg functions? So I could check the minimum version of gg my script could work with.Thank you.
  13. MCbearbear

    LUA scripting

    d***. I copied those from Windows hex calculator. That's probably why. Thanks @Enyby Oops. Why is that censored?
  14. MCbearbear

    LUA scripting

    Hello. I need help figuring this out. function maketables2 (of, fl, fr) m = gg.getResults(1) t = {} t.address = m[1].address + of if fl == 1 then tp = gg.TYPE_BYTE elseif fl == 2 then tp = gg.TYPE_WORD elseif fl == 3 then tp = gg.TYPE_DWORD end t.flags = tp if fr == 1 then t.freeze = true t.freezeType = gg.FREEZE_NORMAL end return t end ::FASTERSD:: monster1 = maketables2(-303976, 3) monster2 = maketables2(-302632‬, 3) monster3 = maketables2(-301288, 3) monster4 = maketables2(-299944, 3) monster5 = maketables2(-298600, 3) monster6 = maketables2(-297256, 3) monster7 = maketables2(-295912, 3) monster8 = maketables2(-294568, 3) monster9 = maketables2(-293224‬, 3) monster10 = maketables2(-291880‬, 3) monster11 = maketables2(-290536, 3) monster12 = maketables2(-289192, 3) monster13 = maketables2(-287848, 3) monster14 = maketables2(-286504, 3) monster15 = maketables2(-285160, 3) I can't figure out why only monster2, monster9, and monster10 give out errors. If I remove those three then my script works fine. This is the error: Script ended: Perhaps this script needs the latest version of GameGuardian. Try to update to the latest version. Script error: org.luaj.vm2.LuaError: load /storage/emulated/0/Lua Scripts/fasterchunktest.lua: org.luaj.vm2.LuaError: /storage/emulated/0/Lua Scripts/fasterchunktest.lua:65 `monster2 = maketables2(-3026326¦9, 3)` ')' expected at org.luaj.vm2.LuaValue.error(LuaValue.java:1075) at org.luaj.vm2.Globals.loadfile(Globals.java:204) at android.ext.Script.runScript(Script.java:3294) at android.ext.Script$ScriptThread.run(Script.java:3232) Caused by: org.luaj.vm2.LuaError: /storage/emulated/0/Lua Scripts/fasterchunktest.lua:65 `monster2 = maketables2(-3026326¦9, 3)` ')' expected at org.luaj.vm2.compiler.LexState.lexerror(LexState.java:270) at org.luaj.vm2.compiler.LexState.syntaxerror(LexState.java:274) at org.luaj.vm2.compiler.LexState.error_expected(LexState.java:823) at org.luaj.vm2.compiler.LexState.check_match(LexState.java:853) at org.luaj.vm2.compiler.LexState.funcargs(LexState.java:1300) at org.luaj.vm2.compiler.LexState.suffixedexp(LexState.java:1392) at org.luaj.vm2.compiler.LexState.simpleexp(LexState.java:1446) at org.luaj.vm2.compiler.LexState.subexpr(LexState.java:1559) at org.luaj.vm2.compiler.LexState.expr(LexState.java:1577) at org.luaj.vm2.compiler.LexState.explist(LexState.java:1277) at org.luaj.vm2.compiler.LexState.assignment(LexState.java:1672) at org.luaj.vm2.compiler.LexState.exprstat(LexState.java:1994) at org.luaj.vm2.compiler.LexState.statement(LexState.java:2091) at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2108) at org.luaj.vm2.compiler.LexState.mainfunc(LexState.java:2124) at org.luaj.vm2.compiler.LuaC$CompileState.luaY_parser(LuaC.java:129) at org.luaj.vm2.compiler.LuaC.compile(LuaC.java:99) at org.luaj.vm2.Globals.compilePrototype(Globals.java:323) at org.luaj.vm2.Globals.loadPrototype(Globals.java:302) at org.luaj.vm2.Globals.load(Globals.java:273) at org.luaj.vm2.Globals.loadfile(Globals.java:202) ... 2 more
×
×
  • Create New...