Jump to content
Enyby

LUA scripting

Recommended Posts

Is there any way i can prevent people from stealing my lua script codes? Well yea, they're stealing them.. 

Share this post


Link to post
Share on other sites

It all depends only on you and your knowledge of Lua. If you know Lua, then yes. If you do not know, then no.

Share this post


Link to post
Share on other sites
Posted (edited)

gg.getResults('Value'

How to get the Value in getResults? Is the getResults('Value') can be get in searchNumber('Value') result?

Thank  you!

Edited by Maplas

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, Enyby said:

Could you please check my script, been sorting out looking for the error but no luck to solve it.

gg.toast('Mobile Legends Script - 1.0.0')

if gg.BUILD < 5511 then 
gg.alert('Outdated! Upgrade Game Guardian to v.8.30.0. or Later!') 
gg.toast('GameGuardian.net!')
end 

if gg.isVisible(true) then 
   gg.setVisible(false) 
   end
 
::menu::
menu = gg.choice({'God Mode','Exit'})
if menu == 1 then goto hero end
if menu == 2 then goto close end

::hero::
if hero == gg.choice({'Layla','Menu','Exit'})
if hero == 1 then goto layla end
if hero == 2 then goto menu end
if hero == 3 then goto close end

::layla::
gg.searchNumber('118;424;2500', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(19)print('Replaced: ', gg.editAll('999999', gg.TYPE_DWORD))
gg.toast('Injected!')
goto close

::close::
gg.toast('Script Injected!')
gg.toast('Cheaters!')

Edited by Maplas

Share this post


Link to post
Share on other sites

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

@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

×