SRL Archive - Senior Scripts and Snippets

Current Reflection.scar and Hooks.scar


Wizzup?

2008-01-17 16:35:22

Hooks:

Thanks, Ruroken:

//RS Build = #489
const

//Hooking RSString
StringBytes = 'X'; //byte[]*

// Hooking NPC
NPCIndexarray = 'o.P';//*
NPCArray = 'client.hb';//*
NPCDef = 'Ec';//*
NPCCount = 'gf.t';//*

//Hooking NPCDef
NPCActions = 'ib';//*
NPCsName = 'vb';//*

//Hooking PlayerDef
CharName = 'wc'; //StringWrap*

//Hooking Position
BaseX = 'ki.cb'; //int* (getBaseX)
MyPlayer = 'rf.B'; //Player* (getMyPlayer)
BaseY = 'eb.t'; //int* (getBaseY)

//Hooking Character
CharAnim = 'hc'; //int*
CharMotion = 'Eb'; //int*
CurrentX = 'sc'; //int*
CurrentY = 'Zb'; //int*

//Hooking Entity
CharHeight = 'Q';//*

//Hooking GroundInt
GroundHeights = 'ee.wb'; //int[][][] (groundIntArray)*

//Hooking GroundByteArray
GroundSettings = 'c.s'; //byte[][][] (groundByteArray)*

//Hooking Camera
BaseLayer = 'rc.F'; //int* (plane/terrainInt)
CamX = 'ga.B'; //int*
CamY = 'jh.h'; //int*
CamZ = 'qi.W'; //int*

//Hooking CameraCurves
CamPitch = 'sg.x'; //int* (CamCurveX)
CamYaw = 'sd.k'; //int* (CamCurveY)

//Hooking SettingArray
SettingsArray = 'ed.R'; //int[]*

//Hooking Skills
MaxLevels = 'client.fb'; //int[]* (getSkillLevelMaxes)
CurrentLevels = 'u.i'; //int[]* (getSkillLevels)
Experiances = 'bg.i'; //int[]* (getSkillExperiences)

//Hooking Minimap
MapOffsetAngle = 'oa.s'; //int* (MinimapInt2)
CompassAngle = 'oa.'; //int* (MinimapInt1)

Reflection:

{.include SRL\SRL\misc\Hooks.scar}

//Returns the current level of your player (its a funny array)
function GetLevel(index: integer): integer;
begin
result:= SmartGetFieldArrayInt(0,CurrentLevels,index);
end;

//Converts a byte[] from StringWrap to a DelphiString (max length 256)
function StringFromBytes(jbytearray: integer): string;
begin
SetLength(result, 256);
SetLength(result, SmartStringFromBytes(jbytearray,result));
end;

//Returns last logged in player's name
function GetMyName: string;
var
bytes: Integer;
begin
bytes:= SmartGetFieldObject(0,MyPlayer+'.'+CharName+'.'+StringBytes);
result:= StringFromBytes(bytes);
SmartFreeObject(bytes);
end;

//Returns your animation
function GetMyAnim: integer;
begin
result:= SmartGetFieldInt(0,MyPlayer+'.'+CharAnim);
end;

//True if you are moving
function GetMyMoving: boolean;
begin
result:= SmartGetFieldInt(0,MyPlayer+'.'+CharMotion) > 0;
end;

//Calculates your x,y position or [somehugenumber] if not logged in
procedure GetMyPos(var x, y: Integer);
var
me: Integer;
begin
me:= SmartGetFieldObject(0,MyPlayer);
x:= SmartGetFieldInt(0,BaseX) + SmartGetFieldInt(me,CurrentX) shr 7;
y:= SmartGetFieldInt(0,BaseY) + SmartGetFieldInt(me,CurrentY) shr 7;
SmartFreeObject(me);
end;

//Dumps the settings array to an integer array
function DumpSettingArray: array[0..1999] of integer;
var
i: integer;
begin
for i:= 0 to 1999 do
Result[i]:= SmartGetFieldArrayInt(0,SettingsArray,i);
end;

//Returns -1 if no box open or 0..2 for the correct answer to the box
function BoxAnswer: integer;
var
boxIndex: Integer;
begin
boxIndex:= SmartGetFieldArrayInt(0,SettingsArray,312);
if boxIndex = 0 then
result:= -1
else
result:= (boxIndex shr 24) and $FF;
end;

//Returns the current Map angle in degrees
function GetMinimapAngleDeg: extended;
var
clientAngle: integer;
begin
clientAngle:= (SmartGetFieldInt(0,CompassAngle) + SmartGetFieldInt(0,MapOffsetAngle)) mod 2048;
result:= clientAngle * 180 / 1024;
end;

//Returns the current map angle in radians
function GetMinimapAngleRad: extended;
var
clientAngle: integer;
begin
clientAngle:= (SmartGetFieldInt(0,CompassAngle) + SmartGetFieldInt(0,MapOffsetAngle)) mod 2048;
result:= clientAngle * Pi / 1024;
end;

//converts the tile position tileX,tileY to a minimap location
procedure TileToMinimap(tileX, tileY: integer; var screenX, screenY: integer);
var
angle: extended;
tempX, tempY: integer;
begin
angle:= getMinimapAngleRad;
GetMyPos(tempX, tempY);
tempX:= (tileX - tempX) * 4 - 2;
tempY:= (tempY - tileY) * 4 - 2;
screenX:= round(tempX*cos(angle) - tempY*sin(angle)) + 627;
screenY:= round(tempX*sin(angle) + tempY*cos(angle)) + 85;
end;

//converts the screen position screenX,screenY from the minimap to a tile
procedure MinimapToTile(screenX, screenY: integer; var tileX, tileY: integer);
var
angle: extended;
tempX, tempY: integer;
begin
angle:= getMinimapAngleRad;
tempX:= (screenX - 627);
tempY:= (95 - screenY);
tileX:= round(tempX*cos(angle) - tempY*sin(angle)) / 4;
tileY:= round(tempX*sin(angle) + tempY*cos(angle)) / 4;
GetMyPos(tempX, tempY);
tileX:= tileX + tempX;
tileY:= tileY + tempY;
end;

//converts the tile position tileX,tileY to a mainscreen location
//height is the distance (in px) off the ground
procedure TileToWorld(tileX, tileY, height: integer; var screenX, screenY: integer);
var
cx, cy, cz, dx, dy, dz, locX, locY, layer: Integer;
pitch, yaw, sinYaw, cosYaw, sinPitch, cosPitch, rotation: extended;
begin
locX:= tileX - SmartGetFieldInt(0,BaseX);
locY:= tileY - SmartGetFieldInt(0,BaseY);
if (locX < 0) or (locY < 0) or (locX > 103) or (locY > 103) then
Exit;
layer:= SmartGetFieldInt(0,BaseLayer);
if (layer < 3) and ((2 and SmartGetFieldArray3DByte(0,GroundSettings,1,locX,locY)) = 2) then
Inc(layer);
cz:= SmartGetFieldArray3DInt(0,GroundHeights,layer,locX,locY) +
SmartGetFieldArray3DInt(0,GroundHeights,layer,locX+1,locY) +
SmartGetFieldArray3DInt(0,GroundHeights,layer,locX,locY+1) +
SmartGetFieldArray3DInt(0,GroundHeights,layer,locX+1,locY+1);
cx:= locX * 128 + 64 - SmartGetFieldInt(0,CamX);
cy:= locY * 128 + 64 - SmartGetFieldInt(0,CamY);
cz:= (cz / 4) - height - SmartGetFieldInt(0,CamZ);
pitch:= SmartGetFieldInt(0,CamPitch) * Pi / 1024;
yaw:= SmartGetFieldInt(0,CamYaw) * Pi / 1024;
sinYaw:= sin(yaw);
cosYaw:= cos(yaw);
sinPitch:= sin(pitch);
cosPitch:= cos(pitch);
rotation:= cosYaw*cy-sinYaw*cx;
dx:= Round(sinYaw*cy+cosYaw*cx);
dy:= Round(sinPitch*cz+cosPitch*rotation);
dz:= Round(cosPitch*cz-sinPitch*rotation);
screenX:= (dx * 512) / dy + 256;
screenY:= (dz * 512) / dy + 167;
end;

Smartzkid

2008-01-17 17:25:43

Many thanks for posting this, will help keep us together.

Bobarkinator

2008-01-17 18:49:09

Thanks, I think I am going to create an autofighter using reflection.

Yakman

2008-01-18 06:11:29

put a constant which is the client build version

const
Version = 484;

also Camera Pitch and Yaw are reversed,
Yaw is what changes when you press left/right and Pitch is when you press up/down
but in these names, they are reversed, you'd have to swap them in the calculating in the main screen, or TileToWorld.

and please dont call them "hooks" :)

Ruroken

2008-01-18 19:28:17

"hooks" is bad because? :p

The Claw

2008-01-18 19:32:20

it makes us sound like we're going fishing

Smartzkid

2008-01-18 19:38:52

I can see it now…'SSRL: SRL's Master Fishers' :D

Correct term is field, I believe. Farming > Fishing?

EDIT: Hunting > Farming + Fishing

