Jump to content
Enyby

LUA scripting

Recommended Posts


Is it fast enough to make aimbot (keep change crosshair coords relative to enemy coords) or it is unreliable? 

Edited by RogerAngell

Share this post


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

Is this fast enough to make aimbot (keep change crosshair coords relative to enemy coords) or it is unreliable? 

It's fast and reliable as I have worked with it.

I think if you want to make an aimbot, it may work well.

Share this post


Link to post
Share on other sites

For save order of fields in gg.prompt need use table without indexes:

local d = gg.prompt({'health 1', 'attack 1', 'health 2', 'attack 2', 'health 3', 'attack 3', 'health 4', 'attack 4', 'health 5', 'attack 5'}, nil, 
	{'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number', 'number'})

You can access to fields by it index starting from 1. In this example it be d[1], d[2], d[3], ..., d[10].

scr_1500498032.jpg

Share this post


Link to post
Share on other sites

Is there a way to save values and manipulate the saved list? Or is it currently only working with the results list and the raw addresses?

I would like to build a script that can save a result to the saved addresses tab, then freeze the value if necessary... Also loading a particular value in the saved list, performing an operation and then searching based on the result...

Edited by Goof

Share this post


Link to post
Share on other sites

Currently script no have access to saved list inside gg. But you can use regular files for that. Gg provide all need pathes, io lib all needed methods.

Freeze currently not available too. We add access in future.

Share this post


Link to post
Share on other sites

Do you have an example script that covers saving and loading from file? I'm not sure how to approach this, can I load a file saved using a script and then freeze values manually with the saved list tab?

 

Great to see scripting implemented, should add huge potential for more user friendly list once it all matures a bit :)

Share this post


Link to post
Share on other sites

It is common things not connected with gg. Then you can find need info and example in internet. We not invent lua. We only add to it one table. All other stay same as before us. Then you can use internet for info.

6 hours ago, Enyby said:

Currently script no have access to saved list inside gg.

6 hours ago, Enyby said:

Freeze currently not available too. We add access in future.

 

_______________________________________________
added 2 minutes later

For example I search on Internet:

http://lua-users.org/wiki/TableSerialization

https://www.lua.org/pil/12.1.html

http://lua-users.org/wiki/SaveTableToFile

 

Share this post


Link to post
Share on other sites

Build 5559 no need anymore. You must use latest version (v8.29.0 at least).

Share this post


Link to post
Share on other sites
2 hours ago, Enyby said:

Build 5559:

GameGuardian.5559.apk

By installing this, it gives 2 icons on the drawer:

GG (HW) and GG (SW)

Screenshot_20170720-233903-01.thumb.jpeg.3b88b11b6a9c1915351de33baabd19b3.jpeg

Is it about hardware acceleration & software acceleration?

Edited by Backlift

Share this post


Link to post
Share on other sites

Yes. This be from next release. Some buggy firmware can run only HW or only SW acceleration. On normal firmware GG can be started from any activity.

_______________________________________________
added 1 minute later

It is only for start activity. Inside main UI worked setting from settings.

Share this post


Link to post
Share on other sites

Finally. Now this make GG more powerful. Any documentation to GG script library yet?

EDIT: I guess the first post is enough.

Edited by circleous

Share this post


Link to post
Share on other sites
47 minutes ago, circleous said:

Any documentation to GG script library yet?

Will be in future. Now only short help in first post and button help in execute script dialog in latest test builds/ next releases.

Share this post


Link to post
Share on other sites

Please add somehthing like Kill the script process. I got into infinite loop by mistake while debug the script.

Share this post


Link to post
Share on other sites
Spoiler

--[[
  MIT License

  Copyright (c) 2017 Kyra Sierra

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.
]]--

gg.alert('Grand Prix Story 2 stats changer hack by [circleous]')

local origData = gg.prompt(
  {'ID', 'Strength', 'Agility', 'Tech', 'IQ', 'Anlys', 'Appl'},
  {[1]='PUT UNIQUE ID'},
  {[1]='text'}
)

if origData[1] ~= nil then
  local file = io.open(gg.EXT_FILES_DIR..'/GPS2_stats_backup.lua', 'w')
  io.output(file)
  for i,data in pairs(origData) do
    io.write(data..'\n')
  end
  io.close(file)
  gg.alert('Backup stats data saved to '..gg.EXT_FILES_DIR..'/GPS2_stats_backup.lua')
end

local replaceData = gg.prompt({ 'Replace All' })

gg.toast('Finding eggs...')

gg.setRanges(gg.REGION_ANONYMOUS)

if replaceData[1] then -- REPLACE ALL -- TODO: Replace by data ID
	gg.toast('Crushing the eggs...')
	gg.editAll(''..replaceData[1]..'', gg.TYPE_DWORD)
