SRL Archive - Download S.M.A.R.T.

SMARTv2 Demo


BenLand100

2007-12-20 17:53:08

This one's got a cmd prompt that pops up whenever you use Scar, don't close it or it will close scar. ;) It will give lots of debug info (for startup mostly) and should linger after a crash so you can take a SS so I can tell what went wrong where. Wouldn't doubt that I missed some stuff, and I know I've changed some names, have fun finding them :p

Here's some stuff you might want… Post improvements, this is SMART ENHANCEMENT WEEK!

const
SettingsArray = 'jb.k';
PlayerX = 'nf.j.db';
PlayerY = 'nf.j.nb';
BaseX = 'oa.a';
BaseY = 'dd.b';

//returns huge numbers if its invalid (ie, not logged in) ;)
procedure getPlayerPos(var x, y: Integer);
begin
x:= SmartGetFieldInt(BaseX) + SmartGetFieldInt(PlayerX) shr 7;
y:= SmartGetFieldInt(BaseY) + SmartGetFieldInt(PlayerY) shr 7;
end;

procedure dumpSettingArray;
var
i: Integer;
begin
for i:= 0 to 1999 do
Writeln(IntToStr(i)+': ' + inttostr(SmartGetFieldArrayInt(SettingsArray,i)));
end;

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

