Jump to content
Enyby

LUA scripting

Recommended Posts

I do not have time for this. If you have a specific error - show the text. The validation of other people's scripts I do not do.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 ('==').

Share this post


Link to post
Share on other sites

Problem solved! Thank you!

Share this post


Link to post
Share on other sites
how to use multiChoice ?

Share this post


Link to post
Share on other sites

See other scripts source as examples.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

@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.

Share this post


Link to post
Share on other sites

@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.

Share this post


Link to post
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

×
×
  • Create New...