Ruroken

2008-01-18 20:42:00

From: Smartzkid
I can see it now…'SSRL: SRL's Master Fishers' :D

Correct term is field, I believe. Farming > Fishing?


"Hooks" sounds cooler :p

And I've done both. Farming is not as much fun as fishing….though they both do take patience…

Markus

2008-01-19 04:15:58

A hook is an edit in the client. A field is a variable. So fields is the correct term.

Special Ed

2008-01-20 11:26:23

For the TileToWorld… Can someone help me whip up something that will tell you the "edges" of the square rather than the center. I don't mean the rough edges either… I mean the exact place where the corners of the tiles are. I'm assuming it's possible since you know the variables of the ground so… yea… If someone could give me a hand that would be awesome.

EDIT: Nvm… I was looking at this the wrong way the entire time.

Bobarkinator

2008-01-20 15:32:54

Quick question, is this updated for #484?

Wizzup?

2008-01-20 16:08:24

Yes. I am running my scripts as I am typing.

Yakman

2008-01-23 03:41:13

From: Ruroken
"hooks" is bad because? :p


well, hooks is very ambiguous, it has about 4 or 5 different meanings, here some of them.
1. A method that starts with getXXX, such as getMyPlayer(), getSettingsArray(), and is used for getting information from the client.
2. A name of a field, such as 'fg.yu', 'ui.sd', 'iu.cv'.
3. A pattern for finding a field, such as "look for a SIPUSH #1000 PUTSTATIC and it will show you where GameState is".
4. Where you place a procedure call in the client, such as "onServerMessage" so when that happens in the client, your script is also notified.

as I see it hooks has no real meaning,
whenever someone uses that word, I just see it as they are doing something to do with the client… probably… :p

I think the only reason this word survives is because it makes you sound really hacker, like "yo bruv I just hooked the CIA database!"
as Ruroken says, it makes you sound cooler :)

(but in my humble opinion, thats not a good enough reason to use the word)

there used to be another word used similar to "hooks", it was "hijack", and I'm quite glad its been largely forgotten :)

Special Ed: those tiles are considered to be 128x128 pixels, so if you have the x,y of the center, take away or add 64.
(take away/add first, then put it in the TileToWorld function)

Wizzup?

2008-02-12 15:56:28

I updated the 'you-know-what'.

Ruroken

2008-02-12 21:59:17

'the you-know-what'!

Thanks Wizzy! :D

Wizzup?

2008-02-13 04:34:59

It stopped working for me again. Can anyone confirm that?
EDIT: It works again. Nevermind.

Markus

2008-02-13 06:21:13

Compassangle is wrong, should be dh.f

XcanadamanX

2008-02-13 07:54:52

i tried it yesterday but i would click a totally different tile than i told it to:confused:

Wizzup?

2008-02-13 09:59:37

I think the new rs update requires another hooks update.

From: XcanadamanX
i tried it yesterday but i would click a totally different tile than i told it to:confused:


What script?

XcanadamanX

2008-02-13 14:59:31

no ones. it was me just fooling around. and i used your walktile procedure.

Wizzup?

2008-02-13 15:16:45

From: XcanadamanX
no ones. it was me just fooling around. and i used your walktile procedure.


OK. Well before the update I ran my script and it worked. ;)
I'll update hooks.scar later… Or you update it if you want… :p

XcanadamanX

2008-02-13 15:25:26

i have to go to work so no time for me to update.;)

Ruroken

2008-02-13 22:08:42

How would one go about updating the hooks?

Bobarkinator

2008-02-13 22:13:14

You can grab them off of MITB or write your own updater.

Ruroken

2008-02-15 15:42:48

Updated Hooks! :)

//RS Build = #487
const
//Global Static Hooks
SettingsArray = 'lh.a'; //int[]
CurrentLevels = 'qg.Z'; //int[]
MaxLevels = 'nd.i'; //int[]
Experiances = 'sb.f'; //int[]
BaseX = 'sb.j'; //int
BaseY = 'gg.R'; //int
MyPlayer = 'ha.p'; //Player
CompassAngle = 'ja.'; //int (MinimapInt1)
MapOffsetAngle = 'aa.ob'; //int (MinimapInt2)
BaseLayer = 'se.v'; //int (plane/terrainInt)
GroundSettings = 'di.tb'; //byte[][][] (groundByteArray)
GroundHeights = 'wa.b'; //int[][][] (groundIntArray)
CamX = 'ce.tb'; //int
CamY = 'ag.h'; //int
CamZ = 'f.L'; //int
CamPitch = 'fd.j'; //int (CamCurveX)
CamYaw = 'm.e'; //int (CamCurveY)

//Character Hooks
CurrentX = 'hc'; //int
CurrentY = 'tc'; //int
CharAnim = 'fb'; //int
CharMotion = 'Rb'; //int
CharName = 'yc'; //StringWrap

//StringWrap Hooks
StringBytes = 'y'; //byte[]

I tested this pretty throughly so there shouldn't be anything wrong with it. But if you do find anything, give me a shout.

the scar noob

2008-02-15 15:45:45

From: Ruroken
Updated Hooks! :)

//RS Build = #487
const
//Global Static Hooks
SettingsArray = 'lh.a'; //int[]
CurrentLevels = 'qg.Z'; //int[]
MaxLevels = 'nd.i'; //int[]
Experiances = 'sb.f'; //int[]
BaseX = 'sb.j'; //int
BaseY = 'gg.R'; //int
MyPlayer = 'ha.p'; //Player
CompassAngle = 'ja.'; //int (MinimapInt1)
MapOffsetAngle = 'aa.ob'; //int (MinimapInt2)
BaseLayer = 'se.v'; //int (plane/terrainInt)
GroundSettings = 'di.tb'; //byte[][][] (groundByteArray)
GroundHeights = 'wa.b'; //int[][][] (groundIntArray)
CamX = 'ce.tb'; //int
CamY = 'ag.h'; //int
CamZ = 'f.L'; //int
CamPitch = 'fd.j'; //int (CamCurveX)
CamYaw = 'm.e'; //int (CamCurveY)

//Character Hooks
CurrentX = 'hc'; //int
CurrentY = 'tc'; //int
CharAnim = 'fb'; //int
CharMotion = 'Rb'; //int
CharName = 'yc'; //StringWrap

//StringWrap Hooks
StringBytes = 'y'; //byte[]

I tested this pretty throughly so there shouldn't be anything wrong with it. But if you do find anything, give me a shout.


Thank you for updating them!:)
Will try them out as soon as i can compile verything without getting erros -_-

-Tsn.

Ruroken

2008-02-15 15:59:23

Oh and Ben, I'm going to bug you sometime on MSN to teach me a bit about writing reflection for SMART. :p I want to try some stuff that isn't in reflection.scar yet.

Smartzkid

2008-02-15 20:50:28

TileToWorld working?

Ruroken, you should read Yak's BCEL tut on MITB. Very informative.

Markus

2008-02-16 08:22:10

TileToWorld doesn't work…

Ruroken

2008-02-16 13:03:10

I'll see if its the hooks…

the scar noob

2008-02-16 15:35:16

From: Smartzkid
TileToWorld working?

Ruroken, you should read Yak's BCEL tut on MITB. Very informative.


Ok, what's MITB?..

Thanks in advance,

-Tsn.

Wizzup?

2008-02-16 16:52:45

From: the scar noob
Ok, what's MITB?..

Thanks in advance,

-Tsn.


MoparIsTheBest

Ruroken

2008-02-16 19:42:08

Do you want hooks with fixed TileToWorld?

I thought so…here they are!

//RS Build = #487
const
//Global Static Hooks
SettingsArray = 'lh.a'; //int[]
CurrentLevels = 'qg.Z'; //int[]
MaxLevels = 'nd.i'; //int[]
Experiances = 'sb.f'; //int[]
BaseX = 'sb.j'; //int
BaseY = 'gg.R'; //int
MyPlayer = 'ha.p'; //Player
CompassAngle = 'ja.'; //int (MinimapInt1)
MapOffsetAngle = 'aa.ob'; //int (MinimapInt2)
BaseLayer = 'se.b'; //int (plane/terrainInt)
GroundSettings = 'di.tb'; //byte[][][] (groundByteArray)
GroundHeights = 'wa.b'; //int[][][] (groundIntArray)
CamX = 'ce.tb'; //int
CamY = 'ag.h'; //int
CamZ = 'f.L'; //int
CamYaw = 'fd.j'; //int (CamCurveY)
CamPitch = 'm.e'; //int (CamCurveX)

//Character Hooks
CurrentX = 'hc'; //int
CurrentY = 'tc'; //int
CharAnim = 'fb'; //int
CharMotion = 'Rb'; //int
CharName = 'yc'; //StringWrap

//StringWrap Hooks
StringBytes = 'y'; //byte[]

Wizzup?

2008-02-16 19:47:34

From: Ruroken
Do you want hooks with fixed TileToWorld?

I thought so…here they are!