var
x,y,b: Integer;
c: TCanvas;
begin
SmartSetup('at1',true,true);
b:= BitmapFromString(765,503,'');
c:= GetBitmapCanvas(b);
c.Handle:= SmartGetDebugDC;
c.Pen.Color:= $FF;
c.LineTo(100,100);
SmartSetDebug(true);}
dumpSettingArray;
Writeln(IntToStr(BoxAnswer));
getPlayerPos(x,y);
Writeln(IntToStr(x) + ', ' + IntToStr(y));
end.

    switch (index) {
case 0:
address = GetProcAddress(inst,"_setup@12");
strcpy(def, "procedure SmartSetup(server: String; hiDetail, signed: Boolean);");
return index;
case 1:
address = GetProcAddress(inst,"_getHDC@0");
strcpy(def, "function SmartGetDC: integer;");
return index;
case 2:
address = GetProcAddress(inst,"_isBlocking@0");
strcpy(def, "function SmartEnabled: boolean;");
return index;
case 3:
address = GetProcAddress(inst,"_getMousePos@8");
strcpy(def, "procedure SmartGetMousePos(var x, y: integer);");
return index;
case 4:
address = GetProcAddress(inst,"_holdMouse@12");
strcpy(def, "procedure SmartHoldMouse(x, y: integer; left: boolean);");
return index;
case 5:
address = GetProcAddress(inst,"_releaseMouse@12");
strcpy(def, "procedure SmartReleaseMouse(x, y: integer; left: boolean);");
return index;
case 6:
address = GetProcAddress(inst,"_moveMouse@8");
strcpy(def, "procedure SmartMoveMouse(x, y: Integer);");
return index;
case 7:
address = GetProcAddress(inst,"_windMouse@8");
strcpy(def, "procedure SmartWindMouse(x, y: Integer);");
return index;
case 8:
address = GetProcAddress(inst,"_dragMouse@8");
strcpy(def, "procedure SmartDragMouse(x, y: Integer);");
return index;
case 9:
address = GetProcAddress(inst,"_clickMouse@12");
strcpy(def, "procedure SmartClickMouse(x, y: Integer; left: Boolean);");
return index;
case 10:
address = GetProcAddress(inst,"_sendKeys@4");
strcpy(def, "procedure SmartSendKeys(Text: String);");
return index;
case 11:
address = GetProcAddress(inst,"_holdKey@4");
strcpy(def, "procedure SmartHoldKey(Code: Integer);");
return index;
case 12:
address = GetProcAddress(inst,"_releaseKey@4");
strcpy(def, "procedure SmartReleaseKey(Code: Integer);");
return index;
case 13:
address = GetProcAddress(inst,"_getColor@8");
strcpy(def, "function SmartGetColor(x, y: integer): integer;");
return index;
case 14:
address = GetProcAddress(inst,"_findColor@28");
strcpy(def, "function SmartFindColor(var x, y: integer; color, sx, sy, ex, ey: integer): boolean;");
return index;
case 15:
address = GetProcAddress(inst,"_findColorTol@32");
strcpy(def, "function SmartFindColorTolerance(var x, y: integer; color, sx, sy, ex, ey, tol: integer): boolean;");
return index;
case 16:
address = GetProcAddress(inst,"_findColorSpiral@28");
strcpy(def, "function SmartFindColorSpiral(var x, y: integer; color, sx, sy, ex, ey: integer): boolean;");
return index;
case 17:
address = GetProcAddress(inst,"_findColorSpiralTol@32");
strcpy(def, "function SmartFindColorSpiralTolerance(var x, y: integer; color, sx, sy, ex, ey, tol: integer): boolean;");
return index;
case 18:
address = GetProcAddress(inst,"_findBitmap@12");
strcpy(def, "function SmartFindBitmap(hdc: integer; var x, y: integer): boolean;");
return index;
case 19:
address = GetProcAddress(inst,"_findBitmapIn@28");
strcpy(def, "function SmartFindBitmapIn(hdc: integer; var x, y: integer; sx, sy, ex, ey: integer): boolean;");
return index;
case 20:
address = GetProcAddress(inst,"_findBitmapTolIn@32");
strcpy(def, "function SmartFindBitmapToleranceIn(hdc: integer; var x, y: integer; sx, sy, ex, ey, tol: integer): boolean;");
return index;
case 21:
address = GetProcAddress(inst,"_findColorsTol@28");
strcpy(def, "function SmartFindColorsTolerance(var pts: TPointArray; sx, sy, ex, ey, tol: integer): boolean;");
return index;
case 22:
address = GetProcAddress(inst,"_getFieldInt@4");
strcpy(def, "function SmartGetFieldInt(path: String): integer;");
return index;
case 23:
address = GetProcAddress(inst,"_setRefresh@4");
strcpy(def, "procedure SmartSetRefresh(x: integer);");
return index;
case 24:
address = GetProcAddress(inst,"_getRefresh@0");
strcpy(def, "function SmartGetRefresh: integer;");
return index;
case 25:
address = GetProcAddress(inst,"_getDebugHDC@0");
strcpy(def, "function SmartGetDebugDC: integer;");
return index;
case 26:
address = GetProcAddress(inst,"_setDebugColor@4");
strcpy(def, "procedure SmartSetTrasparentColor(color: integer);");
return index;
case 27:
address = GetProcAddress(inst,"_setDebug@4");
strcpy(def, "procedure SmartSetDebug(enabled: boolean);");
return index;
case 28:
address = GetProcAddress(inst,"_setGraphics@4");
strcpy(def, "procedure SmartSetGraphics(enabled: boolean);");
return index;
case 29:
address = GetProcAddress(inst,"_getFieldArrayInt@8");
strcpy(def, "function SmartGetFieldArrayInt(path: String; index: integer): integer;");
return index;
case 30:
address = GetProcAddress(inst,"_getFieldArraySize@4");
strcpy(def, "function SmartGetFieldArraySize(path: String): integer;");
return index;
}

mastaraymond

2007-12-20 18:24:52

Great job! Its working perfectly! :)

You left a } in your script :p

EDIT: No cleardebug?

Smartzkid

2007-12-20 18:29:21

Sexy!

*dumps savejunks w/ejunks :p*

BenLand100

2007-12-20 19:06:40

From: mastaraymond
Great job! Its working perfectly! :)

You left a } in your script :p

EDIT: No cleardebug?

Darn, a rogue }… Anyway, fill the canvas with the transparent color (defaults to $000000) and that "clears" the debug…

Smartzkid

2007-12-20 20:36:08

Wow, this is better than memory editing :)

