SRL Archive - Reflection Discussion

New reflection thread.


Dervish

2009-12-13 13:54:53

Since the other thread was closed due to cussing, flaming, spamming and immaturities, I wanted to open a new one :p since some people (like simtoon (I think it was you)) posted some really good stuff to help us out.

I personally would love reflection being brought back, as I see it to be the easiest way to achieve a close to flawless script in SCAR.

If this is considered as spam close this thread.

YoHoJo

2009-12-13 14:02:34

As long as people only post contributeive/helpful information about reflection and its status etc and not just spam in here it'll be fine.

Wanted

2009-12-13 14:10:10

I'm trying to write a simple reflection debugger than returns current position and position of your mouse on the main screen.

program SimpleReflectionDebugger;

{.Include SRL\SRL\Misc\SMART.SCAR}
{.Include SRL\SRL.SCAR}
{.Include SRL\SRL\Reflection\Reflection.SCAR}

var
Pos, MP: TPoint;

begin
Smart_Server := 38;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
SetUpSRL;
Wait(5000);
repeat
ClearDeBug;
Pos := GetMyPos;
WriteLn('My current pos: (' + IntToStr(Pos.X) + ', ' + IntToStr(Pos.Y) +')');
GetMousePos(MP.X, MP.Y);
if (PointInBox(MP, IntToBox(MSX1, MSY1, MSX2, MSY2)) then
begin
end;
Wait(1000);
until (False);
end.


Having trouble with the mouse on MS -> tile part, anyone want to help?

GetMyPos seems to work well.

Baked0420

2009-12-13 14:18:41

I'm looking through RSBot's files, haven't found anything to useful yet. Just things like this:


package org.rsbot.accessors;

import java.awt.Rectangle;

import org.rsbot.bot.input.Keyboard;
import org.rsbot.bot.input.Mouse;
import org.rsbot.bot.input.MouseWheel;

public interface Client {

NodeList getActionDataList();
int getBaseX();

int getBaseY();
Callback getCallBack();
int getCameraPitch();

//RenderData getCameraRenderData();
int getCameraYaw();
int getCamPosX();

int getCamPosY();
int getCamPosZ();

String[] getChatMessages();

String[] getChatNames();
int[] getChatTypes();

String getCurrentPassword();

String getCurrentUsername();
int getDestX();

int getDestY();

int getDetailLevel();
//Render getGameRender();
byte[][][] getGroundByteArray();
int[][][] getGroundIntArray();

int getGUIRSInterfaceIndex();
int getIdleTime();

Keyboard getKeyboard();
int getLoginIndex();
int getLoopCycle();

int getMenuOptionsCount();
int getMenuX();
int getMenuY();

int getMinimapAngle();
float getMinimapOffset();
int getMinimapScale();

int getMinimapSetting();
Mouse getMouse();

MouseWheel getMouseWheel();

RSPlayer getMyRSPlayer();

int getPlane();

int getPublicChatMode();

RSGround[][][] getRSGroundArray();
RSGroundData[] getRSGroundDataArray();
StatusNodeList getRSInteractingDefList();
Rectangle[] getRSInterfaceBoundsArray();

RSInterface[][] getRSInterfaceCache();
NodeCache getRSInterfaceNC();
MRUNodes getRSItemDefMRUNodes();
NodeCache getRSItemNodeCache();

RSNPC[] getRSNPCArray();
int getRSNPCCount();
int[] getRSNPCIndexArray();

RSPlayer[] getRSPlayerArray();
int getRSPlayerCount();

int[] getRSPlayerIndexArray();

String getSelectedItemName();
int getSelfInteracting();
int[] getSettingArray();

Signlink getSignLink();
int[] getSkillExperiences();
int[] getSkillExperiencesMax();
int[] getSkillLevelMaxes();

int[] getSkillLevels();

TileData[] getTileData();
boolean[] getValidRSInterfaceArray();

boolean isFlagged();

int isItemSelected();

boolean isMembers();
boolean isMenuOpen();

boolean isSpellSelected();

void setCallback(Callback cb);


}


and


package org.rsbot.script.wrappers;

import java.awt.Point;

import org.rsbot.bot.Bot;
import org.rsbot.script.Calculations;
import org.rsbot.script.Methods;

public class RSCharacter {
public final Methods methods = new Methods();
protected org.rsbot.accessors.RSCharacter c;

public RSCharacter(final org.rsbot.accessors.RSCharacter c) {
this.c = c;
}

@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof org.rsbot.script.wrappers.RSCharacter) {
final org.rsbot.script.wrappers.RSCharacter cha = (org.rsbot.script.wrappers.RSCharacter) obj;
return cha.c == c;
}
return false;
}

