Jump to content
Enyby

LUA scripting

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

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

{A='0',}

Fixed it, but still having issues

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
1 minute ago, Enyby said:

Same.

Thanks, it executed.

I will keep my eyes on codes more aggressively from now.

Testing...

Share this post


Link to post
Share on other sites

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 

 

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

:) Bug. Will be fixed in next release.

Share this post


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

Share this post


Link to post
Share on other sites
36 minutes ago, Backlift said:

Yeah definitely a bug ?

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

Try this test version.

GameGuardian.git_signed.apk

Share this post


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

Share this post


Link to post
Share on other sites

In future we add function for test state of UI (show/hide) and allow set it (show/hide).

Share this post


Link to post
Share on other sites
11 minutes ago, Enyby said:

Try this test version.

GameGuardian.git_signed.apk

It's fixed.

Searched the correct region.

Script worked like a charm and it did it's job.

Screenshot_20170717-122008.png

Screenshot_20170717-122022.png

Screenshot_20170717-122043.png

Share this post


Link to post
Share on other sites
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

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