Jump to content

LUA scripting


Recommended Posts


One may just load Lua script and only input the value.

Other options like type and region will be automatically set.

Also I think it could automatically calculate and add the other values based on the value found with stored offsets in it, makes many things easier.

Link to comment
Share on other sites

  • Administrators

Yes. And can be created automated calculator/tool based on gg.

Present function 'toast', 'alert' and 'prompt' which allow create some dialogs for user.

For example 'Input gold amount:' and use this value for make search.

data = gg.prompt({[1]='Search value', [2]='Replace value', [3]='Max count'}, {[1]='123', [2]='456', [3]='321'})
gg.searchNumber(data[1], gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
found = gg.getResultCount()
gg.alert('We found: '..found)
replaced = gg.editAll(data[2], gg.TYPE_DWORD)
gg.alert('We replaced: '..replaced)
gg.alert('Summary: We search '..data[1]..', found '..found..', replaced '..replaced..' to '..data[2]..' with max count '..data[3]..';')
print('Script ended.')

bandicam 2017-07-17 07-41-24-722.pngbandicam 2017-07-17 07-41-33-494.pngbandicam 2017-07-17 07-41-38-267.pngbandicam 2017-07-17 07-41-41-348.pngbandicam 2017-07-17 07-41-45-676.pngbandicam 2017-07-17 07-41-58-375.pngbandicam 2017-07-17 07-42-01-589.png

Link to comment
Share on other sites

  • Administrators

Script can work with files. It can be useful for create complicated things.

API to GG will be edited and extend in future releases. Now present only basic features for scripts.

Scripts can be used for automate some things like lot of same actions. For example for Asphalt 8 Enduro Double Down can be written automated scripts which make hundred of replace in one run.

Link to comment
Share on other sites

I found it pretty easy.

Just copied the data from post above into a text file then replaced the ".txt" extention to ".Lua" and then went to search tab and rap on "more" (three lines) button and "excute script".

So simple.

I think by working with these samples, it's easily possible to make a good one for a game.

On it now.







Link to comment
Share on other sites

  • Administrators

Lua table not specified order of fields. Maybe in future I try fix this.

I make this support of scripting in last 3-4 weeks. It is first public release. Something can be not good or broken. In future we try improve it.

Link to comment
Share on other sites

  • Administrators

Script for hack Asphalt 8 nitro:

gg.searchNumber('2;8;10;12;15;20;25;30:61', gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
print('Replaced: ', gg.editAll('1000', gg.TYPE_FLOAT))
print('Nitro hacked!')

bandicam 2017-07-17 08-49-37-459.pngbandicam 2017-07-17 08-49-50-457.pngbandicam 2017-07-17 08-50-24-287.png

Link to comment
Share on other sites

I'm working on hack for Quadropus Game.

I made it to hack the input value as double and Encrypted.

But I'm stuck in this situation:

The user needs get back into game and change the value and then come back GG and enter the new value.

Will this work? :

print('go to game and change the value and then load script again') 

So it loads the script again and it search in the found results...or it makes a new search?

added 3 minutes later

I want to make an IF Statement:

1_If found 1 value, edit value to 10000000000

2_if Not found 1 value, print'('go to game and change the value, then load the script again')


Possible? If yes, how?

Link to comment
Share on other sites

  • Administrators

Depends on your logic. Read Lua manual reference posted in first post.

if gg.getResultCount() == 0 then
	gg.alert('Find something and run script again!')
	gg.alert('Wow! You found '..gg.getResultCount()..' results! Not bad!')
	gg.toast('You cool!')

bandicam 2017-07-17 09-07-47-077.pngbandicam 2017-07-17 09-08-16-419.pngbandicam 2017-07-17 09-08-18-478.png

Link to comment
Share on other sites

  • Administrators

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

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

gg.alert('You done!')

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

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

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