Settings Array:
18- Music mode (1: auto, 0: manual)
19- Music loop (0-1)
43- Attack style (0-3)
118- Last (NPC) trade interface opened; if there's a trade window up, you can check this to find out which one it is
166- Brightness (1-4)
168- Music volume (4-0)
169- Sound effects volume (4-0)
170- # Mouse buttons
171- Chat effects (0-1)
172- Auto retaliate (0-1)
173- Run on (0-1)
287- Split private chat (0-1)
427- Accept aid
570- The slot of the bank that was withdrawn from/deposited to last
872- 'Area Sound Effects' volume (4-0)
1002- Achievement diary/Quest log (0: quests, -2147483648 diary)
1036- Something with doors closing; resets after a certain amount of time

BenLand100

2007-12-20 22:04:56

From: Smartzkid
Wow, this is better than memory editing :)

Settings Array:
18- Music mode (1: auto, 0: manual)
19- Music loop (0-1)
43- Attack style (0-3)
118- Last (NPC) trade interface opened; if there's a trade window up, you can check this to find out which one it is
166- Brightness (1-4)
168- Music volume (4-0)
169- Sound effects volume (4-0)
170- # Mouse buttons
171- Chat effects (0-1)
172- Auto retaliate (0-1)
173- Run on (0-1)
287- Split private chat (0-1)
427- Accept aid
570- The slot of the bank that was withdrawn from/deposited to last
872- 'Area Sound Effects' volume (4-0)
1002- Achievement diary/Quest log (0: quests, -2147483648 diary)
1036- Something with doors closing; resets after a certain amount of time

Please, PLEASE, tell me you didn't sit there and figure those out :p

Markus

2007-12-21 02:30:01


const
SettingsArray = 'jb.k';
PlayerX = 'nf.j.db';
PlayerY = 'nf.j.nb';
BaseX = 'oa.a';
BaseY = 'dd.b';
var a, b : tintegerarray;
//returns huge numbers if its invalid (ie, not logged in) ;)
procedure getPlayerPos(var x, y: Integer);
begin
x:= SmartGetFieldInt(BaseX) + SmartGetFieldInt(PlayerX) shr 7;
y:= SmartGetFieldInt(BaseY) + SmartGetFieldInt(PlayerY) shr 7;
end;

function dumpSettingArray : tintegerarray;
var
i: Integer;
begin
SetArrayLength(result, 2000);
for i:= 0 to 1999 do
result[i] := SmartGetFieldArrayInt('jb.k',i);
end;

//-1 if box not open, 0-2 based on the correct answer
function BoxAnswer: integer;
var
boxIndex: Integer;
begin
boxIndex:= SmartGetFieldArrayInt(SettingsArray,312);
if boxIndex = 0 then
result:= -1
else
result:= (boxIndex shr 24) and $FF;
end;
procedure lol(a, b : tintegerarray);
var i : integer;
begin
for i := 0 to 1999 do
if (a[i] <> b[i]) then writeln(inttostr(i)+ ' : ' +inttostr(a[i])+' , ' +inttostr(b[i]));
end;
var
x,y, d: Integer;
c: TCanvas;
begin
SmartSetup('nl3',false,true);
d:= BitmapFromString(765,503,'');
c:= GetBitmapCanvas(d);
c.Handle:= SmartGetDebugDC;
c.Pen.Color:= $FF;
c.LineTo(100,100);
SmartSetDebug(true);
a := dumpSettingArray;
writeln('waiting..' );
repeat
wait(100);
until(isfkeydown(12));
writeln('dumping b');
b := dumpsettingarray;
lol(a, b);
Writeln(IntToStr(BoxAnswer));
getPlayerPos(x,y);
Writeln(IntToStr(x) + ', ' + IntToStr(y));
end.
will writeln all differences between the settings array ;)

Wizzup?

2007-12-21 02:45:59

Ben, Nice!

How much updating/modding of the RuneScape client does this cost/take?
I'll finish the Abyss Runecrafter now. ;)
That is, in a few weeks it will be done. :p

mastaraymond

2007-12-21 06:17:10

It looks promising, except i have no clue how to find out where the settings are stored, lol ^^.

The Claw

2007-12-21 06:19:01

From: mastaraymond
It looks promising, except i have no clue how to find out where the settings are stored, lol ^^.


same here

BenLand100