public int getAnimation() {
return c.getAnimation();
}

public int getHeight() {
return c.getHeight();
}

/**
* Returns the % of HP. Returns 100 if not in combat.
* */
public int getHPPercent() {
return isInCombat() ? c.getHPRatio() * 100 / 255 : 100;
}

public RSCharacter getInteracting() {

final int interact = c.getInteracting();
if (interact == -1) {
return null;
}

if (interact < 32768) {
return new org.rsbot.script.wrappers.RSNPC(Bot.getClient()
.getRSNPCArray()[interact]);
} else if (interact >= 32768) {
int index = interact - 32768;
if (index == Bot.getClient().getSelfInteracting()) {
index = 2047;
}

return new org.rsbot.script.wrappers.RSPlayer(Bot.getClient()
.getRSPlayerArray()[index]);
}

return null;
}

public RSTile getLocation() {
if (c == null) {
return new RSTile(-1, -1);
}
final int x = Bot.getClient().getBaseX() + (c.getX() >> 7);
final int y = Bot.getClient().getBaseY() + (c.getY() >> 7);
return new RSTile(x, y);
}

public String getMessage() {
return c.getMessage();
}

/**
* Get's the minimap location, of the character. Note: This does work when
* it's walking!
*
* @return
*/
public Point getMinimapLocation() {
final int cX = Bot.getClient().getBaseX() + (c.getX() / 32 - 2) / 4;
final int cY = Bot.getClient().getBaseY() + (c.getY() / 32 - 2) / 4;
return Calculations.worldToMinimap(cX, cY);
}

public String getName() {
return "UNDEFINED"; // should be overridden, obviously
}

public Point getScreenLocation() {
// RSTile loc = getLocation();
// return Calculations.tileToScreen(loc.getX(), loc.getY(),
// 0.5, 0.9, (c.getHeight() / 2));
return Calculations.worldToScreen(c.getX(), c.getY(), -c.getHeight());
}

/**
* Currently unhooked
*
* @return 0
*/
public int getTurnDirection() {
return 0;
}

@Override
public int hashCode() {
return System.identityHashCode(c);
}

public boolean isInCombat() {
if (!methods.isLoggedIn()) {
return false;
}
return Bot.getClient().getLoopCycle() < c.getLoopCycleStatus();
}

public boolean isInteractingWithLocalPlayer() {
return c.getInteracting() - 32768 == Bot.getClient()
.getSelfInteracting();
}

public boolean isMoving() {
return c.isMoving() != 0;
}

public boolean isOnScreen() {
return methods.tileOnScreen(getLocation());
}

public boolean isValid() {
return c != null;
}

@Override
public String toString() {
final RSCharacter inter = getInteracting();
return "[anim="
+ getAnimation()
+ ",msg="
+ getMessage()
+ ",interact="
+ (inter == null ? "null" : inter.isValid() ? inter
.getMessage() : "Invalid") + "]";
}
}


looking for where they actually get that info from though. :p

Wanted

2009-12-13 14:19:35

From: Baked0420
I'm looking through RSBot's files, haven't found anything to useful yet. Just things like this:


