Jump to content

LUA scripting


Enyby
 Share

Recommended Posts

  • Moderators
4 hours ago, Yexeed said:

Lol, spy for users using imei or wifi/bt mac? Actually, i want to use this ids to tie a license to a hardware.

If you are creative enough, you can do it depending on game.

Link to comment
Share on other sites

Whats the different of function A() with ::A::?

if i use ::A:: GG error when i put end in the last of my function...

example error

::NR::
gg.clearResults() gg.searchNumber('1868784978;1850305641;28518', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber('1868784978', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(1000)
gg.editAll('1868756421', gg.TYPE_DWORD)
gg.clearResults() 
gg.searchNumber('1750294898;1415932769;1819307365', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) 
gg.searchNumber('1750294898;1415932769;1819307365', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(1000)
gg.editAll('100000', gg.TYPE_DWORD)
gg.clearResults()
gg.toast('NO RECOIL ACTIVATED!')
end

No error

function NR()
gg.clearResults() gg.searchNumber('1868784978;1850305641;28518', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber('1868784978', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(1000)
gg.editAll('1868756421', gg.TYPE_DWORD)
gg.clearResults() 
gg.searchNumber('1750294898;1415932769;1819307365', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1) 
gg.searchNumber('1750294898;1415932769;1819307365', gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
gg.getResults(1000)
gg.editAll('100000', gg.TYPE_DWORD)
gg.clearResults()
gg.toast('NO RECOIL ACTIVATED!')
end

 

Link to comment
Share on other sites

On 7/17/2017 at 1:41 PM, Enyby said:

And wrong format. Must be or `d.A` or `d['A']`.

_______________________________________________
added 1 minute later

d = gg.prompt({A='Number of Orbs Or Dooblins'}, {A='0'})
gg.toast ('Quadropus 2.0.48 Hack by Backlift')
gg.setRanges ( gg.REGION_C_ALLOC)
gg.searchNumber (d.A, gg.TYPE_DOUBLE, true, gg.SIGN_EQUAL, 0, -1)
if gg.getResultCount() == 1 then 
	gg.editAll('100000000', gg.TYPE_DOUBLE) 
	gg.alert ('Hacking Done, Enjoy')
else 
	gg.alert ('Go to game and change the value, then load the script again to continue')
end 

 

Hmmm how to set multiple ranges?

I got error

Script ended:
Script By CommonModz

Perhaps this script needs the latest version of GameGuardian. Try to update to the latest version.

Script error: org.luaj.vm2.LuaError: lua:264
`gg.setRanges(gg.REGION_ANONYMOUS_BAD)`
gg.setRanges: bad argument #1 (nil): number expected, got nil
stack traceback:
    lua:264: in main chunk
    [Java]: in ?
    at org.luaj.vm2.Varargs.argerr(Varargs.java:280)
    at org.luaj.vm2.Varargs.checkint(Varargs.java:317)
    at android.ext.Script$setRanges.invokeUi(Script.java:1827)
    at android.ext.Script$ApiFunction.run(Script.java:737)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5437)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
    at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

  • Administrators
On 6/26/2018 at 3:29 PM, MCbearbear said:

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

path = gg.getFile():gsub('[^/]+$', '')
filename = gg.getFile():match('[^/]+$')

 

Link to comment
Share on other sites

Error code

Script ended:
Script error: org.luaj.vm2.LuaError: @/storage/emulated/0/Download/aaaaaa:11
`if KAP[1] > 1 then goto aj1 end `
attempt to compare __lt on number and string
stack traceback:
    /storage/emulated/0/Download/aaaaaa:11: in main chunk
    [Java]: in ?
    at org.luaj.vm2.LuaValue.error(LuaValue.java:1067)
    at org.luaj.vm2.LuaValue.comparemt(LuaValue.java:2486)
    at org.luaj.vm2.LuaValue.lt_b(LuaValue.java:2361)
    at org.luaj.vm2.LuaLong.lt_b(LuaLong.java:151)
    at org.luaj.vm2.LuaClosure.execute(LuaClosure.java:372)
    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)

............................................…………………

I want to use prompt with if statement to check the value and give output for that particular value

Still I am in learning stage 

I mean I want if value >=1 then goto x

                        If value <=0 then goto y

              


KAP =  gg.prompt(

{'ENTER LEVEL POINTS'}

)

--trying

::AA::
if KAP[1] > 1 then goto aj1 end 


if KAP[1] < 0 then goto b end

goto AA
   ::aj1::
gg.searchNumber(100)


  ::b::
gg.searchNumber(200)

 

Link to comment
Share on other sites

I got this code from a script logging by compiler.lua memory ranges and types are replace by number. Can I have a list of what the numbers stand for in the log file?

gg.setRanges(32)
gg.searchNumber("1.4012985e-45;1;1;1;1;100000::100", 16, false, 536870912, 0, -1)

 

Link to comment
Share on other sites

1 hour ago, minhthong0824 said:

I got this code from a script logging by compiler.lua memory ranges and types are replace by number. Can I have a list of what the numbers stand for in the log file?


gg.setRanges(32)
gg.searchNumber("1.4012985e-45;1;1;1;1;100000::100", 16, false, 536870912, 0, -1)

Either execute this:

gg.setRanges(32)
gg.skipRestoreState()

to see which memory range will be selected, or this:

for k, v in pairs(gg) do
  if k:sub(1, 6) == 'REGION' then
    print(k, v)
  end
end

to print name and value for each of gg.REGION_* flags.

Link to comment
Share on other sites

  • Administrators

@minhthong0824

local val = 32
print(val..':')
for k, v in pairs(gg) do
  if k:sub(1, 7) == 'REGION_' then
  	if (val & v) == v then print(k) end
  end
end

local val = 16
print(val..':')
for k, v in pairs(gg) do
  if k:sub(1, 5) == 'TYPE_' then
  	if (val & v) == v then print(k) end
  end
end

local val = 536870912
print(val..':')
for k, v in pairs(gg) do
  if k:sub(1, 5) == 'SIGN_' then
  	if (val & v) == v then print(k) end
  end
end

 

 

scr_1531314628.jpg

Link to comment
Share on other sites

Thank yous, anw I'm already find out by logging this script:

gg.setRanges(gg.REGION_ANONYMOUS)
gg.searchNumber("1", gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)

gg.setRanges(gg.REGION_ASHMEM)
gg.searchNumber("2", gg.TYPE_BYTE, false, SIGN_FUZZY_EQUAL, 0, -1)

gg.setRanges(gg.REGION_BAD)
gg.searchNumber("3", gg.TYPE_DOUBLE, false, SIGN_FUZZY_GREATER, 0, -1)

gg.setRanges(gg.REGION_C_ALLOC)
gg.searchNumber("4", gg.TYPE_DWORD, false, SIGN_FUZZY_LESS, 0, -1)

gg.setRanges(gg.REGION_C_BSS)
gg.searchNumber("5", gg.TYPE_FLOAT, false, SIGN_FUZZY_NOT_EQUAL, 0, -1)

gg.setRanges(gg.REGION_C_DATA)
gg.searchNumber("6", gg.TYPE_QWORD, false, SIGN_GREATER_OR_EQUAL, 0, -1)

gg.setRanges(gg.REGION_C_HEAP)
gg.searchNumber("7", gg.TYPE_WORD, false, SIGN_LESS_OR_EQUAL, 0, -1)

gg.setRanges(gg.REGION_CODE_APP)
gg.searchNumber("8", gg.TYPE_XOR, false, SIGN_NOT_EQUAL, 0, -1)

gg.setRanges(gg.REGION_CODE_SYS)
gg.searchNumber("9", gg.TYPE_BYTE, false, gg.SIGN_EQUAL, 0, -1)

gg.setRanges(gg.REGION_JAVA)
gg.searchNumber("10", gg.TYPE_BYTE, false, gg.SIGN_EQUAL, 0, -1)

gg.setRanges(gg.REGION_JAVA_HEAP)
gg.searchNumber("11", gg.TYPE_BYTE, false, gg.SIGN_EQUAL, 0, -1)

gg.setRanges(gg.REGION_OTHER)
gg.searchNumber("12", gg.TYPE_BYTE, false, gg.SIGN_EQUAL, 0, -1)

gg.setRanges(gg.REGION_PPSSPP)
gg.searchNumber("13", gg.TYPE_BYTE, false, gg.SIGN_EQUAL, 0, -1)

gg.setRanges(gg.REGION_STACK)
gg.searchNumber("14", gg.TYPE_BYTE, false, gg.SIGN_EQUAL, 0, -1)

By compare between script and log file i can understand what the numbers stand for.

Link to comment
Share on other sites

  • 2 weeks later...

Hello guys, I would like to know what software can I use to edit an existing script. I'm new to all of this. I have a script for pubg, a free public one but not all functions is working. I would like to delete some useless functions and add some other functions that is working from another free public script. basically make a script with just working results for my device. Thank you XD

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.