//RS Build = #487
const
//Global Static Hooks
SettingsArray = 'lh.a'; //int[]
CurrentLevels = 'qg.Z'; //int[]
MaxLevels = 'nd.i'; //int[]
Experiances = 'sb.f'; //int[]
BaseX = 'sb.j'; //int
BaseY = 'gg.R'; //int
MyPlayer = 'ha.p'; //Player
CompassAngle = 'ja.'; //int (MinimapInt1)
MapOffsetAngle = 'aa.ob'; //int (MinimapInt2)
BaseLayer = 'se.b'; //int (plane/terrainInt)
GroundSettings = 'di.tb'; //byte[][][] (groundByteArray)
GroundHeights = 'wa.b'; //int[][][] (groundIntArray)
CamX = 'ce.tb'; //int
CamY = 'ag.h'; //int
CamZ = 'f.L'; //int
CamYaw = 'fd.j'; //int (CamCurveY)
CamPitch = 'm.e'; //int (CamCurveX)

//Character Hooks
CurrentX = 'hc'; //int
CurrentY = 'tc'; //int
CharAnim = 'fb'; //int
CharMotion = 'Rb'; //int
CharName = 'yc'; //StringWrap

//StringWrap Hooks
StringBytes = 'y'; //byte[]


Added to the first post. Where the Yaw and Pitch inverted after all?

Ruroken

2008-02-16 19:57:47

I think just the words are :p

Ben must have cave the meanings confused. He thinks Yaw = Pitch adn Pitch = Yaw…if that makes any sense, but the math is right.

Wizzup?

2008-02-17 07:09:53

From: Ruroken
I think just the words are :p

Ben must have cave the meanings confused. He thinks Yaw = Pitch adn Pitch = Yaw…if that makes any sense, but the math is right.


Thats what I meant. :)

Smartzkid

2008-02-17 17:27:15

Woot! At an airport atm, but as soon as I'm home, Ill post my reflection-object finder (if markus doesn't beat me to it). Smartzkid is very happy.

Sp0rky

2008-02-17 17:29:39

From: Smartzkid
Woot! At an airport atm, but as soon as I'm home, Ill post my reflection-object finder (if markus doesn't beat me to it). Smartzkid is very happy.


Oww sexy, can't wait ^_^

Bobarkinator

2008-02-17 22:42:45

Types and UIDs? If so then you beat me to it, I was halfway done with it. If not then I'll still continue on them.

Smartzkid

2008-02-18 12:53:51

Nah, keep working, I still have some tweaking to do. Rewriting everything, lost the old one due to a reformat (not really, turned old computer in for a different one; same diff)

Ruroken

2008-02-18 14:01:22

:O

I cant wait. Smartzkid, got MSN?

Smartzkid

2008-02-18 16:40:38

Yup. [email]smartz.kid@hotmail.com[/email]

Markus is goin' pretty good, too

Ruroken

2008-02-18 16:54:50

:( I need to learn that fancy java kinda stuff

Sp0rky

2008-02-27 00:08:34

They still working?

I think the update screwed them.

Smartzkid

2008-02-27 15:48:58

http://www.moparisthebest.com:96/smf/index.php/topic,246129.0.html

Ruroken

2008-02-28 18:06:36

Heres build #488

NOTE : UNTESTED! Please post any problems.

//RS Build = #488
const
//Global Static Hooks
SettingsArray = 'rd.E'; //int[]*
CurrentLevels = 'bd.bb'; //int[]*
MaxLevels = 'kb.W'; //int[]*
Experiances = 'oa.d'; //int[]*
BaseX = 'lh.E'; //int*
BaseY = 'wd.m'; //int*
MyPlayer = 'bd.W'; //Player*
CompassAngle = 'sb.'; //int (MinimapInt1)*
MapOffsetAngle = 'ah.X'; //int (MinimapInt2)*
BaseLayer = 'ia.i'; //int (plane/terrainInt)*
GroundSettings = 'fh.r'; //byte[][][] (groundByteArray)*
GroundHeights = 'n.t'; //int[][][] (groundIntArray)*
CamX = 'ng.j'; //int*
CamY = 'ph.X'; //int*
CamZ = 'mh.r'; //int*
CamYaw = 'bg.c'; //int (CamCurveY)*
CamPitch = 'ac.nc'; //int (CamCurveX)*

//Character Hooks
CurrentX = 'Rb'; //int*
CurrentY = 'fb'; //int*
CharAnim = 'mb'; //int*
CharMotion = 'Gb'; //int*
CharName = 'Rc'; //StringWrap*
CharHeight = 'D';*

//StringWrap Hooks
StringBytes = 'U'; //byte[]*

//NPC Fields
NPCCount = 'jh.C';//*
NPCIndexarray = 'dh.N';//*
NPCArray = 'l.ab';//*
NPCsName = 'eb';//*
NPCDef = 'uc';//*
NPCActions = 'G';//*

n3ss3s

2008-02-29 10:09:41

*Kindergarten*

So if I use that, the voodoo stuff starts working again?


EDIT: Okay, I might have done something wrong, but GetMyPos returns always the same - 33554430

Ruroken

2008-02-29 16:04:31

Can anyone else confirm GetMyPos isnt working?

n3ss3s

2008-02-29 16:06:32

Also, there propably are several ways to get the tiles etc, but I remember than in KYAB, the tiles were like (3142, 3028) and so, not 8 digit numbers :confused:

Markus

2008-02-29 16:21:46

From: n3ss3s
Also, there propably are several ways to get the tiles etc, but I remember than in KYAB, the tiles were like (3142, 3028) and so, not 8 digit numbers :confused:


That means Ruroken's hook are wrong. Tiles in KYAB should be the same as in v2.

The Claw

2008-02-29 19:01:53

Doesnt mean theyre wrong…dont you have to do something to transform the raw data into the numbers we use to represent the tiles? shr, or shl or something.

Wizzup?

2008-02-29 19:10:24

From: The Claw
Doesnt mean theyre wrong…dont you have to do something to transform the raw data into the numbers we use to represent the tiles? shr, or shl or something.


They are wrong. If you fill in the wrong 'hooks', you will get very big numbers.

Bobarkinator

2008-02-29 19:20:16

Sometimes however Jagex puts false positives in their code that will trigger the updater, but the hook really returns wrong numbers. So people will need to rewrite their updaters.

Smartzkid

2008-02-29 22:47:50

Leech KYAB's hooks and see if there's any differences. If I'm on tomorrow, I'll do it, out of time atm.

Bobarkinator

2008-02-29 23:13:59

From: Smartzkid
Leech KYAB's hooks and see if there's any differences. If I'm on tomorrow, I'll do it, out of time atm.


Except KYAB doesn't have the current vars ;) Lol. Somebody just posted some vars so I can test them.

Wizzup?

2008-03-01 06:29:27

From: Bobarkinator
Except KYAB doesn't have the current vars ;) Lol. Somebody just posted some vars so I can test them.


ollie's vars always work for me.

n3ss3s

2008-03-01 07:14:03

So… mind putting Ollie's vars to Hooks.scar? :S

Smartzkid

2008-03-01 13:48:17

Here's Ollies output if someone wants to SCAR-ify if. Heh, should make a script to automatically parse it… :p

Loading runescape.jar (which is application/octet-stream:538828 bytes)…
Successfully loaded runescape.jar:538828 bytes.
loading transforms…
com.genesis.updater.deobfuscator.ShiftCorrector
com.genesis.updater.deobfuscator.NOTRemover
com.genesis.updater.transformer.Client
Version: 488
getGameState() -> static field "qa.int L"
com.genesis.updater.transformer.Camera
getCameraAngleY() -> static field "bg.int c"
getCameraAngleX() -> static field "ac.int nc"
getCameraZ() -> static field "mh.int r"
getTerrainSpecial() -> static field "fh.byte[][][] r"
getGroundLevel() -> static field "ia.int i"
getCameraX() -> static field "ng.int j"
getCameraY() -> static field "ph.int X"
com.genesis.updater.transformer.Terrain
getTerrain() -> static field "n.int[][][] t"
com.genesis.updater.transformer.MutableString
getHash() -> field "jd.int v"
isMutable() -> field "jd.boolean y"
getLength() -> field "jd.int C"
getBytes() -> field "jd.byte[] U"
com.genesis.updater.transformer.UsernamePassword
getPassword() -> static field "ab.jd b"
getUsername() -> static field "ab.jd n"
isFlagged() -> static field "lh.boolean A"
com.genesis.updater.transformer.Npc
getNpcIndices() -> static field "dh.int[] N"
getNpcArray() -> static field "l.nd[] ab"
getDefinition() -> field "nd.ji uc"
getActions() -> field "ji.jd[] G"
getName() -> field "ji.jd eb"
getCombatLevel() -> field "ji.int ub"
com.genesis.updater.transformer.Player
getPlayerIndices() -> static field "ub.int[] Ob"
getPlayerArray() -> static field "sb.jc[] q"
getModel() -> field "jc.dg Mc"
getName() -> field "jc.jd Rc"
getPkHeadIcon() -> field "jc.int Jc"
getPrayerHeadIcon() -> field "jc.int tc"
getTeam() -> field "jc.int Nc"
getCombatLevel() -> field "jc.int Ic"
com.genesis.updater.transformer.Position
getBaseX() -> static field "lh.int E"
getWalkingQueueX() -> field "ac.int[] Eb"
getBaseY() -> static field "wd.int m"
getWalkingQueueY() -> field "ac.int[] V"
getLocalPlayer() -> static field "bd.jc W"
com.genesis.updater.transformer.Mobile
getMessage() -> field "ac.jd ub"
getAnimation() -> field "ac.int mb"
getMovement() -> field "ac.int ib"
getX() -> field "ac.int Rb"
getY() -> field "ac.int fb"
com.genesis.updater.transformer.Entity
getHeight() -> field "tg.short D"
com.genesis.updater.transformer.ChildNode
getNext() -> field "n.n u"
getPrev() -> field "n.n x"
com.genesis.updater.transformer.Node
getCurrent() -> field "wd.long o"
getNext() -> field "wd.wd n"
getPrev() -> field "wd.wd g"
com.genesis.updater.transformer.Item
getStackSize() -> field "ii.int P"
getID() -> field "ii.int V"
com.genesis.updater.transformer.Mouse
getMouseX() -> static field "l.int z"
getMouseY() -> static field "m.int x"
com.genesis.updater.transformer.Menu
getMenuActionRow() -> static field "ab.int o"
isMenuOpen() -> static field "hb.boolean T"
getMenuX() -> static field "ai.int U"
getMenuY() -> static field "re.int f"
getMenuOptions() -> static field "ua.jd[] z"
getMenuActions() -> static field "jd.jd[] f"
com.genesis.updater.transformer.Minimap
getCompassScale() -> static field "nb.int d"
getCompassAngleOffset() -> static field "ah.int X"
getCompassAngle() -> static field "sb.int h"
getGroundNodeList() -> static field "ob.bg[][][] fb"
getHead() -> field "bg.wd p"
getCurrent() -> field "bg.wd v"
com.genesis.updater.transformer.Objects
getTiles() -> static field "d.eb[][][] d"
getBuffer2() -> field "eb.od y"
getUID() -> field "od.long a"
getTileAbove() -> field "eb.eb H"
getBuffer1() -> field "eb.eg I"
getUID() -> field "eg.long C"
getModelBuffer() -> field "eb.tf[] L"
getUID() -> field "eb.long j"
getBuffer3() -> field "eb.cg O"
getUID() -> field "cg.long r"
getItemBuffer() -> field "eb.pd S"
getUID() -> field "pd.long c"
getOriginalLevel() -> field "eb.int D"
getLevel() -> field "eb.int z"
getX() -> field "eb.int K"
getY() -> field "eb.int C"
com.genesis.updater.transformer.Interface
getInterfaces() -> static field "fi.a[][] ib"
getValueIndexArray() -> field "a.int[][] Q"
getCache() -> field "a.a[] cb"
getMediaType() -> field "a.int q"
getMediaID() -> field "a.int Sb"
getUnselectedMediaType() -> field "a.int X"
getUnselectedMediaID() -> field "a.int Ac"
getItems() -> field "a.int[] Cc"
getStacksizes() -> field "a.int[] hb"
getType() -> field "a.int j"
getActionType() -> field "a.int L"
getX() -> field "a.int Ab"
getParentX() -> field "a.int N"
getY() -> field "a.int k"
getParentY() -> field "a.int nc"
getWidth() -> field "a.int Rb"
getHeight() -> field "a.int B"
getID() -> field "a.int J"
getChildrenX() -> field "a.int[] Hb"
getChildrenY() -> field "a.int[] ic"
getScrollMax() -> field "a.int ub"
getActions() -> field "a.jd[] lc"
isInventoryInterface() -> field "a.boolean Xb"
getMessage() -> field "a.jd i"
getTitle() -> field "a.jd Db"
getTextColor() -> field "a.int h"
getMovableObject2() -> field "a.int d"
getMovableObject1() -> field "a.int Cb"
getMovableObjectBlockX() -> field "a.int ib"
getMovableObjectBlockY() -> field "a.int T"
getSelectedAction() -> field "a.jd y"
getSpellName() -> field "a.jd fb"
getTooltip() -> field "a.jd ob"
com.genesis.updater.transformer.SettingArray
getSettingArray() -> static field "rd.int[] E"
com.genesis.updater.transformer.SkillArray
getSkillExperiencesMax() -> static field "gh.int[] Pb"
getSkillLevelsMax() -> static field "kb.int[] W"
getSkillLevels() -> static field "bd.int[] bb"
getSkillExperiences() -> static field "oa.int[] d"
finished 22 transformations inserting 116 accessor methods (with no errors)

n3ss3s

2008-03-01 14:35:02

Scarnized:


//RS Build = #488
const
//Global Static Hooks
SettingsArray = 'rd.E'; //int[]*
CurrentLevels = 'bd.bb'; //int[]*
MaxLevels = 'kb.W'; //int[]*
Experiances = 'oa.d'; //int[]*
BaseX = 'lh.E'; //int*
BaseY = 'wd.m'; //int*
MyPlayer = ''; //Player*
CompassAngle = 'sb.h'; //int (MinimapInt1)*
MapOffsetAngle = 'ah.X'; //int (MinimapInt2)*
BaseLayer = 'ia.i'; //int (plane/terrainInt)*
GroundSettings = 'fh.r'; //byte[][][] (groundByteArray)*
GroundHeights = 'n.t'; //int[][][] (groundIntArray)*
CamX = 'ng.j'; //int*
CamY = 'ph.X'; //int*
CamZ = 'mh.r'; //int*
CamYaw = 'bg.c'; //int (CamCurveY)*
CamPitch = 'ac.nc'; //int (CamCurveX)*

//Character Hooks
CurrentX = 'ac.Rb'; //int*
CurrentY = 'ac.fb'; //int*
CharAnim = 'ac.mb'; //int*
CharMotion = 'ac.ib'; //int*
CharName = 'jc.jd Rc'; //StringWrap*
CharHeight = 'tg.D';

//StringWrap Hooks
StringBytes = 'jd.U'; //byte[]*

//NPC Fields
NPCCount = 'jh.C';//*
NPCIndexarray = 'dh.N';//*
NPCArray = 'i.nd ab';//*
NPCsName = 'ji.jd eb';//*
NPCDef = 'nd.ji uc';//*
NPCActions = 'ji.jd G';//*


Rurrie had forgotten parts of the hooxies :)



