SRL Archive - Reflection Help

Turning UID --> Object?


Cstrike

2010-11-29 00:23:33

function R_InPillory: boolean;
var
P: TPoint;
O: UID;
begin
P := GetMyPos;
O := GetObjectAt(P.X, P.Y);
Result := (O.objType = 7261);
end;

I have no idea what UID stands for… is it universal ID?
It seems to get an object and return the object type below. Should I just assume that UID's are TRSObjects?
If so, what's with the insanely high ObjType, AFAIK they only go from 0–>3 from what I've seen.


Also the RSBot solver seems to have this
    public boolean activateCondition() {
if (!game.isLoggedIn()) {
return false;
}
for (RSTile cagetile : cagetiles) {
if (getMyPlayer().getLocation().equals(cagetile)) {
return true;
}
}
if (!inCage) {
inCage = interfaces.getComponent(372, 3).getText().contains(
"Solve the pillory");
}
if (!inCage) {
inCage = interfaces.getComponent(372, 3).getText().contains(
"swinging");
}
return inCage;
}

public RSObject findMYObject(final int... ids) {
// Changed to find the nearest, reachable!
// fixed, lol, objects.getAt want a real xy not this one
RSObject cur = null;
int dist = -1;
for (int x = 0; x < 104; x++) {
for (int y = 0; y < 104; y++) {
final RSObject[] objs = objects.getAllAt(new RSTile(x + game.getBaseX(), y + game.getBaseY()));
if (objs.length > 0) {
RSObject o = objs[0];
boolean isObject = false;
for (final int id : ids) {
if (o.getID() == id) {
isObject = true;
break;
}
}
if (isObject) {
final int distTmp = calc.distanceTo(o.getLocation());
if (distTmp != -1) {
if (cur == null) {
dist = distTmp;
cur = o;
} else if (distTmp < dist) {
cur = o;
dist = distTmp;
}
}
}
}
}
}
return cur;
}

If the UID issue can be solved, the pillory random may be fully functional, and then there's only 1 more random to solve! Prison.


EDIT: Would this suffice as a valid replacement?
EDIT2: Does not compile, crashes GetObjectAt, since it's only designed for 0..3
function R_InPillory: boolean;
var
P: TTile;
O: TRSObject;
begin
P := GetMyPos;
O := GetObjectAt(P, 7261);
Result := not (O = NULL_RSOBJECT);
end;

Frement

2010-11-29 00:50:34

Unique Identifier?