HelpRealmRelay scripting help

Posts 1–6 of 6 · Page 1 of 1
RealmRelay scripting help
hello everyone, i'm having an issue with one of the realmrelay scripts that i'm trying to code.
basically i need to get the ids of the items in my inventory and store them into an array, the problem is that they only update when i enter a portal, is there any way to get them to update without leaving the realm?
You would want to store your item list in an array once you get your first update packet it will have your inventory. You wont need it again if you store it from the beginning.
@FainTMako mh, wait, i'll try to explain what happens when i try to get the items,

Code:
           ----some other code up here----
						if(objectData.status.data[j].obf0 >= 12 && objectData.status.data[j].obf0 <= 19) {
							if(objectData.status.data[j].obf1 != -1) {
								inventory[j] = objectData.status.data[j].obf1;
								$.echo(inventory[j] + " " + j);
							}
						}
the problem here is that i only get output from the $.echo when i first enter the realm, so i wanted to know if there's any way to trigger another update packet, or if there's something that i'm doing wrong in this code
As long as your storing the variable inventory in the global scope than you can access any of its entries like this $.echo(inventory[0]);
Also if the item == -1 you will probably want to store that as well.
@FainTMako the inventory var is right below all the $.findPacketId variables, so it should be ok.
but it still doesn't update, for example if i have a dex in slot one, the output of $.echo(inventory[12]) (12 is the first slot) is 2636, but then if i empty the slot and check again, the output stays 2636 until i go through a portal, then it changes to -1.....and that's pretty much the problem i had from the beginning, i need it to update every time
The inventory gets updated in Newobjs (When you join a realm) and Newtick (When you move things around)

To know whats in your inventory, you would need to know your objectId (ID, you get it once you join the realm) and check for newticks with that objectid

Sorry if this doesn't answer your question I'm at a solid [10]
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us