Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue getting items from corpse backpack #142

Open
jarrettchisholm opened this issue Nov 6, 2022 · 1 comment
Open

Issue getting items from corpse backpack #142

jarrettchisholm opened this issue Nov 6, 2022 · 1 comment

Comments

@jarrettchisholm
Copy link

Information we need from you if you want to have something fixed:

  • Add a link to the server you're playing on.
    OSI

  • Describe the bug and add a screenshot ( or a gif/mp4 ) from EA's classic 2d client and from Orion client.
    http://https://gyazo.com is a very nice tool for this.

There seems to be an issue when attempting to grab information from a corpse via JavaScript.

I have a script that will iterate through corpses on the ground, open their backpacks, and then iterate through the contents of the backpack and print the information to the text window.

When I kill a monster and run the script, it is not properly iterating through the items of the backpack. It seems to think there is only one item, and the details look like this:

Serial=0x46C11A9F Graphic=0x2006 Name=
Count: 1  Color: 0x0000  Layer: 0
X=47 Y=88 Z=0 C=0x46C11AA0 F=0x00
Properties:

If I wait a couple of minutes or so, then run the script again, it works as expected.

Example:

var corpses = Orion.FindType(0xFFFF, 0xFFFF, ground, 'item', 2);

TextWindow.Open();    
TextWindow.Clear();

for (var i = 0; i < corpses.length; i++) {
    const corpse = corpses[i];
    
    Orion.OpenContainer(corpse);
    Orion.Wait(1000);
    
    const items = Orion.FindType(0xFFFF, 0xFFFF, corpse, 'item');
    
    for (var j = 0; j < items.length; j++) {
        const item = items[j];
        Orion.Info(item);
    }
}

@Hotride
Copy link
Owner

Hotride commented Nov 13, 2022

On OSI, the serial number of the corpse is different from the serial number of the Gump container
Use lastcontainer for find items in corpse:
const items = Orion.FindType(any, any, lastcontainer);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants