Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.rsbot.script.wrappers;
- import org.rsbot.accessors.ObjectDef;
- import org.rsbot.bot.Bot;
- import org.rsbot.script.Calculations;
- public class RSObject {
- long uid;
- public RSObject(final long uid) {
- this.uid = uid;
- }
- public RSObjectDef getDef() {
- return new RSObjectDef((ObjectDef) Calculations.findNodeByID(getID()));
- }
- public int getID() {
- return (int) (uid >>> 32) & 0x7fffffff;
- }
- public RSTile getLocation() {
- return new RSTile((int) (Bot.getClient().getBaseX() + (uid & 0x7f)),
- (int) (Bot.getClient().getBaseY() + (uid >> 7 & 0x7f)));
- }
- /**
- * type is a one-digit integer 0 - object player 1 - object npc 2 - object
- * which doesn't move (rock, tree) 3 - object item
- */
- public int getType() {
- return (int) (uid >> 29) & 0x3;
- }
- }
Add Comment
Please, Sign In to add comment