EDIT: Umm… The reason the X and Y didn't yesterday work for me… Propably was that I wasn't using SMART :p


Aww, still doesn't work. Now the both ints from GetMyPos weren't the same though, but I made it first do GetMyPos, then click MMCX + 20, MMCY - 50, then do TileToMinimap and it clicked to MMCX, MMCY :S

Wizzup?

2008-03-01 16:50:17

GetMyPos does not work, I can confirm that. I used your hooks.scar.

n3ss3s

2008-03-02 11:04:23

KYAB Updater gave these:

Animation: na.Mb
Motion: na.mc
PlayerX: hb.k.pb
PlayerY: hb.k.lb
BaseX: sg.e
BaseY: ja.p


I don't know are those updated or outdated, I'll go test now.


Beh, am I possibly doing something wrong?

With those hooks too it returns long numbers :(

Ruroken

2008-03-17 03:02:49

Ta Da!

Fixed hooks for #489.

I also reorganized the hooks so now they are in order for Quarter's updater (easer updating from that output).

//RS Build = #489
const

//Hooking RSString
StringBytes = 'X'; //byte[]*

// Hooking NPC
NPCIndexarray = 'o.P';//*
NPCArray = 'client.hb';//*
NPCDef = 'Ec';//*
NPCCount = 'gf.t';//*

//Hooking NPCDef
NPCActions = 'ib';//*
NPCsName = 'vb';//*

//Hooking PlayerDef
CharName = 'wc'; //StringWrap*

//Hooking Position
BaseX = 'ki.cb'; //int* (getBaseX)
MyPlayer = 'rf.B'; //Player* (getMyPlayer)
BaseY = 'eb.t'; //int* (getBaseY)

//Hooking Character
CharAnim = 'hc'; //int*
CharMotion = 'Eb'; //int*
CurrentX = 'sc'; //int*
CurrentY = 'Zb'; //int*

//Hooking Entity
CharHeight = 'Q';//*

//Hooking GroundInt
GroundHeights = 'ee.wb'; //int[][][] (groundIntArray)*

//Hooking GroundByteArray
GroundSettings = 'c.s'; //byte[][][] (groundByteArray)*

//Hooking Camera
BaseLayer = 'rc.F'; //int* (plane/terrainInt)
CamX = 'ga.B'; //int*
CamY = 'jh.h'; //int*
CamZ = 'qi.W'; //int*

//Hooking CameraCurves
CamPitch = 'sg.x'; //int* (CamCurveX)
CamYaw = 'sd.k'; //int* (CamCurveY)

//Hooking SettingArray
SettingsArray = 'ed.R'; //int[]*

//Hooking Skills
MaxLevels = 'client.fb'; //int[]* (getSkillLevelMaxes)
CurrentLevels = 'u.i'; //int[]* (getSkillLevels)
Experiances = 'bg.i'; //int[]* (getSkillExperiences)

//Hooking Minimap
MapOffsetAngle = 'oa.s'; //int* (MinimapInt2)
CompassAngle = 'oa.'; //int* (MinimapInt1)

Wizzup?

2008-03-17 08:31:44

Great. Added.
Now I can craft laws again. ;)