package org.rsbot.accessors;

import java.awt.Rectangle;

import org.rsbot.bot.input.Keyboard;
import org.rsbot.bot.input.Mouse;
import org.rsbot.bot.input.MouseWheel;

public interface Client {

NodeList getActionDataList();
int getBaseX();

int getBaseY();
Callback getCallBack();
int getCameraPitch();

//RenderData getCameraRenderData();
int getCameraYaw();
int getCamPosX();

int getCamPosY();
int getCamPosZ();

String[] getChatMessages();

String[] getChatNames();
int[] getChatTypes();

String getCurrentPassword();

String getCurrentUsername();
int getDestX();

int getDestY();

int getDetailLevel();
//Render getGameRender();
byte[][][] getGroundByteArray();
int[][][] getGroundIntArray();

int getGUIRSInterfaceIndex();
int getIdleTime();

Keyboard getKeyboard();
int getLoginIndex();
int getLoopCycle();

int getMenuOptionsCount();
int getMenuX();
int getMenuY();

int getMinimapAngle();
float getMinimapOffset();
int getMinimapScale();

int getMinimapSetting();
Mouse getMouse();

MouseWheel getMouseWheel();

RSPlayer getMyRSPlayer();

int getPlane();

int getPublicChatMode();

RSGround[][][] getRSGroundArray();
RSGroundData[] getRSGroundDataArray();
StatusNodeList getRSInteractingDefList();
Rectangle[] getRSInterfaceBoundsArray();

RSInterface[][] getRSInterfaceCache();
NodeCache getRSInterfaceNC();
MRUNodes getRSItemDefMRUNodes();
NodeCache getRSItemNodeCache();

RSNPC[] getRSNPCArray();
int getRSNPCCount();
int[] getRSNPCIndexArray();

RSPlayer[] getRSPlayerArray();
int getRSPlayerCount();

int[] getRSPlayerIndexArray();

String getSelectedItemName();
int getSelfInteracting();
int[] getSettingArray();

Signlink getSignLink();
int[] getSkillExperiences();
int[] getSkillExperiencesMax();
int[] getSkillLevelMaxes();

int[] getSkillLevels();

TileData[] getTileData();
boolean[] getValidRSInterfaceArray();

boolean isFlagged();

int isItemSelected();

boolean isMembers();
boolean isMenuOpen();

boolean isSpellSelected();

void setCallback(Callback cb);


}


and


package org.rsbot.script.wrappers;

import java.awt.Point;

import org.rsbot.bot.Bot;
import org.rsbot.script.Calculations;
import org.rsbot.script.Methods;

public class RSCharacter {
public final Methods methods = new Methods();
protected org.rsbot.accessors.RSCharacter c;

public RSCharacter(final org.rsbot.accessors.RSCharacter c) {
this.c = c;
}

@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof org.rsbot.script.wrappers.RSCharacter) {
final org.rsbot.script.wrappers.RSCharacter cha = (org.rsbot.script.wrappers.RSCharacter) obj;
return cha.c == c;
}
return false;
}

public int getAnimation() {
return c.getAnimation();
}

public int getHeight() {
return c.getHeight();
}

/**
* Returns the % of HP. Returns 100 if not in combat.
* */
public int getHPPercent() {
return isInCombat() ? c.getHPRatio() * 100 / 255 : 100;
}

public RSCharacter getInteracting() {

final int interact = c.getInteracting();
if (interact == -1) {
return null;
}

if (interact < 32768) {
return new org.rsbot.script.wrappers.RSNPC(Bot.getClient()
.getRSNPCArray()[interact]);
} else if (interact >= 32768) {
int index = interact - 32768;
if (index == Bot.getClient().getSelfInteracting()) {
index = 2047;
}

return new org.rsbot.script.wrappers.RSPlayer(Bot.getClient()
.getRSPlayerArray()[index]);
}

return null;
}

