SRL Archive - Help and Support

Do we have paint?


Dynamite

2009-10-24 13:22:01

Yeh, well do we have paint like RSBot?
It is such a cool little feature.
If not.. Why not?

T~M

Gu3st...

2009-10-24 13:23:06

What?
If you mean paint on SMART then yes- we do have it :)
JuKKa opened a thread about it somewhere…

ZaSz

2009-10-24 13:25:26

Does not have to be on smart. Im using it (yes on smart but it doesnt have to), for my newest script that makes nice cash :D.

I don't have the script with me, but you can find examples by searching the forums for phrases like "canvas", "debug"

Gu3st...

2009-10-24 13:41:59

From: ZaSz
Does not have to be on smart.
True - but if you want to use it on Jagex' client then it would have to paint every 20ms or so (depends on how much you want it to debug) and that would cause huge lag spikes

caused

2009-10-24 13:51:43

From: Zyt3x
True - but if you want to use it on Jagex' client then it would have to paint every 20ms or so (depends on how much you want it to debug) and that would cause huge lag spikes


If you just want to draw the status report, you could draw that outside the runescape window on the black background of the browser-window.

~caused

mormonman

2009-10-24 15:23:36

From: caused
If you just want to draw the status report, you could draw that outside the runescape window on the black background of the browser-window.

~caused


Lets start a new trend of that :D (btw it is called the debug window)

TRiLeZ

2009-10-24 15:29:11

From: Zyt3x
True - but if you want to use it on Jagex' client then it would have to paint every 20ms or so (depends on how much you want it to debug) and that would cause huge lag spikes


You can draw on the SMART debug canvas so you wouldn't have to paint every couple of ms.

I don't know about drawing above the real RuneScape client.

Gu3st...

2009-10-24 15:50:09

From: TRiLeZ
You can draw on the SMART debug canvas so you wouldn't have to paint every couple of ms.

I don't know about drawing above the real RuneScape client.
I already said that :P

And painting on the black area is clever.. :D Only stupid thing is that you would have to make it black again if you would like to paint something new :s

mormonman

2009-10-24 16:00:22

From: Zyt3x
I already said that :P

And painting on the black area is clever.. :D Only stupid thing is that you would have to make it black again if you would like to paint something new :s


Not the whole thing, just the part you are updating.

Gu3st...

2009-10-25 03:32:29

From: mormonman
Not the whole thing, just the part you are updating.
Yes, that's what I said; You would have to make it black again (aka turn the non-black into black) ;)

rogeruk

2009-10-25 08:07:01

I been fiddling with some stuff here is what i got.

Program canvas;

Var
bmp, x, i, buffer: Integer;
r: TRect;
Test: TCanvas;
Begin
Buffer := BitmapFromString(333, 300, '');
FastDrawClear(buffer, 0);
DisplayDebugImgWindow(333, 300);
SafeDrawBitmap(Buffer, getdebugcanvas, 0, 0);
Test := GetDebugCanvas;
Test.Font.Name := 'Arial';
Test.Font.Size := 14;
Test.Font.Color := clWhite;
Test.Font.Style := [];
Test.Brush.Style := bsClear;
Test.TextOut(40, 10, 'Rogeruk''s Al-Kharid Smelter');
x := 1;
Repeat
Test.TextOut(40, 50, IntToStr(GetTimeRunning));
Inc(X);
wait(500);
Test.Pen.Color := clWhite;
Test.Rectangle(40, 50, 100, 200);
R.Left := 40;
R.Top := 50;
R.Right := 100;
R.Bottom := 200;
Test.Brush.Color := clBlack;
Test.Brush.Style := bsSolid;
Test.FillRect(R);
Until (x > 20);
End.

Does anyone know how to use the FillRect(TRect) ?

mastaraymond

2009-10-25 10:56:38

DisplayDebugImgWindow; CoypCanvas(GetClientCanvas,GetDebugCanvas); Draw on GetDebugCanvas :-p

Works for every client.

n3ss3s

2009-10-25 13:26:15

This is the shit that everyone uses, this one is customized for my ppot drinker -


Function GetPaintBitmap(Color, sX, sY: Integer; Text: TStringArray; Dist: Integer): Integer;

Var
TPA: TPointArray;
H, Q, B, Bmp, blk: Integer;
Begin
Bmp := BitmapFromString(200, 100, ''); // Don't bitch about additional var.
blk := BitmapFromString(200, 100, '');
FastDrawClear(bmp, 65536);
For B := 0 To High(Text) Do
Begin
TPA := LoadTextTPA(Text[b], SmallChars, H);
For Q := 0 To High(TPA) Do
FastSetPixel(Bmp, TPA[q].x, TPA[q].y + B * Dist, Color);
End;
Result := Bmp;
End;


Procedure ClearSMARTCanvas;

Var
BMP: Integer;
SMARTCanvas, Canvas: TCanvas;
Begin
BMP := BitmapFromString(765, 503, '')
SMARTCanvas := GetBitmapCanvas(BMP);
Canvas := GetBitmapCanvas(BMP);
SMARTCanvas.handle := SmartGetDebugDC;
CopyCanvas(Canvas, SMARTCanvas, 0, 0, 765, 503, -1000, -1000, 1000, 1000);
FreeBitmap(BMP);
End;


Procedure ProgressReportCanvas(X, Y: Integer);

Var
SCanvas, Canvas: TCanvas;
BMP, Sec: Integer;
Text: TStringArray;
S, M, H: Integer;
Begin
Sec := GetTimeRunning Div 1000 + 1;
ClearSMARTCanvas;
BMP := BitmapFromString(765, 503, '');
SCanvas := GetBitmapCanvas(BMP);
SCanvas.handle := SmartGetDebugDC;
ConvertTime(GetTimeRunning, H, M, S);
Text := [
'EXP Gained : ' + IntToStr(GetMySkill(TSnum, False) - sXP),
'EXP To Lvl : ' + IntToStr(R_XpTillNextLevel(TSnum)),
'Time Ran : ' + IntToStr(H) + 'h '+ IntToStr(M) + 'm '+ IntToStr(S)];
Canvas := GetBitmapCanvas(GetPaintBitmap(65280, 764, 502, Text, 25));
CopyCanvas(Canvas, SCanvas, 0, 0, 764, 502, X, Y, X + 764, Y + 502);
FreeBitmap(BMP);
End;

Then you just call ProgressReportCanvas when you want to, X and Y are top left of the "box" the text is drawn into…