n3ss3s

2008-03-17 10:30:49

Reppie for Rurrie :p

I'm not a pro in this area, but are you sure charanim and those dont need to be like the others,
ki.cb
like that? Thanks.

Bobarkinator

2008-03-17 10:36:31

Some of them only have 1 letter hooks or so. The first letter/s is/are the class file from the runescape .jar. The second set is the field of what we want to reflect.

Ruroken

2008-03-18 05:50:00

From: Bobarkinator
Some of them only have 1 letter hooks or so. The first letter/s is/are the class file from the runescape .jar. The second set is the field of what we want to reflect.


That one took me a while to figure out as well :p

n3ss3s

2008-03-22 07:00:18

If anyone has got a working updater, could the hooks be updated?

I can update them if someone gives me an output - only one I found at mopar was one that didn't have any of the compass things, height etc…

Ruroken

2008-03-24 21:33:38

Well my SCAR keeps crashing so none of these are tested but…

Heres #490

//RS Build = #490
const

//Hooking RSString
StringBytes = 'r'; //byte[]

// Hooking NPC
NPCIndexarray = 'ud.Xb';//
NPCArray = 'ai.M';//
NPCDef = 'nb.pc';//
NPCCount = 'tf.n';//

//Hooking NPCDef
NPCActions = 'H';//
NPCsName = 'W';//

//Hooking PlayerDef
CharName = 'Ic'; //StringWrap

//Hooking Position
MyPlayer = 'le.T'; //Player (getMyPlayer)
BaseX = 'ic.N'; //int (getBaseX)
BaseY = 'ic.H'; //int (getBaseY)

//Hooking Character
CharAnim = 'mb'; //int
CharMotion = 'T'; //int
CurrentX = 'Yb'; //int
CurrentY = 'pb'; //int

//Hooking Entity
CharHeight = 'hb';//

//Hooking GroundInt
GroundHeights = 'd.D'; //int[][][] (groundIntArray)

//Hooking GroundByteArray
GroundSettings = 'qe.r'; //byte[][][] (groundByteArray)

//Hooking Camera
BaseLayer = 'gf.G'; //int (plane/terrainInt)
CamX = 'ri.b'; //int
CamY = 'se.d'; //int
CamZ = 'tb.b'; //int

//Hooking CameraCurves
CamPitch = 'rf.x'; //int (CamCurveX)
CamYaw = 'bh.l'; //int (CamCurveY)

//Hooking SettingArray
SettingsArray = 'sa.c'; //int[]

//Hooking Skills
MaxLevels = 'gh.mb'; //int[] (getSkillLevelMaxes)
CurrentLevels = 'de.r'; //int[] (getSkillLevels)
Experiances = 'dg.Dc'; //int[] (getSkillExperiences)

//Hooking Minimap
MapOffsetAngle = 've.l'; //int (MinimapInt2)
CompassAngle = 'jg.'; //int (MinimapInt1)

n3ss3s

2008-03-25 08:54:40


Quote from the Japanese dude who sang only one sentence repeatedly to Simon:

I aam your broother, your best friend foreeever!


I'll go and test, I do feel safer to run Wizzup's AirCrafter with hooksies than one from the Jr section ;)


EDIT: They work!

EDIT EDIT: Does anyone know of some hook like… "Walkable"? Like Tile.Walkable, would be false if there is a river or a rock on that spot etc?

Yakman

2008-03-25 12:57:42

From: n3ss3s
EDIT EDIT: Does anyone know of some hook like… "Walkable"? Like Tile.Walkable, would be false if there is a river or a rock on that spot etc?


theres those two 3-Dimentional arrays sometimes called intGroundArray and byteGroundArray,
you access them like [plane][x][y] i think, where plane is your current plane above ground (it changes when you go up-down ladders)
i know the values in that can tell you what type of terrain is there, and there would be a type meaning water or something where you cant walk
a problem might be with how smart handles 3-dimentional arrays, i remember mentioning it to Ruroken once, and i dont think its that good, cause there is a very useful 3D array where you can find rocks, trees and bank booths, and no-one seems to be using it

n3ss3s

2008-03-25 13:21:09

Ooh, could you tell more about these useful 3D arrays? :)

Markus

2008-03-25 14:03:47

From: Yakman
a problem might be with how smart handles 3-dimentional arrays, i remember mentioning it to Ruroken once, and i dont think its that good, cause there is a very useful 3D array where you can find rocks, trees and bank booths, and no-one seems to be using it


Maybe because noone knows how to use it? ;)

Yakman

2008-03-26 08:28:34

yeah ok, ill tell you about the java side, you'll have to convert it into smart equivalents
its also useful if you know the difference between static fields and instance fields

btw, whenever i say, "there is a field called…", its just the name we give it, noone knows the real names jagex use
there is a static field in the client called groundArray, its elements are of type Ground, its is a 3D array,

Ground[][][] groundArray;

it is organised where you access them like this [plane][x][y], where x,y are between 104x104, the elements change when you go past a loading screen
you can get your current plane with a field called "plane" or "rsplane", or "currentPlane" or something

when you have your Ground instance, it has 5 important fields, normally we call them Objects, which i think is kind of bad naming, but iv heard they can be split into what contains different types of stuff

they are object1, object2, object3, object4 and object5array
they are all basicly the same thing, each has the important field called UID (which is different from the uid.dat to do with your character)

uid is the only field in that class of type long, so if you're ever making an updater, you can use that simple fact to find it, in the past, it used to be an integer like all the others, so it was much harder to find

there are 64 bits in a long, they contain information on the objects position, its type, and most importantly, its ID
the bits are arranged like this, you have to use bitwise operations to get them out

u - unknown/unused
i - ID bits
y - ypos bits
x - xpos bits

uiii iiii iiii iiii iiii iiii iiii iiii uttu uuuu uuuu uuuu uuuy yyyy yxxx xxxx

so like, to get the y position, you'd do this

ypos := ((uid shr 7) and $ff);

you already know the position cause you got it from the groundArray, the most important bits are the ID bits

here is a screenshot when i once made my bot render the IDs onto the game, so you could see which ID goes to which place



there might be a big problem for scar, because i heard it only handles 32-bit integers, even for types like LongInt and Int64

and once you find the object you want, calculate its screen position and click there

n3ss3s

2008-03-26 09:23:04

Delete your double post ;)

Thanks, though if ain't being capable of doing something like that it isn't much use…

"Your bot"? :rolleyes:


you can get your current plane with a field called "plane" or "rsplane", or "currentPlane" or something


You know… You could do some SMART Coding :p Then you could logout from the forums as the… god of the sea people?

Yakman

2008-03-26 11:32:22

of course its capable, we just need to pester freddy and/or benland if needs be.
the 64bits shouldnt be much of a problem, i think 3D arrays is more complicated unless it already exists, im sure benland mentioned it once

my bot, yes everyone in that java botting community seems to make their own private bot, its a good way to learn about the client and general logistics of botting, but most bots tend to be rubbish cause people keep it to themselves instead of sharing so the knowledge adds up (yes im guilty of this)

it was built atop of a base of a program called cherokee, but i didnt like the structure that well, it would have taken a large rewrite of the cherokee part which i didnt feel like, i just lost intrest,
i stopped working on my bot a while ago, i ran the updater yesterday to see how badly it was broken, but only the menu stuff broke, and something changed in the clients so everyones broke for a while too. :P but the groundArray stuff still works perfectly :)

i dont understand your sea people referance, or why you quoted that section on the current plane

its physically impossible for me to work on smart because its closed source :)

Wizzup?

2008-03-26 11:38:27

From: Yakman
of course its capable, we just need to pester freddy and/or benland if needs be.
the 64bits shouldnt be much of a problem, i think 3D arrays is more complicated unless it already exists, im sure benland mentioned it once

my bot, yes everyone in that java botting community seems to make their own private bot, its a good way to learn about the client and general logistics of botting, but most bots tend to be rubbish cause people keep it to themselves instead of sharing so the knowledge adds up (yes im guilty of this)

it was built atop of a base of a program called cherokee, but i didnt like the structure that well, it would have taken a large rewrite of the cherokee part which i didnt feel like, i just lost intrest,
i stopped working on my bot a while ago, i ran the updater yesterday to see how badly it was broken, but only the menu stuff broke, and something changed in the clients so everyones broke for a while too. :P but the groundArray stuff still works perfectly :)

i dont understand your sea people referance, or why you quoted that section on the current plane

its physically impossible for me to work on smart because its closed source :)


Didn't Ben Land100 link you to the source?

n3ss3s

2008-03-26 12:03:04

i dont understand your sea people referance, or why you quoted that section on the current plane


Sea people don't exist, neither does SSRL section.

or why you quoted that section on the current plane


Well Ben and you (with small y? :D) are the Java pros around here, you could help Ben, for example I have no idea about how to pick some value in a hook, and do the needed bit shifting stuff as I don't have any Java coding experience beyong an autoclicker =/

