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

Enable/Disable SMART without stoping the bot


marc2333

2012-12-17 00:22:26

I made a script to check if i was in the second page of a trade (the confirmation page) and then, if it is, take a screenshot and save it in a folder on my desktop. However, SMART never has to take control of my mouse.

The problem is that i WANT to be able to play when running this script and if i click disable SMART to use my mouse, SMART will not send the bot the live screen to the bot. It sends the script the screen of when I disabled SMART so my script keep seeing the same this and wont work.

So my question is : Is there a way i CAN use SMART and be able to use my mouse.

Here is my script :


program TradeChecker;
{$Define Smart}
{$i srl/srl.simba}

procedure DeclarePlayers;
Begin
HowManyPlayers := 1; //SETUP!!!!!
NumberOfPlayers(HowManyPlayers); //FILL IN EVERYTHING MARKED WITH FRACTIONS
CurrentPlayer := 0;

Players[0].Name := ' '; //Username Here! 1/4
Players[0].Pass := ' '; //Password Here! 2/4
Players[0].Nick := ' '; //3 Lowercase Letters From Your Characters Name Here! 3/4
Players[0].Active := True;
Players[0].Pin := ' '; //Bank Pin here! (Or leave Blank if You ain't got'un) 4/4
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
End;

function CheckSecondTradePage: boolean;
var
X,Y,M,N:integer;
begin
if FindColor(X, Y, 192, 264, 300, 323, 321)then // Red color on second trade page
begin
if FindColor(M, N, 49152, 201, 300, 245, 321)then // Green color on second trade page
begin
result:= true;
end else
result:= false;
end;
end;

Procedure ScreenAndSave(const FilePath : String);
var
fileName : String;
Year, Month, Day : Word;
i : Integer;
begin
if (CheckSecondTradePage=true) then
begin
Writeln('This is second page of trade');
Takescreen('Trading');
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
FileName := ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
until not FileExists(FilePath + FileName)
SaveScreenShot(FilePath + FileName);
wait(5000);
end;
end;

Begin
ClearDebug;
SetupSRL;
Declareplayers;
LoginPlayertoLob();
SelectWorld(1);
LoginPlayer;
Activateclient;
wait(randomrange(500, 700));
Repeat
ScreenAndSave('C:\Users\Administrator\Desktop\TradeScreen\hi');
wait(500);
Until(False);
end.

riwu

2012-12-17 00:25:25

Simply dont use SMART (remove {$Define Smart}) and target the window with the green crosshair. Then you can have the script running on real time while you play manually.

marc2333

2012-12-17 00:27:20

From: riwu
Simply dont use SMART (remove {$Define Smart}) and target the window with the green crosshair. Then you can have the script running on real time while you play manually.


The thing is the i eventually want to create a progry and stuff so i want it to be in SMART and that the screenshot procedure needs SMART (I think) to work. Its not possible ?

m34tcode

2012-12-17 01:12:32

no you can capture the client into a bitmap, but there is no way to debug onto the smart canvas while smart is disabled

BitmapFromClient(const xs, ys, xe, ye: Integer): Integer;

You can draw directly onto the client, but you will need to redraw at least 60 times a second.

Also,

    begin
result:= true;
end else
result:= false;

what happens to result if you never make it into the first if statement. Try setting the result to false at the begining of the function, then when you know that the result should be true, set it