public RSTile getLocation() {
if (c == null) {
return new RSTile(-1, -1);
}
final int x = Bot.getClient().getBaseX() + (c.getX() >> 7);
final int y = Bot.getClient().getBaseY() + (c.getY() >> 7);
return new RSTile(x, y);
}

public String getMessage() {
return c.getMessage();
}

/**
* Get's the minimap location, of the character. Note: This does work when
* it's walking!
*
* @return
*/
public Point getMinimapLocation() {
final int cX = Bot.getClient().getBaseX() + (c.getX() / 32 - 2) / 4;
final int cY = Bot.getClient().getBaseY() + (c.getY() / 32 - 2) / 4;
return Calculations.worldToMinimap(cX, cY);
}

public String getName() {
return "UNDEFINED"; // should be overridden, obviously
}

public Point getScreenLocation() {
// RSTile loc = getLocation();
// return Calculations.tileToScreen(loc.getX(), loc.getY(),
// 0.5, 0.9, (c.getHeight() / 2));
return Calculations.worldToScreen(c.getX(), c.getY(), -c.getHeight());
}

/**
* Currently unhooked
*
* @return 0
*/
public int getTurnDirection() {
return 0;
}

@Override
public int hashCode() {
return System.identityHashCode(c);
}

public boolean isInCombat() {
if (!methods.isLoggedIn()) {
return false;
}
return Bot.getClient().getLoopCycle() < c.getLoopCycleStatus();
}

public boolean isInteractingWithLocalPlayer() {
return c.getInteracting() - 32768 == Bot.getClient()
.getSelfInteracting();
}

public boolean isMoving() {
return c.isMoving() != 0;
}

public boolean isOnScreen() {
return methods.tileOnScreen(getLocation());
}

public boolean isValid() {
return c != null;
}

@Override
public String toString() {
final RSCharacter inter = getInteracting();
return "[anim="
+ getAnimation()
+ ",msg="
+ getMessage()
+ ",interact="
+ (inter == null ? "null" : inter.isValid() ? inter
.getMessage() : "Invalid") + "]";
}
}


looking for where they actually get that info from though. :p


Uh we have the hooks.

Baked0420

2009-12-13 14:24:02

I thought we didn't have all the hooks yet… when did we get them?

YoHoJo

2009-12-13 14:28:33

A few days ago. There's still work that needs to be done though, but we now have some people working on trying to get reflection back up, its looking good so far…

JPHamlett

2009-12-13 14:40:47

Thats a bunch of them fixed (hopefully)but i cant test most of them because i cant find groundheights lol


//------------------------------------------------------------------\\
//-- Scar Non-Standard Resource Library --||
//-- Reflection Routines - Hooks --||
//------------------------------------------------------------------//


const
// Build number
RSBuild = 575;

// NPC
NPCDef = 'mc';

// Player
CharName = 'mc';
CharLevel = 'bd';

// Client
NPCIndexArray = 'hb.B';
NPCArray = 'jf.x';
NPCCount = 'rp.h';

PlayerIndexArray = 'to.f';
PlayerArray = 'mn.A';
PlayerCount = 'ss.K';
MyPlayer = 'sh.j';

BaseX = 'ok.p';
BaseY = 'qr.t';

LoopCycle = 'va.g';

GroundHeights = 'r.b';
GroundSettings = 'vn.g';
BaseLayer = 'gn.n';

CamX = 'ok.n';
CamY = 'hd.V';
CamZ = 'te.e';
CamPitch = 'rr.m';
CamYaw = 'ij.c';

LoginIndex = 'ho.J';

SettingsArray = 'mu.c';

IsMembers = 'null.null';

MaxLevels = 'ig.F';
CurrentLevels = 'uo.j';
Experiences = 'es.a';

MapOffsetAngle = 'wi.K';
CompassAngle = 'nt.b';