Like how do you use the SmartGetFieldInt with the ground array stuff to find 'objects'?

Yakman

2008-03-26 12:11:53

From: Wizzup?
Didn't Ben Land100 link you to the source?


that redirected to rick rolled remember?
benland was just saying how many people he caught out with that

also we're just the 'active' ones, moparisthebest knows java very well, i think RsN knew some quite good too, and freddy1990 does it quite well

n3ss3s

2008-03-26 12:13:48

Rofl, Wizzup tried to catch me out with that yesterday, - Thank you very much mr. shitslow connection for getting a timeout while connecting me to the roll =D


EDIT: Omg look -


//Gets the max level of your player (yes, it's a funny array)
function GetMaxLevel(index: integer): integer;
begin
result:= SmartGetFieldArrayInt(0,MaxLevels,index);
end;


//Gets the max or current level of your player,
//using the skill name :) See the valid arguments in the case.
//Don't freak out for it hopping over one slot - 22 is a reserve skill slot.
Function SmartGetSkillLevel(Skill: String; Max: Boolean): Integer;

Var
Skills: TStringArray;
I: Integer;
Begin

Skills := ['Attack', 'Defence', 'Strength', 'HitPoints', 'Ranging', 'Prayer',
'Magic', 'Cooking', 'WoodCutting', 'Fletching', 'Fishing', 'FireMaking',
'Crafting', 'Smithing', 'Mining', 'Herblore', 'Agility', 'Thieving', 'Slayer',
'Farming', 'RuneCrafting', 'Construction', 'Reserve', 'Hunting', 'Summoning'];

For I := 0 To 24 Do
If I = 22 Then
Continue
Else
If Skill = Skills[i] Then
Begin
If Max Then
Result := GetMaxLevel(i)
Else
Result := GetLevel(i);
Break;
End;

End;

Summoning and Hunter level might be visa versa.

I'm editing the GetSkillLevel thing a bit, editing new soon.

Smartzkid

2008-03-28 01:22:29

Could one not add 64 bit integers to a plugin for SCAR?

The Claw

2008-03-28 03:09:58

From: Wizzup?
Didn't Ben Land100 link you to the source?


:duh:

Yakman

2008-03-28 04:26:50

The Claw, he didnt link me the source, it was actually a link to The SMART Sauce which I stole for my chips!!

for the 64 bit integers,
even if you made it in a plugin or script, when you do SmartGetXXX(), it would return 32bits
it would have to be in the SMART plugin if anywhere, and have a method SmartGet64Bits() or something


type
Integer64 = record
highBits: Integer;
lowBits: Integer;
end;

then you do the bitshifting

ypos := ((uid.lowBits shr 7) and $ff);

The Claw

2008-03-28 04:39:58

i know, lol. wizzup sent me that link as well, thats why i did that emoticon lol.

Markus

2008-03-28 10:07:34

Scar DOES support 64 bit integers:

program New;
var a : Int64;
begin
a := 9223372036854775806; //max value -1
writeln(Int64ToStr(a+1));
end.
The problem is that SMART returns an integer, which is only 32 bits. This means we can only check the lower 32 bits of the object. And the lower 32 bits are only the ID bits. That means that we can't even get the location of the object :(

Yakman

2008-03-28 11:04:50

From: Markus
Scar DOES support 64 bit integers


ah excellent

we already know the location of the object, when you do [plane][x][y], you get the name x,y when you shift the bits.

isn't it that the ID bits are on the high end? the bits for x are right along at the end, you only need to do

xpos := (uid and $ff);
to get them

if smart only gives us 32 bits, i think the lower 32 bits would be given, so we'd get the x,y pos, and type, and only some of the ID, and IMO that ID is the most important part, everything else is already known to the scripter.

now we have to pester benland to make a method which returns 64 bits, which is simple.

if only it was open source :rolleyes:
we'd just add the method, and run the makefile, easy

actually, there is still the issue of getting an element of type Ground from a 3-dimensional array.

n3ss3s

2008-03-28 13:34:06

if smart only gives us 32 bits, i think the lower 32 bits would be given, so we'd get the x,y pos, and type, and only some of the ID, and IMO that ID is the most important part, everything else is already known to the scripter.


If I remember right, when KYAB spent a minute at SRL, it had "Types and UIDs", which were used for object finding, - Type was calculated from the UID by some GetType(UID: Integer) kind of function, and the UID was also dynamic, unlike the Type, so if we have the Type what do we need an UID for?

Yakman

2008-03-28 14:03:20

type is 2 bits, that mean it can hold 4 different numbers
by reading the client source, i'v found these, but while the client is running, iv mostly only seen type 2 being contained in that array, sometimes type 3, but there is a separate way i use of finding them


0 - object player
1 - object npc
2 - object which doesnt move (rock, tree)
3 - object item

ID is really the dogs bollocks for this, if you know the ID of the rock you want to mine, you can be certain that its type is 2, cause if its an item or npc, it wont have that ID you're checking for
you'll almost certainly never use type or the position bits, the ID is the most useful

n3ss3s

2008-03-28 14:06:08

Wow… You know too much, - you'll end up to the group with Ben that The Government wants dead =D

Like, it's Ben's decision, but it's a shame someone like you just can't come and put in some uberplug because it isn't Open Source…

Wizzup?

2008-03-28 14:26:14

From: n3ss3s
Wow… You know too much, - you'll end up to the group with Ben that The Government wants dead =D

Like, it's Ben's decision, but it's a shame someone like you just can't come and put in some uberplug because it isn't Open Source…


Yeh, or some uber virus/java hack that logs all your passes and names or get's you auto banned. :rolleyes:

n3ss3s

2008-03-28 14:35:06

You wouldn't have to download all the SMART named shit you can see in Google.

Yakman

2008-03-28 14:46:22

From: n3ss3s
Wow… You know too much, - you'll end up to the group with Ben that The Government wants dead =D


meh
its ridiculous how little it takes to impress you guys, please do some critical thinking.
don't get offended or anything, but really, don't worship ben or me or anyone,

Wizzup?

2008-03-28 16:08:32

From: Yakman
meh
its ridiculous how little it takes to impress you guys, please do some critical thinking.
don't get offended or anything, but really, don't worship ben or me or anyone,


Except for CN…

Bobarkinator

2008-03-28 18:59:53

From: n3ss3s
If I remember right, when KYAB spent a minute at SRL, it had "Types and UIDs", which were used for object finding, - Type was calculated from the UID by some GetType(UID: Integer) kind of function, and the UID was also dynamic, unlike the Type, so if we have the Type what do we need an UID for?



All the work was done inside the bot.

Markus

2008-04-03 09:35:44

Hmm, I tried objects, but there was one problem I had: the tiles.
As yakman told, they can have a max of (104*104)² (116985856), which is a little bit too much for scar to handle.

for i := 0 to 116985856 do
begin
end;
Will take around 60 seconds, and that is without doing anything…

the scar noob

2008-04-03 10:29:31

From: Markus
Hmm, I tried objects, but there was one problem I had: the tiles.
As yakman told, they can have a max of (104*104)² (116985856), which is a little bit too much for scar to handle.

for i := 0 to 116985856 do
begin
end;
Will take around 60 seconds, and that is without doing anything…


I knew you were smart, but that smart?:rolleyes:

yakman, were did you learned java? You seem like a professional to me, really.
I always looked up to sumilion, but I now see that there are other people who pwn asswell:)

-Tsn.

Yakman

2008-04-03 11:55:54

Markus, you've fallen into the trap which was in every open source bot I'v seen (including closed source bots that i decompiled)

you're checking every single tile to see if it has what you want, this is frightfully inefficient and scar is quite right to take ages,
there is another way, you make a spiral algorithm, you start from your own player, and spiral outwards, that way, you find the closest rock/tree/whatever, and don't waste processing power

ill donate the method which was in my old bot, to use it, you would just traverse the list from start to finish, if the tile has what you want, break the loop and click there.

credits to Wizzup, I discussed my idea with him at first
credits to Freddy1990 for releasing snippet of SCAR's FindColorSpiral source, which i also looked at for help, but the snippet was probably written by Kaitnieks


import java.util.*;


/**
* Creates a array of tiles which make a spiral of center x,y
* the x,y are 0 > xy > 104, they are the regional coords
*/
public Iterator<Tile> createSpiralArray(int x, int y) {
List<Tile> path = new LinkedList<Tile>();
path.add(new Tile(x, y));
int dir = 0;
int length = 1;
do {
for(int f = 0; f < length; f++) {
switch(dir) {
case 0:
y--; //up
break;
case 1:
x++; //right
break;
case 2:
y++; //down
break;
case 3:
x--;//left
break;
}
if(x >= 0 && x < 104 && y >= 0 && y < 104)
path.add(new Tile(x, y));
}
dir++;
dir = dir % 4;
if(dir % 2 == 0)
length++;
} while(path.size() <= 10712);
return path;
}

it uses the tile class, which is very simple, most bots have an equivalent


public class Tile {
public int x;
public int y;

public Tile(int x, int y) {
this.x = x;
this.y = y;
}
}

you'd use it like this in a program

