Jump to content
nalcwap

help lua how add offset diference and edit

Recommended Posts

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

Edited by nalcwap

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
4 minutes ago, 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

but how add?thanks

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites
Posted (edited)
3 hours ago, 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

what wrong i want add E40 offset and edit that address but give eror

com.shinybox.smash wrong add offset E40.lua

Edited by nalcwap

Share this post


Link to post
Share on other sites
7 minutes ago, nalcwap said:

but give eror

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.

Share this post


Link to post
Share on other sites
Posted (edited)
9 minutes ago, Enyby said:

What error?

sorry the wait where the screenshot be save with gg?

[added 2 minutes later]
9 minutes ago, 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.

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

Edited by nalcwap

Share this post


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

sorry the wait where the screenshot be save with gg?

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?

 

Share this post


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

but how add?thanks

...

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

Share this post


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

very thanks bro , god bless to you

Share this post


Link to post
Share on other sites
On 6/24/2019 at 5: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

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)

Share this post


Link to post
Share on other sites
58 minutes ago, nalcwap said:

`_address=_result[1],address+0xC30`
attempt to perform arithmetic __add on nil and number

_result[1],address is nil.

Share this post


Link to post
Share on other sites

Use dot, not comma.

Share this post


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

Use dot, not comma.

ups my bad i not see very when and put mistake that, very thanks bro

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