ChatMessages = 'qd.b';
ChatTypes = 'rt.a';
ChatNames = 'qd.b';

MenuOptionsCount = 'lt.w';
MenuOpen = 'di.B';
MenuX = 'et.m';
MenuY = 'bu.G';
MenuOption = 'p';
MenuAction = 'ui.k';

SelectedItemName = 'bi.r';

FlagX = 'kg.P';
FlagY = 'ea.a';

// Character
TurnDirection = 'cc';
CharMotion = 'lc';
CharAnim = 'X';
CurrentY = 'ic';
CurrentX = 'hc';
LoopCycleStatus = 'pb';
CharHPRatio = 'Cb';
CharHeight = 'C';
CharInteracting = 'ub';

SelfInteracting = 'ok.p';

// NPCDef
NPCName = 'S';
NPCType = 'gb';
NPCLevel = 'dr.k';

// Ground Item Finding
GroundItemArray = 'vn.g;';
GroundItemHead = 'null';
NextGroundItem = 'd';
GroundItem = 'null';
GroundItemID = 'null';
GroundItemStackSize = 'null';

GroundArray = 'bf.o';

// Object Hooks
Object1 = 'null';
Object2 = 'null';
Object3 = 'null';
Object4 = 'null';
Object5Array = 'null';

ObjectUID1 = 'null';
ObjectUID2 = 'null';
ObjectUID3 = 'null';
ObjectUID4 = 'null';
ObjectUID5 = 'null';

// Interface Hooks
// General
InterfaceCache = 'hh.f';
ValidInterfaceArray = 'pr.S';
InterfaceChildren = 'je.N';
InterfaceText = 'null';
TextColor = 'mc';
SelectedModelID = 'null';
NotSelectedModelID = 'null';
SelectedModelType = 'null';
NotSelectedModelType = 'null';
ModelZoom = 'Db';

// Bank
BankItemID = 'qc';
BankItemStackSize = 'Ac';
BankItemName = 'cb';
BankItemIndex = 'ed';

// Inventory
InventoryItemIDs = 'null';
InventoryItemStackSizes = 'null';

// Ground Data
GroundDataArray = 'ol.W';
GroundDataBlocks = 'f';



YoHoJo

2009-12-13 14:51:14

Yeah AFAIK lots of people are having trouble with ground heights, somethings up with it.

JPHamlett

2009-12-13 14:53:39

but once groundheights is solved then im done with ref cause i have the other hooks on my computer i just gotta find them again the dissapeared when my comp rebooted yesturday lol

YoHoJo

2009-12-13 14:54:55

I thought there was more to fixing reflection than just getting the hooks? I think some other things still need to be fixed/updated.

JPHamlett

2009-12-13 15:10:39

From: YoHoJo
I thought there was more to fixing reflection than just getting the hooks? I think some other things still need to be fixed/updated.


well then the hooks are done once i find groundheights


then ill start on the actual include

Wanted

2009-12-13 15:16:19

I might of heard somewhere ground heights isn't in RS anymore or something, I could be completely wrong though (probably am)

Dervish

2009-12-13 15:16:19

Apparently you got the hooks from decompiling the .class files > RSBot ?

JPHamlett

2009-12-13 15:17:50

From: Dr D. Dervish
Apparently you got the hooks from decompiling the .class files > RSBot ?


is that at me or who is it at lol

Dervish

2009-12-13 15:18:49

From: J_Pizzle
is that at me or who is it at lol


Brain.

JPHamlett

2009-12-13 15:21:40

From: Dr D. Dervish
Brain.


Brain hasnt posted in this thread yet lol



but back on topic if Icefire is right then we need to make a new way to do almost everything lol

Dervish

2009-12-13 15:25:33

From: J_Pizzle
Brain hasnt posted in this thread yet lol



but back on topic if Icefire is right then we need to make a new way to do almost everything lol


Ment baked sorry.

Yes, back on topic :