Iterator<Tile> tilePath = createSpiralPath(myPlayer.getX() << 7, myPlayer.getY() << 7);
//id actually use a forloop here, but the syntax is confusing to people new at java
while(tilePath.hasNext()) {
Tile tile = tilePath.next();
Ground g = groundArray[getCurrentPlane()][tile.x][tile.y]
//if g has the object you want
//do this stuff eg. click on it
}

so one of you convert that into SCAR, and it should be efficient enough to use.


the scar noob, i learned java the same as everyone else, by reading some online free ebooks to get the very basics, I also joined a community who's main subject is java, and places like that are filled with knowledge: everyone talks about java and posts their source code, which is very very useful.
I'm defiantly not a professional.
also by trying to make programs, getting a good idea and making it a reality, you learn by doing.
if the person doesn't release the source, you can also decompile java to an extent, but the writers comments are gone, and the names of some variables aren't restored either.
but apart from that, decompiling is great, everyone who knows about the client learned it from looking at decompiled versions of it.

theres a big list of ebooks here http://www.moparisthebest.com/smf/index.php/topic,66248.0.html
i posted the ebook i learned from, its on page 3 of that thread.

i also told sumilion about it, but he seems to have given up, what a quitter :p ;) :p ;) :)

the scar noob

2008-04-03 12:25:35

Wow, thank you for the information yakman, even a link to a tut;)
Btw, I've always wanted to ask you something: I've added you once at msn, and said you weren't yakman from over here, was it you or not?:rolleyes:

-Tsn.

BenLand100

2008-04-05 07:36:26

From: Yakman
its physically impossible for me to work on smart because its closed source :)

I assume you don't work on SCAR either? :)
Anyway, the "client hacking"/reflection has an api that is in SMART that uses one method:
    public Object getFieldObject(Object o, String path) {
try {
String[] parts = path.split("\\.");
Stack<String> stack = new Stack<String>();
Field field;
if (o == null) {
Class c = gameLoader.loadClass(parts[0]);
for (int i = parts.length - 1; i > 0; i--)
stack.push(parts[i]);
field = c.getDeclaredField(stack.pop());
field.setAccessible(true);
o = field.get(null);
} else {
for (int i = parts.length - 1; i >= 0; i--)
stack.push(parts[i]);
}
if (!stack.empty()) {
while (!stack.empty()) {
String theField = stack.pop();
Class theClass = o.getClass();
field = null;
while (field == null && theClass != Object.class) {
try {
field = theClass.getDeclaredField(theField);
} catch (Exception e) {
try {
theClass = theClass.getSuperclass();
} catch (Exception x) { break; }
}
}
field.setAccessible(true);
o = field.get(o);
}
}
return o;
} catch (Exception e) { System.out.println("Field not found: " + path); }
return null;
}
Which is exported into SCAR a few different ways (including methods for 3D arrays) But beyond that it is all written in SCAR, so stop complaining, its the most open source bot out there :)

Edit: v3 has a method for a 3D array of Objects (which will work for the ground array). Essentially you could have done it before if Yakman remembered that you could index each index of a Java array individually ;) Its going to be a pain in the ass to get 64bit numbers, I think I'll have to fake it in c++, but what methods do you need? a 64bit version of each SmartGetField method?

n3ss3s

2008-04-05 09:16:02

After you've finished SMART v3 with the weird ubermethod, I'd appreciate if you also post how to use them =D

Bobarkinator

2008-04-05 10:16:47

Here is my function for UIDs can anyone see if they can get it to work? I think the hooks for getting the tiles are screwed up. Thats why I couldn't test because I couldn't get my correct tile. Can anybody see if they can file their tile and then try to find the UID of an object?
Function GetUID(TileX, TileY: Integer): Integer;
Var
I,X,Y,L,Index,UID,tmpArray: Integer;
Begin
GetMyPos(X,Y);
For I:= 0 To 3 Do
Begin
Index:= SmartGetFieldArray3DObject(0,'nb.oc',I,TileX-SmartGetFieldInt(0,BaseX),TileY-SmartGetFieldInt(0,BaseY));
If Index <> 0 Then
Begin
UID:= SmartGetFieldObject(Index,'x');// Object 1
If UID <> 0 Then
Begin
WriteLn('UID is not 0 in Object 1');
Result:= SmartGetFieldInt(UID,'j');
SmartFreeObject(UID);
SmartFreeObject(Index);
Exit;
End;
UID:= SmartGetFieldObject(Index,'r'); // Object 2
If UID <> 0 Then
Begin
WriteLn('UID is not 0 in Object 2');
Result:= SmartGetFieldInt(UID,'m');
SmartFreeObject(UID);
SmartFreeObject(Index);
Exit;
End;
UID:= SmartGetFieldObject(Index,'u'); // Object 3
If UID <> 0 Then
Begin
WriteLn('UID is not 0 in Object 3');
Result:= SmartGetFieldInt(UID,'o');
SmartFreeObject(UID);
SmartFreeObject(Index);
Exit;
End;
UID:= SmartGetFieldObject(Index,'E'); // Object 4
If UID <> 0 Then
Begin
WriteLn('UID is not 0 in Object 4');
Result:= SmartGetFieldInt(UID,'q');
SmartFreeObject(UID);
SmartFreeObject(Index);
Exit;
End;
tmpArray:= SmartGetFieldObject(Index,'D');
For L:= 0 To SmartGetFieldArraySize(tmpArray,'') - 1 Do
Begin
UID:= SmartGetFieldArrayObject(tmpArray,'',L);
If UID <> 0 Then
Begin
WriteLn('UID is not 0 in Object 5');
Result:= SmartGetFieldInt(UID,'b');
SmartFreeObject(UID);
SmartFreeObject(Index);
SmartFreeObject(tmpArray);
Exit;
End;
End;
End;
End;
End;

Yakman

2008-04-05 12:15:24

From: BenLand100
I assume you don't work on SCAR either? :)


small misunderstanding here,
theres a difference between working on and working with,
like someone can use MSVisualCpp, but cant work on it.

you guys must have thought working with, i only though working on


