SRL Archive - OSR Help

Is this any good?


DeSnob

2011-03-31 19:06:02

Considering I want some scripts and there none I'll have to code some. Before I begin my project : can someone verify that this script skeleton is okay?
program bot;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i srl/srl/misc/PaintSmart.scar}

const
WORLD = 32;
MEMBERS = false;
SIGNED = true;

var
Break: Integer;
MyStatus: String;

//Proggy Vars
var
Item: Integer;
ExpGain: Integer;

procedure DeclarePlayers;
begin

HowManyPlayers := 2; //How many players in the script.
CurrentPlayer := 0; //Current player in the Players array.
NumberOfPlayers(HowManyPlayers); //Don't change.

with Players[0] do
begin
Name := ''; {Username}
Pass := ''; {Password}
Active := True; {Use This Player?}

Integers[0] := 0; //How long until you sleep in minutes?
Strings[0] := ''; //What skill do you want it to check?
Booleans[0] := False; //Using -?
end;

with Players[1] do
begin
Name := ''; {Username}
Pass := ''; {Password}
Active := False; {Use This Player?}

Integers[0] := 0;
Strings[0] := '';
Booleans[0] := False;
end;
end;

Procedure AntiBan;
var
c: Integer;
begin
MyStatus := 'Antiban';
c := random(500);
if (c = 100) or (c = 500) then
case random(3) of
0:
RandomMovement;
1:
PickUpMouse;
2:
HoverSkill(Players, False);
end;
end;

Procedure Randoms;
begin
r_FindRandoms;
Writeln('Scanned for randoms.');
end;

procedure ClearSmart;
var
drawing : TBitmap;
begin
drawing := TBitmap.Create;
drawing.canvas.handle := SmartGetDebugDC;

ClearRSCanvas(drawing.canvas);

try
FreeBitmap(drawing);
except end;
end;

Procedure ScriptSetup;
begin
Writeln('Setting script up!');
end;

procedure SMARTProggy;
begin
ClearSmart;
SMART_DrawText(95, 460, 'FriendChars', 'Our Script', clRed);
SMART_DrawText(400, 305, 'CharsNPC', MyStatus, clGreen);
end;

Procedure Proggy;
var
Time: Integer;
begin
Writeln('Our Script.');
Writeln('We get ' + ToStr((GetTimeRunning/3600000) * ExpGain) + ' xp per hour');
end;

Procedure TakeBreak;
var
c: Integer;
begin
MyStatus := 'Sleeping';
SMARTProggy;
Writeln('Sleeping...');
case random(2) of
0:
LogOut;
1:
ExitToLobby;
end;
c := RandomRange(60000, 7200000); //1 minute to 120 minutes
Writeln('Sleeping for ' + IntToStr(c/60000) + ' minutes.');
Wait(c);
Writeln('Sleep over! Logging in.');
MyStatus := 'Logging in';
SMARTProggy;
LogInPlayer;
end;

begin
AddOnTerminate('Proggy');
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;

SetupSRL;
SetupReflectionEx(true);
DeclarePlayers;
LoginPlayer;
ScriptSetup;
MarkTime(Break);
ClearDebug;
SMARTProggy;
repeat
if (not(LoggedIn)) then
NextPlayer(False);
if TimeFromMark(Break) > (Players[CurrentPlayer].Integers[0]+random(20) * 60000) then
TakeBreak;
until(AllPlayersInActive);
end.
It supports multiplayer, SMART & debug proggies, reflection, randoms/antiban, and breaks.

i luffs yeww

2011-03-31 19:11:51

Well it doesn't really show the important stuff, like how you're gonna manage.. anything that's not graphical. Which is pretty important. :p

kitchenrange

2011-03-31 20:38:21

Nothing wrong that I see with that, but you don't technically have anything started.

Definitely something to start with though.

DeSnob

2011-03-31 20:41:04

Well until I start work on the scripts I can't do much. I was just wondering if i was doing the bare basics correctly. Would be horrible to mess up in the beginning. ;)

Yago

2011-03-31 20:42:41

Its basic so im guessing so far its fine. The script is the real challenge.