How could I help ?

JPHamlett

2009-12-13 15:28:11

From: Dr D. Dervish
Ment baked sorry.

Yes, back on topic :

How could I help ?


umm start thinking of a new way for tiletoms

is abou5t all i can think of

Baked0420

2009-12-13 15:29:14

From: Dr D. Dervish
Apparently you got the hooks from decompiling the .class files > RSBot ?


no, I don't have the hooks yet, I'm just ripping through all of RSbots files. I showed in my earlier post the getBaseX(), now I'm looking for where they have that method, then maybe I can find the hooks or how they find them. I was hoping to see how they find the hooks though, so from seeing it, maybe I could learn it.

EDIT: If you guys know how to find a hook, maybe you could show me just one, like the hooks to the tiles or something, just so I know what to look for, or the base to finding hooks.

YoHoJo

2009-12-13 15:34:50

There are like 3 tutorials out on how to get hooks. (Not sure what sections they are in, they might be in the higher forums?) But eventually once everything is sorted out, some tutorials will be made for everyone to see on how to potentially update/fix Reflection yourself if it should ever die again again.

Baked0420

2009-12-13 15:40:21

that's dumb, guess I'll try to find it myself still and teach myself.

EDIT: J_Pizzle, you know anything that could push me in the right direction.


EDIT2: For J_Pizzle or anyone else trying to do TileToMS, I found this in RSBot's coding, see if this helps you guys:



public static int tileHeight_(final int x, final int y) {
final int[][][] ground = Bot.getClient().getGroundIntArray();
int zidx = Bot.getClient().getPlane();
final int x1 = x >> 7;
final int y1 = y >> 7;
final int x2 = x & 127;
final int y2 = y & 127;
// System.out.println((0x7f);

if (x1 < 0 || y1 < 0 || x1 > 103 || y1 > 103) {
return 0;
}

if (zidx < 3
&& (2 & Bot.getClient().getGroundByteArray()[1][x1][y1]) == 2) {
zidx++;
}

final int i = ground[zidx][x1 + 1][y1] * x2 + ground[zidx][x1][y1]
* (128 - x2) >> 7;
final int j = ground[zidx][x1 + 1][y1 + 1] * x2
+ ground[zidx][x1][y1 + 1] * (128 - x2) >> 7;

return j * y2 + (128 - y2) * i >> 7;
}

and


public static Point tileToScreen(final int x, final int y, final double dX,
final double dY, final int height) {
return Calculations.worldToScreen((int) ((x
- Bot.getClient().getBaseX() + dX) * 128), (int) ((y
- Bot.getClient().getBaseY() + dY) * 128), height);
}

he said he was looking for a new to to do TileToMS to me in msn, so I looked around and found that in RSBot. Should help I think. It's got TileHeight along with TileToScreen (TileToMS?)

super_

2009-12-13 17:21:47

question: what exactly are groundheights?

btw:
  GroundDataArray = 'ol.W';
GroundDataBlocks = 'f';
rofl @ that naming… the 'GroundDataArray' is an array of floor level state objects; different planes for different levels of height for things like stairs etc. GroundDataBlocks is the tile traversal flags; different masks mean different ways projectiles or entities could pass through :-p

Nava2

2009-12-13 17:27:23

@Baked, the tileHeight is what was needed. Great work, I can convert that later if no one else can. I am going to need a break from studying soon.

Baked0420

2009-12-13 17:30:01

From: Nava2
@Baked, the tileHeight is what was needed. Great work, I can convert that later if no one else can. I am going to need a break from studying soon.


I know it's what you needed. J_Pizzle said he was looking for a way, I mentioned looking for RSBot's way and he said he was, so I started to, I was in calculations.java, and saw something that led me to that. And thanks :D. I'll see if I can convert it, if so I'll post it in here, if you don't see it in here, then I wasn't able to convert it and you or someone else who can will need to. I'm glad I was able to help :)