Bobarkinator, you could instead of looping from 0 to 3, you could get your current plane (with the field "gf.G" for #490)
also, you assume that if one object is non-null, everything else will be null, but it doesnt work like that, sometimes a few objects are non-null, with their own UID you would have to check

Bobarkinator

2008-04-05 12:33:42

So do I need to return an Array of Int and check every object for without exiting in between them?

BenLand100

2008-04-05 15:13:39

From: Yakman
small misunderstanding here,
theres a difference between working on and working with,
like someone can use MSVisualCpp, but cant work on it.

you guys must have thought working with, i only though working on


Well, I'm very sorry that you feel the need to stick your hands in everything ;) If I wanted someone else to work on it, I would give them the source. If I wanted someone to work with it, I would make it where they can easily work with it, and give them the information they need to use it.
Anyway, different topic, not everyone learns this way: "by reading some online free ebooks to get the very basics" Just had to point that out. :p

@bob An array is one way to do it, I've been out of the loop for a while however, someone might have discovered the proper order of checking by now.

n3ss3s

2008-04-10 08:25:35

Client #492!


//RS Build = #492
const

//Hooking RSString
StringBytes = 'X'; //byte[]*

// Hooking NPC
NPCIndexarray = 'o.P';//*
NPCArray = 'client.hb';//*
NPCDef = 'Ec';//*
NPCCount = 'gf.t';//*

//Hooking NPCDef
NPCActions = 'ib';//*
NPCsName = 'vb';//*

//Hooking PlayerDef
CharName = 'wc'; //StringWrap*

//Hooking Position
BaseX = 'kb.g'; //int* (getBaseX)
MyPlayer = 'be.f'; //Player* (getMyPlayer)
BaseY = 'oc.r'; //int* (getBaseY)

//Hooking Character
CharAnim = 'ge.F'; //int*
CharMotion = 'ge.I'; //int*
CurrentX = 'ge.jb'; //int*
CurrentY = 'ge.qb'; //int*

//Hooking Entity
CharHeight = 'Q';//*

//Hooking GroundInt
GroundHeights = 'ee.wb'; //int[][][] (groundIntArray)*

//Hooking GroundByteArray
GroundSettings = 'pc.lb'; //byte[][][] (groundByteArray)*

//Hooking Camera
BaseLayer = 'ui.q'; //int* (plane/terrainInt)
CamX = 'uc.Kb'; //int*
CamY = 'kb.b'; //int*
CamZ = 'l.o'; //int*

//Hooking CameraCurves
CamPitch = 'aj.n'; //int* (CamCurveX)
CamYaw = 'ej.cb'; //int* (CamCurveY)

//Hooking SettingArray
SettingsArray = 'ig.o'; //int[]*

//Hooking Skills
MaxLevels = 'client.fb'; //int[]* (getSkillLevelMaxes)
CurrentLevels = 'u.i'; //int[]* (getSkillLevels)
Experiances = 'bg.i'; //int[]* (getSkillExperiences)

//Hooking Minimap
MapOffsetAngle = 'oa.s'; //int* (MinimapInt2)
CompassAngle = 'oa.'; //int* (MinimapInt1)

The updated ones are the ones got from the first post of this:
http://www.moparisthebest.com/smf/index.php/topic,262873.0.html


The compass hookings are not updated, so I'd appreciate if anyone has a working updater to run.



EDIT:

@Speedster and his hooks:

Ruroken

2008-04-29 20:16:57

//RS Build = #496
const

//Hooking RSString
StringBytes = 'r'; //byte[]*

// Hooking NPC
NPCIndexarray = 'vb.E';//*
NPCArray = 'aj.Q';//*
NPCDef = 'fi.Vb';//*
NPCCount = 'ma.db';//*

//Hooking NPCDef
NPCActions = 'B';//*
NPCsName = 'eb';//*

//Hooking PlayerDef
CharName = 'Sb'; //StringWrap*

//Hooking Position
MyPlayer = 'tf.r'; //Player (getMyPlayer)*
BaseX = 'lj.f'; //int (getBaseX)*
BaseY = 'pe.qb'; //int (getBaseY)*

//Hooking Character
CharAnim = 'T'; //int*
CharMotion = 'V'; //int*
CurrentX = 'x'; //int*
CurrentY = 'vb'; //int*

//Hooking Entity
CharHeight = 'Fb';//*

//Hooking GroundInt
GroundHeights = 'rf.tb'; //int[][][] (groundIntArray)*

//Hooking GroundByteArray
GroundSettings = 'ng.a'; //byte[][][] (groundByteArray)*

//Hooking Camera
BaseLayer = 'mi.lb'; //int (plane/terrainInt)*
CamX = 'eb.r'; //int*
CamY = 'client.hb'; //int*
CamZ = 'mj.m'; //int*

//Hooking CameraCurves
CamPitch = 'fh.k'; //int (CamCurveX)*
CamYaw = 'w.A'; //int (CamCurveY)*

//Hooking SettingArray
SettingsArray = 'h.v'; //int[]*

//Hooking Skills
MaxLevels = 'td.Eb'; //int[] (getSkillLevelMaxes)*
CurrentLevels = 'fd.r'; //int[] (getSkillLevels)*
Experiances = 'sb.d'; //int[] (getSkillExperiences)*

//Hooking Minimap
MapOffsetAngle = 'vf.kb'; //int (MinimapInt2)
CompassAngle = 'pc.'; //int (MinimapInt1)

#496. Untested.

Wizzup?

2008-04-29 21:15:12

From: Ruroken
//RS Build = #496
const

//Hooking RSString
StringBytes = 'r'; //byte[]*

// Hooking NPC
NPCIndexarray = 'vb.E';//*
NPCArray = 'aj.Q';//*
NPCDef = 'fi.Vb';//*
NPCCount = 'ma.db';//*

//Hooking NPCDef
NPCActions = 'B';//*
NPCsName = 'eb';//*

//Hooking PlayerDef
CharName = 'Sb'; //StringWrap*

//Hooking Position
MyPlayer = 'tf.r'; //Player (getMyPlayer)*
BaseX = 'lj.f'; //int (getBaseX)*
BaseY = 'pe.qb'; //int (getBaseY)*

//Hooking Character
CharAnim = 'T'; //int*
CharMotion = 'V'; //int*
CurrentX = 'x'; //int*
CurrentY = 'vb'; //int*

//Hooking Entity
CharHeight = 'Fb';//*

//Hooking GroundInt
GroundHeights = 'rf.tb'; //int[][][] (groundIntArray)*

//Hooking GroundByteArray
GroundSettings = 'ng.a'; //byte[][][] (groundByteArray)*

//Hooking Camera
BaseLayer = 'mi.lb'; //int (plane/terrainInt)*
CamX = 'eb.r'; //int*
CamY = 'client.hb'; //int*
CamZ = 'mj.m'; //int*

//Hooking CameraCurves
CamPitch = 'fh.k'; //int (CamCurveX)*
CamYaw = 'w.A'; //int (CamCurveY)*

//Hooking SettingArray
SettingsArray = 'h.v'; //int[]*

//Hooking Skills
MaxLevels = 'td.Eb'; //int[] (getSkillLevelMaxes)*
CurrentLevels = 'fd.r'; //int[] (getSkillLevels)*
Experiances = 'sb.d'; //int[] (getSkillExperiences)*

//Hooking Minimap
MapOffsetAngle = 'vf.kb'; //int (MinimapInt2)
CompassAngle = 'pc.'; //int (MinimapInt1)

#496. Untested.


I'll try to give it a run in a few days… :)

n3ss3s

2008-04-30 02:31:38

Seem different than the one I managed to pull, which ofcourse failed :p

Will post proggie in a few sec…


YEEEEEHAAAW!!!!



Erm.. Yes, they work :p

the scar noob

2008-04-30 06:25:53

Hmm, new hooks information. Maybe I can try TileWalking out afterall:p

-Tsn.

n3ss3s

2008-04-30 06:49:31

Come to the darkside… We have cookies…

Markus

2008-04-30 10:14:58

Little error: NPCDef should be 'vB';

Ruroken

2008-05-01 02:19:31

//RS Build = #496
const

//Hooking RSString
StringBytes = 'r'; //byte[]*

// Hooking NPC
NPCIndexarray = 'vb.E';//*
NPCArray = 'aj.Q';//*
NPCDef = 'Vb';//*
NPCCount = 'ma.db';//*

//Hooking NPCDef
NPCActions = 'B';//*
NPCsName = 'eb';//*

//Hooking PlayerDef
CharName = 'Sb'; //StringWrap*

//Hooking Position
MyPlayer = 'tf.r'; //Player (getMyPlayer)*
BaseX = 'lj.f'; //int (getBaseX)*
BaseY = 'pe.qb'; //int (getBaseY)*

//Hooking Character
CharAnim = 'T'; //int*
CharMotion = 'V'; //int*
CurrentX = 'x'; //int*
CurrentY = 'vb'; //int*

//Hooking Entity
CharHeight = 'Fb';//*

//Hooking GroundInt
GroundHeights = 'rf.tb'; //int[][][] (groundIntArray)*

//Hooking GroundByteArray
GroundSettings = 'ng.a'; //byte[][][] (groundByteArray)*

//Hooking Camera
BaseLayer = 'mi.lb'; //int (plane/terrainInt)*
CamX = 'eb.r'; //int*
CamY = 'client.hb'; //int*
CamZ = 'mj.m'; //int*

//Hooking CameraCurves
CamPitch = 'fh.k'; //int (CamCurveX)*
CamYaw = 'w.A'; //int (CamCurveY)*

//Hooking SettingArray
SettingsArray = 'h.v'; //int[]*

//Hooking Skills
MaxLevels = 'td.Eb'; //int[] (getSkillLevelMaxes)*
CurrentLevels = 'fd.r'; //int[] (getSkillLevels)*
Experiances = 'sb.d'; //int[] (getSkillExperiences)*

//Hooking Minimap
MapOffsetAngle = 'vf.kb'; //int (MinimapInt2)
CompassAngle = 'pc.'; //int (MinimapInt1)

All patched up. Thanks Markus.

Markus

2008-05-12 14:11:02

#497, untested for now:

//RS Build = #497
const

//Hooking RSString
StringBytes = 'r'; //byte[]*

// Hooking NPC
NPCIndexarray = 'vi.s';//*
NPCArray = 'ei.A';//*
NPCDef = 'Qb';//*
NPCCount = 'rb.f';//*

//Hooking NPCDef
NPCsName = 'V';//*
NPCActions = 'ab';//*

//Hooking PlayerDef
CharName = 'lc'; //StringWrap

//Hooking Position
MyPlayer = 'ff.g'; //Player (getMyPlayer)*
BaseX = 'aa.S'; //int (getBaseX)*
BaseY = 'n.f'; //int (getBaseY)*

//Hooking Character
CharAnim = 'pb'; //int*
CharMotion = 'jb'; //int*
CurrentX = 'Fb'; //int*
CurrentY = 'S'; //int*

//Hooking Entity
CharHeight = 'J';//*

//Hooking GroundInt
GroundHeights = 's.t'; //int[][][] (groundIntArray)*

//Hooking GroundByteArray
GroundSettings = 'ah.U'; //byte[][][] (groundByteArray)*

//Hooking Camera
BaseLayer = 'ee.hb'; //int (plane/terrainInt)*
CamX = 'c.b'; //int*
CamY = 'sd.Z'; //int*
CamZ = 'va.C'; //int*

//Hooking CameraCurves
CamPitch = 'ff.i'; //int (CamCurveX)*
CamYaw = 'bg.y'; //int (CamCurveY)*

//Hooking SettingArray
SettingsArray = 'bb.z'; //int[]*

//Hooking Skills //BROKEN
MaxLevels = 'td.Eb'; //int[] (getSkillLevelMaxes)*
CurrentLevels = 'fd.r'; //int[] (getSkillLevels)*
Experiances = 'sb.d'; //int[] (getSkillExperiences)*

//Hooking Minimap
MapOffsetAngle = 'nb.O'; //int (MinimapInt2)
CompassAngle = 'wb.Q'; //int (MinimapInt1)
SkillLevels broke according to quarters, haven't updated those.