Cooler stuff needs new post:
Images here:
off -
http://i.imgur.com/Y1PXc.pngon -
http://i.imgur.com/XUJ0X.pngsel -
http://i.imgur.com/oSgfS.png
{$DEFINE SMART}
{$i SRL/SRL.scar}
{$i SRL/SRL/misc/PaintSmart.scar}
function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
var
T: TSysProcArr;
I: Integer;
begin
T:= GetProcesses();
for I := 0 to high(T) do
if StartsWith(TitlePrefix, T[i].Title) then
begin
Result := True;
if SetAsTarget then
SetTarget(T[i]);
Exit;
end;
end;
procedure GetRealMousePos(var x, y : Integer);
var
KMTarget, ITarget : Integer;
begin
KMTarget := GetKeyMouseTarget;
ITarget := GetImageTarget;
FindAndSetTarget('Public SMART', True);
GetTClient.IOManager.GetMousePos(X, Y);
SetKeyMouseTarget(KMTarget);
SetImageTarget(ITarget);
x := x - 8;
y := y - 25;
end;
function IsRealMouseInBox(B : TBox): Boolean;
var
P : TPoint;
begin
GetRealMousePos(P.X, P.Y);
Result := PointInBox(P, B);
end;
procedure SMART_DrawBitmapEx(Clear: Boolean; bmp, x, y: Integer);
begin
if (not SMART_DebugSetup) then
SMART_SetupDebug();
if Clear then ClearRSCanvas(SMART_Canvas.canvas);
DrawBitmap(bmp, SMART_Canvas.Canvas, x, y);
end;
var
bon, boff, bsel, w, h: Integer;
tpa: TPointArray;
LI, sel: Boolean;
begin
Smart_Server := 32;
SetupSRL;
if (not SMART_DebugSetup) then
SMART_SetupDebug();
ClearRSCanvas(SMART_Canvas.canvas);
boff := LoadBitmap('C:\Users\T-Dog\Pictures\Runescape\btnoff.png');
bon := LoadBitmap('C:\Users\T-Dog\Pictures\Runescape\btnon.png');
bsel := LoadBitmap('C:\Users\T-Dog\Pictures\Runescape\btnsel.png');
tpa := TPAFromText('On', 'FriendChars', w, h);
OffsetTPA(tpa, Point((75-w)/2, 5));
DrawTPABitmap(bon, tpa, 2909203);
tpa := TPAFromText('Off', 'FriendChars', w, h);
OffsetTPA(tpa, Point((75-w)/2, 5));
DrawTPABitmap(boff, tpa, 13387839);
tpa := TPAFromText('Selected', 'FriendChars', w, h);
OffsetTPA(tpa, Point((75-w)/2, 5));
DrawTPABitmap(bsel, tpa, 1117058);
LI := True;
SMART_DrawBitmapEx(True, boff, 10, 10);
while True do
begin
if IsMouseButtonDown(mouse_Left) then
begin
if IsRealMouseInBox(IntToBox(10, 10, 85, 30)) then
begin
if not sel then
Smart_DrawBitmapEx(True, bsel, 10, 10);
sel := not sel;
end;
while IsMouseButtonDown(mouse_Left) do Wait(5);
LI := not IsRealMouseInBox(IntToBox(10, 10, 85, 30));
end;
if not sel then
if IsRealMouseInBox(IntToBox(10, 10, 85, 30)) then
begin
if not LI then SMART_DrawBitmapEx(true, bon, 10, 10);
LI := True;
end else
begin
if LI then SMART_DrawBitmapEx(True, boff, 10, 10);
LI := False;
end;
Wait(25);
end;
end.