Jump to content

LUA scripting


Enyby
 Share

Recommended Posts


KAP =  gg.prompt(

{'ENTER LEVEL POINTS'}

)





gg.searchNumber(KAP[1]-1~KAP[1])

Really i can't understand how to perform above script

 

I entered

gg.searchNumber(KAP[1])

IT WORK

THEN I TRIED TO SUB

gg.searchNumber(KAP[1]-1)

IT WORK

 

THE ABOVE SCRIPT GIVE 1 AUTO_TYPE

I ENTERING KAP[1]=99 

IT SHOULD 98~99 BUT IT SEARCHING 1 AUTO_TYPE

Link to comment
Share on other sites

2 hours ago, Enyby said:

You use a-1-a. It is same as use -1. You need string concatenation.

It happening same 

When I use concatenation (..) it showing symbol error

Please can you show how to write above code with string concatenation

i am totally confused

Link to comment
Share on other sites

Hello, enyby, can you help me solve this problem?  , I want to use the gg script to modify the last 0 in the search results.  What do I need to do?  Can you help me, thank you, enyby.

Screenshot_20180731-214031.jpg

Screenshot_20180731-214047.jpg

Link to comment
Share on other sites

  • Administrators

If there are not many results, you load everything into the table. Then take the last element and change it.
If there are many results, load them a little and delete them from the search results, until there is one result left. Then you change it in any convenient way.

Link to comment
Share on other sites

1 hour ago, LyojBy said:

I want to use the gg script to modify the last 0 in the search results.  What do I need to do?

You can modify your function this way:

function A1()
  gg.clearResults()
  gg.setRanges(gg.REGION_ANONYMOUS)
  gg.searchNumber('45.0000038147;20.30000114441;4.40000009537;256D;0::84', gg.TYPE_FLOAT)
  local count = gg.getResultCount()
  if count == 0 then -- need to check count of results here too, because if nothing found, then next search will be new search, not refine
    -- something to perform if nothing was found
  else
    gg.searchNumber('0', gg.TYPE_FLOAT)
    count = gg.getResultCount()
    if count == 0 then
      -- something to perform if nothing was found
    else
      local results = gg.getResults(count)
      local lastResult = {results[count]}
      lastResult[1].value = '2.1019477e-44'
      gg.setValues(lastResult)
      gg.toast('111! ')
    end
  end
end

This may be considered as implementation of first approach from the ones that Enyby has mentioned.
I guess that it is suitable for your case, because such group search usually won't produce many results. 

Link to comment
Share on other sites

8 hours ago, CmP said:

你可以这样修改你的功能:



  
     
    
  
      
      
    
      
        
    
  

这可以被认为是Enyby提到的第一种方法的实现。
我想这适合你的情况,因为这种群体搜索通常不会产生很多结果。 

No, no, no, I tell you what I think, using this 45.0000038147 offset calculator 50, because I only need to modify the 1 address, I don't know whether offset can be implemented through scripts, or whether gg has the syntax of offset calculator, can you help me, my friend, thank you.

Link to comment
Share on other sites

On 7/8/2018 at 9:38 PM, Enyby said:

Use bit32.bor or "|" as bitwise OR.
 


gg.setRanges(bit32.bor(gg.REGION_ANONYMOUS, gg.REGION_BAD))
gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_BAD)

I advise you to study Lua and how it works, because you wrote a nonsense, from which it follows that you do not understand anything in Lua, but simply combine the text as it is.

 

I do not advise using the BAD region - the search will be slow and there will be garbage in it.
If useful values can be found in BAD, then you need to find them, write a log of regions and send it to me, so I corrected this.

hmm how to write a script "When we doesnt select any menu, but the script didn't close by itself?

So we dont need execute script again...thanks for you attention

Link to comment
Share on other sites

3 hours ago, Enyby said:

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/Beta Project + Stable/Beta/PUBG_HACK_CommonModzv1.lua: org.luaj.vm2.LuaError: /storage/emulated/0/Beta Project + Stable/Beta/PUBG_HACK_CommonModzv1.lua:319
`end `
'end' expected (to close 'function' at line 225) near '<eos>'
    at org.luaj.vm2.LuaValue.error(LuaValue.java:1075)
    at org.luaj.vm2.Globals.loadfile(Globals.java:230)
    at android.ext.Script.runScript(Script.java:4300)
    at android.ext.Script$ScriptThread.run(Script.java:4145)
Caused by: org.luaj.vm2.LuaError: /storage/emulated/0/Beta Project + Stable/Beta/PUBG_HACK_CommonModzv1.lua:319
`end `
'end' expected (to close 'function' at line 225) near '<eos>'
    at org.luaj.vm2.compiler.LexState.lexerror(LexState.java:280)
    at org.luaj.vm2.compiler.LexState.syntaxerror(LexState.java:284)
    at org.luaj.vm2.compiler.LexState.check_match(LexState.java:878)
    at org.luaj.vm2.compiler.LexState.body(LexState.java:1308)
    at org.luaj.vm2.compiler.LexState.funcstat(LexState.java:2020)
    at org.luaj.vm2.compiler.LexState.statement(LexState.java:2103)
    at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2147)
    at org.luaj.vm2.compiler.LexState.body(LexState.java:1306)
    at org.luaj.vm2.compiler.LexState.funcstat(LexState.java:2020)
    at org.luaj.vm2.compiler.LexState.statement(LexState.java:2103)
    at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2147)
    at org.luaj.vm2.compiler.LexState.mainfunc(LexState.java:2163)
    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:349)
    at org.luaj.vm2.Globals.loadPrototype(Globals.java:328)
    at org.luaj.vm2.Globals.load(Globals.java:299)
    at org.luaj.vm2.Globals.loadfile(Globals.java:224)
    ... 2 more

 

i'm very confuse after try it for 1 week

Link to comment
Share on other sites

  • 2 weeks later...

 

Sorry to interfere with your activities, I want to ask for your help to fix my wrong script, I tried to create a Tamer Frontier game script, but it doesn't work when I combine data [1] with data [2] and number 9, I do it to search group, can you justify it?

 

data = gg.prompt({[1]='Masukkan Code Number Digimon', [2]='Masukkan Jumlah Level Digimon', [3]='Masukkan Jumlah Level Yang Di Inginkan'}, {[1]='170100143', [2]='51', [3]='100',})

 

gg.clearResults(100)

 

gg.searchNumber('data[1];data[2]:9', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

 

My mistake is on

 

'data[1];data[2]:9'

 

But when I made it become

 

'170100143;51:9'

 

It's work, But I want to make it easier, with no need to change the script again, how do I make it right?

 

Please Your Help Sir...

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.