Jump to content

LUA scripting


Enyby
 Share

Recommended Posts

I have faced a problem now.

My code is this:

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 (data[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

 

 

Theorically it should:

1_open a prompt screen to user to get value and meanwhile, toast a message

2_after value input, set range to (Ca) and search the value as Encrypted Double

3_if found 1 value Change it to a very high number,  if not, tell user to change the value and reload script

 

 

But I get errors:

Script ended:
Script error: org.luaj.vm2.LuaError: load /sdcard/Notes/Quadropus 2.0.48 Script by Backlift.lua: org.luaj.vm2.LuaError: /sdcard/Notes/Quadropus 2.0.48 Script by Backlift.lua:1: unfinished string
    at org.luaj.vm2.LuaValue.error(LuaValue.java:1051)
    at org.luaj.vm2.Globals.loadfile(Globals.java:185)
    at android.ext.Script.runScript(Script.java:1035)
    at android.ext.Script.access$8(Script.java:1032)
    at android.ext.Script$ScriptThread.run(Script.java:998)
Caused by: org.luaj.vm2.LuaError: /sdcard/Notes/Quadropus 2.0.48 Script by Backlift.lua:1: unfinished string
    at org.luaj.vm2.compiler.LexState.lexerror(LexState.java:266)
    at org.luaj.vm2.compiler.LexState.read_string(LexState.java:451)
    at org.luaj.vm2.compiler.LexState.llex(LexState.java:611)
    at org.luaj.vm2.compiler.LexState.next(LexState.java:673)
    at org.luaj.vm2.compiler.LexState.checknext(LexState.java:822)
    at org.luaj.vm2.compiler.LexState.recfield(LexState.java:1129)
    at org.luaj.vm2.compiler.LexState.constructor(LexState.java:1167)
    at org.luaj.vm2.compiler.LexState.simpleexp(LexState.java:1418)
    at org.luaj.vm2.compiler.LexState.subexpr(LexState.java:1523)
    at org.luaj.vm2.compiler.LexState.expr(LexState.java:1541)
    at org.luaj.vm2.compiler.LexState.explist(LexState.java:1261)
    at org.luaj.vm2.compiler.LexState.funcargs(LexState.java:1278)
    at org.luaj.vm2.compiler.LexState.suffixedexp(LexState.java:1373)
    at org.luaj.vm2.compiler.LexState.simpleexp(LexState.java:1427)
    at org.luaj.vm2.compiler.LexState.subexpr(LexState.java:1523)
    at org.luaj.vm2.compiler.LexState.expr(LexState.java:1541)
    at org.luaj.vm2.compiler.LexState.explist(LexState.java:1258)
    at org.luaj.vm2.compiler.LexState.assignment(LexState.java:1636)
    at org.luaj.vm2.compiler.LexState.exprstat(LexState.java:1958)
    at org.luaj.vm2.compiler.LexState.statement(LexState.java:2055)
    at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2072)
    at org.luaj.vm2.compiler.LexState.mainfunc(LexState.java:2088)
    at org.luaj.vm2.compiler.LuaC$CompileState.luaY_parser(LuaC.java:129)
    at org.luaj.vm2.compiler.LuaC$CompileState.access$0(LuaC.java:120)
    at org.luaj.vm2.compiler.LuaC.compile(LuaC.java:99)
    at org.luaj.vm2.Globals.compilePrototype(Globals.java:304)
    at org.luaj.vm2.Globals.loadPrototype(Globals.java:283)
    at org.luaj.vm2.Globals.load(Globals.java:254)
    at org.luaj.vm2.Globals.loadfile(Globals.java:183)
    ... 3 more

 

Link to comment
Share on other sites

  • Administrators

Script can do some actions in background. For example every 5 seconds search some values and change it. Without user actions. In background.

_______________________________________________
added 0 minutes later
1 minute ago, Backlift said:

d = gg.prompt({A='Number of Orbs Or Dooblins'}, {A='0,})

quote not closed.

Link to comment
Share on other sites

  • Administrators
7 minutes ago, Backlift said:

gg.alert ('Hacking Done, Enjoy)

Same.

_______________________________________________
added 1 minute later
8 minutes ago, Backlift said:

gg.searchNumber (data[A], gg.TYPE_DOUBLE, true, gg.SIGN_EQUAL, 0, -1)

data[A] but var data not defined. You used var d, not data before.

Link to comment
Share on other sites

  • Administrators

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 

 

Link to comment
Share on other sites

1 minute ago, Enyby said:

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

Yeah it crashed when started searching.

Fixed that too, made it d['A']

Testing

_______________________________________________
added 3 minutes later

It is working good, but, 

I made the code to only search (c++ Alloc) range and the done it's job, in setting only (Ca) is checked but I'm getting results from other regions too, like Java heap.

 

Screenshot_20170717-111519.png

Screenshot_20170717-111505.png

Link to comment
Share on other sites

It searched the wrong region, didn't found the value.

_______________________________________________
added 1 minute later

Only searched the Java heap, however, I set it to search only C++ Alloc.

Link to comment
Share on other sites

1 minute ago, Enyby said:

:) Bug. Will be fixed in next release.

Yeah definitely a bug ?

made it to search java heap, it gived results about c++ Alloc.?

 

I copied 5 lines of values and had 2 bugs ?, GG has millions of code lines, it must be an extreme hard task.

Your effort and patience (GG Team) is definitely admirable.

Thanks again.

Screenshot_20170717-112437.png

Screenshot_20170717-112431.png

Link to comment
Share on other sites

1 hour ago, Enyby said:

You can store state to file and load on each start script. Or wait for some actions. In last case user do not need run script each time.

But this not always possible.


function sleep(s)
  local ntime = os.clock() + s
  repeat until os.clock() > ntime
end

while gg.getResultCount() < 10 do
	c = gg.getResultCount()
	gg.toast('I wait for you! Only '..(10 - c)..' need!', true)
	sleep(3)
end

gg.alert('You done!')

bandicam 2017-07-17 09-16-53-901.pngbandicam 2017-07-17 09-17-08-872.png

Well, the thing I wanted is this mechanism:

If found 1 value, edit it to 1000000 and end script.

If NOT, show the ('change the value and then open GG windows again')

By taping ok on that,  it closes GG windows, and waits for GG window to open again, then restart the script.

Link to comment
Share on other sites

  • Administrators
function sleep(s)
  local ntime = os.clock() + s
  repeat until os.clock() > ntime
end

gg.toast ('Quadropus 2.0.48 Hack by Backlift')
gg.clearResults()
--gg.setRanges(gg.REGION_JAVA_HEAP)
gg.setRanges(gg.REGION_C_ALLOC)
while true do
	if gg.isVisible() then
		local d = gg.prompt({A='Number of Orbs Or Dooblins'}, {A='0'})
		gg.searchNumber (d.A, gg.TYPE_DOUBLE, true, gg.SIGN_EQUAL, 0, -1)
		cnt = gg.getResultCount()
		if cnt == 0 then 
			gg.alert('Search failed')
			break
		end
		
		if cnt == 1 then 
			gg.editAll('100000000', gg.TYPE_DOUBLE)
			gg.alert('Hacking Done, Enjoy')
			break
		end 
		
		gg.alert ('Go to game and change the value, then open gg to continue')
		gg.setVisible(false)
	end
	sleep(1)
end

 

GameGuardian.git_signed.apk

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.