Jump to content

LUA scripting


Enyby
 Share

Recommended Posts

Apologize, but here is the specific error that I got.

Script ended:
Script error: org.luaj.vm2.LuaError: load /storage/emulated/0/VirtualXposed/vsdcard/0/Android/obb/com.mobile.legends/scripts.lua: org.luaj.vm2.LuaError: /storage/emulated/0/VirtualXposed/vsdcard/0/Android/obb/com.mobile.legends/sc...:19
`failed read line`
'then' expected
    at org.luaj.vm2.LuaValue.error(LuaValue.java:1075)
    at org.luaj.vm2.Globals.loadfile(Globals.java:208)
    at android.ext.Script.runScript(Script.java:3361)
    at android.ext.Script$ScriptThread.run(Script.java:3294)
Caused by: org.luaj.vm2.LuaError: /storage/emulated/0/VirtualXposed/vsdcard/0/Android/obb/com.mobile.legends/sc...:19
`failed read line`
'then' 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(LexState.java:836)
    at org.luaj.vm2.compiler.LexState.checknext(LexState.java:840)
    at org.luaj.vm2.compiler.LexState.test_then_block(LexState.java:1893)
    at org.luaj.vm2.compiler.LexState.ifstat(LexState.java:1920)
    at org.luaj.vm2.compiler.LexState.statement(LexState.java:2042)
    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:327)
    at org.luaj.vm2.Globals.loadPrototype(Globals.java:306)
    at org.luaj.vm2.Globals.load(Globals.java:277)
    at org.luaj.vm2.Globals.loadfile(Globals.java:202)
    ... 2 more

Link to comment
Share on other sites

  • Administrators

Try read message.

4 minutes ago, Maplas said:

'then' expected

4 minutes ago, Maplas said:

/Android/obb/com.mobile.legends/sc...:19

16 minutes ago, Maplas said:

if hero == gg.choice({'Layla','Menu','Exit'})

Need 'then' on line 19.

_______________________________________________
added 0 minutes later

I think 'if' on line 19 is not necessary.

_______________________________________________
added 1 minute later

And on line 19 you must make assignment ('=') not comparison ('==').

Link to comment
Share on other sites

Hi,

I have a question, I did a group search 

gg.searchNumber('123;345;789', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

Lets say i want to modify

123 with 12300

456 with 85000

789 with 67549

How can i achieve this with lua script. Tried checking in https://gameguardian.net/help/  but wasn't able to find

In GG without lua, after search results i can filter results with "number >=" and "number <=".44

Thanks in advance

Edited by warriror999
Link to comment
Share on other sites

  • Administrators

Read results into table. Iterate over this table. In loop body check value. If it has specified value - add it to table with changes. after loop setValues with new table with changes.

If you do not understand what I am talking about - you need learn lua and how to programm. Use books and internet.

Link to comment
Share on other sites

  • Administrators

@MCbearbear

No. No any changelog. You must always use latest version of the gg.

So you can check current version with gg.require.

Always set it to latest version as you write script and you not have any problems.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.