EDIT: I don't know what there method .getPlane() does, I would need to look from one method to the next and then probably need to see what the methods in those do, so it would require me looking through a lot of methods to convert this. You would probably get this done before I even figured out what .getPlane() does exactly, but I'll give it a go incase it's not much work.

I found getPlane but it makes no sense, it's public int getPlane() and it just returns Bot.getClient().getPlane(); so it calls itself within there, I know Bot.getClient() is the implicit parameter in return Bot.getClient().getPlane(); but the method name is getPlane() and they call it within itself and there's no lines before it or after so even if Bot.getClient() returned something, such as an integer, I don't see what it would do with it, since it calls itself. I confused myself looking at it. I'll let someone else translate it, I don't like the way RSBot dev's script. They do a lot of stupid needless things (not talking bout this method, just stuff I've seen looking through their code)

super_

2009-12-13 18:03:31

baked0420: getPlane() does as it says… it retrieves the current plane the player is on; there are 4… you may be more familiar with the term floor or level, analogous building terminology. pretty much they are 0 through 3. 0 is ground-level, 1 being up one set of stairs, 2 being up two set of stairs, and 3, up three set of stairs. now, you are wondering… what about dungeons? previously dungeons were in unused chunks of map, but during a recent update, (and by recent i mean since the dawn of 2009), they introduced the concept of underground map files in the cache (um<x>_<y> and ul<x>_<y>). to prove it, open up a decompiled client and grep for "um" +:

Class138_Sub26_Sub13.anIntArray5677[i1] = i2;
Class195.anIntArray2964[i1] = Class138_Sub6.aClass87_4089.method744("m" + j1 + "_" + k1, 0);
Class195.anIntArray2970[i1] = Class138_Sub6.aClass87_4089.method744("l" + j1 + "_" + k1, 0);
Class32.anIntArray492[i1] = Class138_Sub6.aClass87_4089.method744("n" + j1 + "_" + k1, 0);
Class49_Sub1.anIntArray3587[i1] = Class138_Sub6.aClass87_4089.method744("um" + j1 + "_" + k1, 0);
Class168.anIntArray2452[i1] = Class138_Sub6.aClass87_4089.method744("ul" + j1 + "_" + k1, 0);
from a deob from the past, however still conceptially valid. j1 and k1 are map chunk x,y coordinates. i2 is the map chunk hash, and i1 is the loaded map index set pointer. m is for map chunk terrain data, l is for object data, n is for default npc data (used for the login-screen background scene), and um and ul are the same as their counterparts m and l, respectively, however underground. Class138_Sub6.aClass87 is the cache file-system abstraction layer, which adds support for checksum validation and file names, used to give more power than the primitive, raw index-based systems of the old engine clients, instance used for cache 5, or the map cache. method744() hashes the file name using the following algorithm and then uses the hash to look-up the file index in a small, optimized hash table.

s = s.toLowerCase();
int r = 0;
for (int i = 0; i < s.length(); i++)
r = s.charAt(i) + ((r << 5) - r);
where s is the input string and r is the resultant hash. if you'd like any knowledge of the hash table, it's a statically sized, maximum 2:3 load factor ratio, open-addressed hash table of int keys and values.

Baked0420

2009-12-13 18:07:33

wow, thanks… I read like the first line so far, but I'll read the rest then see if I can translate what we need to be translated.

super_

2009-12-13 18:09:47

i majorly digressed in that post; it's too much information to swallow at once. you've already read the meaningful part.

Baked0420

2009-12-13 18:15:54

yea I noticed, I read the rest and it was mostly bout RuneScape's client and stuff. But thanks, I'll see if I can find in our includes a getPlane and all the rest of that stuff in the coding.

I had no clue you were knowledgeable in that stuff, all I've seen from you was a fight with YoHoJo. I feel like I actually have some respect towards you now, taking the time out to help. :)

You should be like this more often.

super_

2009-12-13 18:18:33

  BaseLayer = 'gn.n';

sounds like it might be the current plane/floor/level

Bobarkinator

2009-12-13 18:44:17

Yeah, BaseLayer is the plane.

Also, @Baked, where did you get that code? In the newest RSBot(for RS revision 575), GroundIntArray doesn't exist…I'm speculating that's old, pre-rt5 code. Although if it isn't I would be a whole lot happier.

super_

2009-12-13 18:59:33

From: Bobarkinator
Yeah, BaseLayer is the plane.

Also, @Baked, where did you get that code? In the newest RSBot(for RS revision 575), GroundIntArray doesn't exist…I'm speculating that's old, pre-rt5 code. Although if it isn't I would be a whole lot happier.


an unimplemented method won't result in a verification exception until there is an attempt to call it; most likely it isn't implemented anymore but the specification interface still contains it.

Bobarkinator

2009-12-13 19:02:15

From: super_
an unimplemented method won't result in a verification exception until there is an attempt to call it; most likely it isn't implemented anymore but the specification interface still contains it.


No it doesn't the Client interface doesn't contain GroundIntArray anymore

super_

2009-12-13 19:27:59

From: Bobarkinator
No it doesn't the Client interface doesn't contain GroundIntArray anymore


alrighty then; i fail to see how using an old revision of rsbot's specification interface would affect anything, though

Baked0420

2009-12-13 19:29:05


public static int tileHeight(final int X, final int Z) {
int p = Bot.getClient().getPlane();
final int x = X >> 7;
final int z = Z >> 7;

if (x < 0 || x > 104 || z < 0 || z > 104) {
return 0;
}

if (p < 3 && (Bot.getClient().getGroundByteArray()[1][x][z] & 2) != 0) {
p++;
}

final TileData[] dataArray = Bot.getClient().getTileData();

if (dataArray.length > p && dataArray[p] != null) {
return dataArray[p].getHeight(X, Z);
}
return 0;
}

// Calculations
public static Point tileToScreen(final int x, final int y, final double dX,
final double dY, final int height) {
return Calculations.worldToScreen((int) ((x
- Bot.getClient().getBaseX() + dX) * 128), (int) ((y
- Bot.getClient().getBaseY() + dY) * 128), height);
}

here, I forgot to update the RSBot file's, but I updated the jar… for some reason when I updated the jar from RSBot I thought it'd update the files too but it didn't. But here's it updated.

thanks for catching that.


EDIT: J_Pizzle told me on MSN he's working on it, so either he will Nava will probably have it converted, I realized I couldn't do it anyway since I don't have the updated hooks yet, and I don't feel like going to where J_Pizzle posted them, it's in java, so I would have to copy each individually and add it into my .scar file, and I think they've worked on the includes, so mine are outdated, so it wouldn't make sense to update TileToMS with outdated procedure/function's.

Bobarkinator

2009-12-13 21:11:30

From: super_
alrighty then; i fail to see how using an old revision of rsbot's specification interface would affect anything, though


It wouldn't, but the code he posted actually from the bot and was outdated.

Baked0420

2009-12-13 21:20:54

yea, I only had the rs.jar updated, the files didn't get updated, I thought they were, sorry, but the code I posted just above is the same methods but updated ;)

JPHamlett

2009-12-13 23:55:49

[QUOTE=Baked0420;665520
EDIT: J_Pizzle told me on MSN he's working on it, so either he will Nava will probably have it converted, I realized I couldn't do it anyway since I don't have the updated hooks yet, and I don't feel like going to where J_Pizzle posted them, it's in java, so I would have to copy each individually and add it into my .scar file, and I think they've worked on the includes, so mine are outdated, so it wouldn't make sense to update TileToMS with outdated procedure/function's.



I will try tomm but today i dint have much luck so if anyone wants to do it i ca supply all of the hooks that still exist in the client for you