Hey
I'm using this code trying to get the item id like in the server (meat == 2666) but I get id 3577 instead:
For the name I'm calling getName() but it prints an empty string.
I don't really want to query everytime I check an item to the server, even building a cache it's something I don't really like...
If I check with cheat engine, and I inspect an item pointer, I can see the correct itemid in the offset 0x2C, aswell as the count in the offset 0x30 and that is for almost every otclient, so that's a proof that the real item id is already cached in the client...
If I check with the GM, I can confirm the correct id for the item is 2666:
Trying to print(json.encode(item)) the Item object to see which properties or members I can use I'm getting this error:
Can someone throw directions?
Thanks <3
I'm using this code trying to get the item id like in the server (meat == 2666) but I get id 3577 instead:
Lua:
for i, container in pairs(g_game.getContainers()) do
local container_items = container:getItems()
for j, item in pairs(container_items) do
print("Fond item in container: " .. item.getId())
end
end
For the name I'm calling getName() but it prints an empty string.
I don't really want to query everytime I check an item to the server, even building a cache it's something I don't really like...
If I check with cheat engine, and I inspect an item pointer, I can see the correct itemid in the offset 0x2C, aswell as the count in the offset 0x30 and that is for almost every otclient, so that's a proof that the real item id is already cached in the client...
If I check with the GM, I can confirm the correct id for the item is 2666:
09:28 You see meat.
It weighs 52.00 oz.
Item ID: 2666
Position: 95, 124, 7
Trying to print(json.encode(item)) the Item object to see which properties or members I can use I'm getting this error:
ERROR: lua function callback failed: /modules/corelib/json.lua:148: unexpected type 'userdata'
Can someone throw directions?
Thanks <3
Last edited: