Jump to content
  • 0

help lua how add offset diference and edit


nalcwap
 Share

Question

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

Recommended Posts

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

Link to comment
Share on other sites

  • 0
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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 0
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
Link to comment
Share on other sites

  • 0
  • Administrators
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?

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 0
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)

Link to comment
Share on other sites

  • 0

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)

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
 Share

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