2007-12-21 08:54:22

From: Wizzup?
Ben, Nice!

How much updating/modding of the RuneScape client does this cost/take?
I'll finish the Abyss Runecrafter now. ;)
That is, in a few weeks it will be done. :p


No modifying of the client at all. You just need to know the variable paths (Those constants in the script I was working with) to get the fields. That can be gotten with almost any updater out there today. Both I and yakman have one that works for those variables.

@mastaraymond SmartGetFieldArrayInt(SettingsArray,[index]); will return the integer in the index of the array specified. You just need to do like Markus posted how to do and look for differences in the array when things happen ;) As a general rule, anything that only you see (eg. something on your client screen but no one else's, settings, etc.) will be stored in the array. That goes for answers to on-screen randoms like the box, quiz show, certers, and maybe leo and the mime.

Smartzkid

2007-12-21 12:40:21

From: BenLand100
Please, PLEASE, tell me you didn't sit there and figure those out :p


var
TheInts: Array of Array [0..1999] of Integer;

const
SettingsArray = 'jb.k';
PlayerX = 'nf.j.db';
PlayerY = 'nf.j.nb';
BaseX = 'oa.a';
BaseY = 'dd.b';

procedure dumpSettingArray;
var
i, c: Integer;
begin
SetLength(TheInts, Length(TheInts) + 1);
c := High(TheInts);
for i:= 0 to 1999 do
TheInts[c][i] := SmartGetFieldArrayInt(SettingsArray,i);
end;

procedure checkForDifferences(a1, a2: Array of Integer);
var
i, l: Integer;
begin
l := High(a1);
if(High(a2) < l)then
l := High(a2);
for i := 0 to l do
if(a1[i] <> a2[i])then
begin
writeln(inttostr(i) + ': ' + inttostr(a1[i]) + ' -> ' + inttostr(a2[i]));
PlaySound('C:\WINDOWS\Media\ding.wav');
end;
end;

var
x,y,b: Integer;
c: TCanvas;
begin
SmartSetup('at1',true,true);
b:= BitmapFromString(765,503,'');
c:= GetBitmapCanvas(b);
c.Handle:= SmartGetDebugDC;
c.Pen.Color:= $FF;
c.LineTo(100,100);
SmartSetDebug(true);
repeat
dumpSettingArray;
try
checkForDifferences(TheInts[High(TheInts) - 1], Theints[High(TheInts)]);
except
writeln('ERROR');
end;
wait(500);
until(isfkeydown(12))
end.

I just dinged my way around RuneScape for a few minutes :p

benleegt

2007-12-21 20:50:14

Are values for the hpbar/animation(Of your char) in that array as well?

Smartzkid

2007-12-21 20:56:18

Not hp, I'll check animation in a sec.

EDIT: not animation, either.

EDIT: Quests are, though.

EDIT: Ben, how long would it take you to add muting?

Markus

2007-12-22 04:36:52

Add a ´SmartGetClientVersion´ please ;)

BenLand100

2007-12-22 07:07:34

From: Smartzkid
Ben, how long would it take you to add muting?

Write a script for it?

Smartzkid

2007-12-22 08:18:11

Ben…I think I'm going to shove a poisonous snake through my mic to you next time we're talking on IM. :p

Still trying to get this debug thing to work; I can't figure out what I'm doing wrong…

EDIT: Meh, still can't get it to work.
  for i := 0 to High(TPA) do
FastSetPixel(b, TPA[i].X, TPA[i].Y, color);
SafeCopyCanvas(GetBitmapCanvas(b), c, 1, 1, 765, 503, 1, 1, 765, 503);


EDIT: Fixed it; had to use built in canvas drawing functions.

BenLand100

2007-12-22 14:27:38

From: Smartzkid
EDIT: Fixed it; had to use built in canvas drawing functions.

You mean like i posted in the demo XD

Smartzkid

2007-12-22 15:32:52

Yeah but why wouldn't I be able to copy a bitmap to the canvas, too?

One last request: allow us to set one color at 75% transparency. Won't hurt too bad in the CPU department, and will be nice for big patches of color.