else
	gg.toast('ERROR: No value given in Replace All')
end

gg.alert('Woot! SUCCESS.')

 


$ cat /sdcard/Android/data/com.wxgrgyjnzvqbddnjcqwf/files/GPS2_stats_backup.lua
ANNE
875
872
869
867
867
869
Spoiler

zb61K.jpg

OAgDC.jpg

i6Jkf.jpg

An example for File I/O operation still primitive, but you could use your own wrapper for that. since GG will add lua import in future so that table.save and table.load can be used thus the complex File I/O wrapper somewhat not needed.

Edited by circleous

Share this post


Link to post
Share on other sites
3 hours ago, circleous said:

Please add somehthing like Kill the script process.

Already present if UI open. Stop button at left top corner.

 

scr_1500498032.jpg

_______________________________________________
added 3 minutes later
1 hour ago, circleous said:

since GG will add lua import in future so that table.save and table.load can be used thus the complex File I/O wrapper somewhat not needed.

Do not make sense. Format of file can be any.

Share this post


Link to post
Share on other sites
gg.clearResults()
if gg.isVisible(true) then 
  
   gg.setVisible(false) 
  --[===[ is gg.isvisible and gg.setVisible supported in GG ?
end 
::novalue::
gg.toast('Candy Crush Soda Lua Script By Ankit007')
data = gg.prompt({[1]='Enter Your Score'}, {[1]''})
if data == nil then
   gg.toast ('Please enter a value')
   goto novalue
end 
gg.searchNumber(data[1], gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
if gg.getResultCount() < 6 then
	data = gg.editAll('2117483647', gg.TYPE_DWORD))
	gg.toast (' Enjoy the game')
else
gg.toast( 'to many values found update the value and try  again')
end

As i am new in lua scripting just started yesterday, and after understanding the lua first i started with Candy Crush Soda Score Increase Script

I want this script to hide the main gg and show only the script screen and

also 2 if conditions one to check that user should not enter the a null value and second that if to many values found then it should say that update the value

but to update and search again the user should close the script, i tried t add the sleep function but don't know much about it

Any thing required to be changed in the code ?

new 1.lua

Share this post


Link to post
Share on other sites
3 hours ago, Enyby said:

Do not make sense. Format of file can be any.

:/ I just started learning LUA this morning. Community Documentation said File format was .lua. dont bully plox. Thanks for info tho.

But the table.load and table.save isn't usable right? Tried it many times, but seems like its just an empty function (nil)

Edited by circleous
grammad fix

Share this post


Link to post
Share on other sites
Just now, ankit007 said:

data = gg.prompt({[1]='Enter Your Score'}, {[1]''})

prompt(table, [table, [table]])

Default value for input table is nil, you don't need to add [1]''

Share this post


Link to post
Share on other sites
3 minutes ago, circleous said:

prompt(table, [table, [table]])

Default value for input table is nil, you don't need to add [1]''

thx but still it will be nil as i didn't passed any value to it

anyway thanks , don't know much about lua, still in learning stage

Edited by ankit007

Share this post


Link to post
Share on other sites
3 hours ago, ankit007 said:

--[===[ is gg.isvisible and gg.setVisible supported in GG ?

 

17 hours ago, Enyby said:

Build 5559:

GameGuardian.5559.apk

 

_______________________________________________
added 0 minutes later
3 hours ago, ankit007 said:

{[1]''})

error. Skipped '='.

_______________________________________________
added 2 minutes later
3 hours ago, ankit007 said:

I want this script to hide the main gg and show only the script screen and

use isVisible, setVisible.

_______________________________________________
added 2 minutes later
4 hours ago, ankit007 said:

to check that user should not enter the a null value

Make check in your code.

_______________________________________________
added 3 minutes later
4 hours ago, ankit007 said:

if to many values found then it should say that update the value

getResultCount() and do anything with this number.

Share this post


Link to post
Share on other sites
4 hours ago, ankit007 said:

to update and search again the user should close the script, i tried t add the sleep function but don't know much about it

Use loop like I do in my scripts: https://gameguardian.net/forum/topic/17447-lua-scripting/?do=findComment&comment=58903

 

_______________________________________________
added 2 minutes later
4 hours ago, circleous said:

Community Documentation said File format was .lua.

It is not format. It is only extension.

Hat can be red. but it doesn't say anything useful about people below it. Same with file. extension of file and file internal structure AKA format not connected. You can rename .txt to .exe but this not make text file executable.

_______________________________________________
added 2 minutes later
4 hours ago, circleous said:

But the table.load and table.save isn't usable right? Tried it many times, but seems like its just an empty function (nil)

This functions not exists.

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

×