Jump to content
  • 0

help lua how add offset diference and edit


Question

Posted (edited)

i generated this search with gameguardian to generate the lua script but it not save when in go to offset and go to the value and change, i want continue this script by go to ADDRESS i search  and  go to there and add offset

F0   and edit in the new address that value, is not possible the generator save thats changes?if not how put in script to go to that address by  offset more F0?thanks

com.shinybox.smash.luaFetching info...

Edited by nalcwap

Recommended Posts

  • 0
Posted

Its easy, copy all content on script you attached above. Then add a few line of code.

1. Get all listed items.

2. Get the address, and add offset.

3. gg.setValues

  • 0
Posted
  On 6/24/2019 at 12:39 AM, saiaapiz said:

Its easy, copy all content on script you attached above. Then add a few line of code.

1. Get all listed items.

2. Get the address, and add offset.

3. gg.setValues

Expand  

but how add?thanks

  • 0
Posted

i have this   how add the offset and go to there and edit?   gg.searchNumber("9904B8A0h", gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)

  • 0
  • Administrators
Posted
  On 6/24/2019 at 4:02 AM, nalcwap said:

but give eror

Expand  

What error?

[added 0 minutes later]
local copy = false
local t = gg.getListItems()
if not copy then gg.removeListItems(t) end
for i, v in ipairs(t) do
	v.address = v.address + 0xe40
	if copy then v.name = v.name..' #2' end
end
gg.addListItems(t)
gg.setValues()

gg.setValues() require parameter.

  • 0
Posted (edited)
  On 6/24/2019 at 4:10 AM, Enyby said:

What error?

Expand  

sorry the wait where the screenshot be save with gg?

[added 2 minutes later]
  On 6/24/2019 at 4:10 AM, Enyby said:

What error?

[added 0 minutes later]
local copy = false
local t = gg.getListItems()
if not copy then gg.removeListItems(t) end
for i, v in ipairs(t) do
	v.address = v.address + 0xe40
	if copy then v.name = v.name..' #2' end
end
gg.addListItems(t)
gg.setValues()

gg.setValues() require parameter.

Expand  

very thanks bro, edit , i put gg.setVslues(t) not give error but not show the changes 

Edited by nalcwap
  • 0
  • Administrators
Posted
  On 6/24/2019 at 4:15 AM, nalcwap said:

sorry the wait where the screenshot be save with gg?

Expand  

What?

http://www.catb.org/~esr/faqs/smart-questions.html

  Quote

Q:

My {program, configuration, SQL statement} doesn't work

A:

This is not a question, and I'm not interested in playing Twenty Questions to pry your actual question out of you — I have better things to do. On seeing something like this, my reaction is normally of one of the following:

do you have anything else to add to that?

oh, that's too bad, I hope you get it fixed.

and this has exactly what to do with me?

Expand  

 

  • 0
Posted
  On 6/24/2019 at 12:44 AM, nalcwap said:

but how add?thanks

Expand  
...

-- main code
gg.searchNumber("9904B8A0h", gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)

-- Added Code !
_resultCount = gg.getResultCount()
if _resultCount > 0 then -- Check for result, before using value.
	_result = gg.getResults(1) -- Get list no 1.
	
	_address = _result[1].address + 0xF0 -- Add 0xF0 at address list of no 1.

	gg.alert(string.format("Original Address: 0x%X\nAddress With Offset 0xF0: 0x%X", 
	_result[1].address, _address))
	
	-- Edit value on address that we added with offset before.
	gg.setValues({{address = _address, flags = gg.TYPE_DWORD, value = 0x1}})
end

 

com.shinybox.smash.luaFetching info...

  • 0
Posted
  On 6/24/2019 at 4:44 AM, saiaapiz said:
...

-- main code
gg.searchNumber("9904B8A0h", gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)

-- Added Code !
_resultCount = gg.getResultCount()
if _resultCount > 0 then -- Check for result, before using value.
	_result = gg.getResults(1) -- Get list no 1.
	
	_address = _result[1].address + 0xF0 -- Add 0xF0 at address list of no 1.

	gg.alert(string.format("Original Address: 0x%X\nAddress With Offset 0xF0: 0x%X", 
	_result[1].address, _address))
	
	-- Edit value on address that we added with offset before.
	gg.setValues({{address = _address, flags = gg.TYPE_DWORD, value = 0x1}})
end

 

com.shinybox.smash.lua 1.84 kB · 0 downloads

Expand  

very thanks bro , god bless to you

  • 0
Posted
  On 6/24/2019 at 4:44 AM, saiaapiz said:
...

-- main code
gg.searchNumber("9904B8A0h", gg.TYPE_AUTO, false, gg.SIGN_EQUAL, 0, -1)

-- Added Code !
_resultCount = gg.getResultCount()
if _resultCount > 0 then -- Check for result, before using value.
	_result = gg.getResults(1) -- Get list no 1.
	
	_address = _result[1].address + 0xF0 -- Add 0xF0 at address list of no 1.

	gg.alert(string.format("Original Address: 0x%X\nAddress With Offset 0xF0: 0x%X", 
	_result[1].address, _address))
	
	-- Edit value on address that we added with offset before.
	gg.setValues({{address = _address, flags = gg.TYPE_DWORD, value = 0x1}})
end

 

com.shinybox.smash.lua 1.84 kB · 4 downloads

Expand  

anyone know why this error   ?

Script terminado:
Script error: luaj.LuaError: @/storage/emulated/0/Notes/com.shinybox.smash.lua:50
`_address=_result[1],address+0xC30`
attempt to perform arithmetic __add on nil and number
level = 1, pc = 113
stack traceback:
    /storage/emulated/0/Notes/com.shinybox.smash.lua:50 in main chunk
    [Java]: in ?
    at luaj.LuaValue.error(LuaValue.java:1075)
    at luaj.LuaValue.arithmt(LuaValue.java:2326)
    at luaj.LuaValue.add(LuaValue.java:2211)
    at luaj.LuaClosure.execute(LuaClosure.java:302)
    at luaj.LuaClosure.call(LuaClosure.java:145)
    at android.ext.Script.runScript(Script.java:5513)
    at android.ext.Script$ScriptThread.run(Script.java:5314)

  • 0
Posted

update give other error sorrfy

 

Script terminado:
Script error: luaj.LuaError: @/storage/emulated/0/Notes/com.shinybox.smasheror.lua:51
`gg.setValues({{address=_address,flags=gg.Type_DWORD,value=0x1}})`
bad argument for key 'flags': int expected, got nil
level = 1, pc = 126
stack traceback:
    /storage/emulated/0/Notes/com.shinybox.smasheror.lua:51 in main chunk
    [Java]: in ?
    at android.ext.Script.badArg(Script.java:5203)
    at android.ext.Script.checkint(Script.java:5236)
    at android.ext.Script.toItem(Script.java:5118)
    at android.ext.Script$setValues.invoke2(Script.java:3741)
    at android.ext.Script$ApiFunction.invoke(Script.java:1264)
    at luaj.lib.VarArgFunction.call(VarArgFunction.java:58)
    at luaj.LuaValue.callNotNull(LuaValue.java:3246)
    at luaj.LuaClosure.execute(LuaClosure.java:432)
    at luaj.LuaClosure.call(LuaClosure.java:145)
    at android.ext.Script.runScript(Script.java:5513)

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.