SRL Archive - OSR Help

no variables, but how does it look? thought?


dumbassbots

2013-06-05 00:26:20

program New;
{$DEFINE SMART8}
{$i srl/srl.simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;

end;


begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end.

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Strength', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
end;
end;
end;
procedure protectfrommelee;
var x, y: interger; //could use help here
begin
end;
procedure ultimatestrength;
var x, y: interger; //could use help here
begin
end;
procedure incrediblereflexes;
var x, y: interger; //could use help here
begin
end;
procedure usealter;
var x, y: integer;
begin
repeat
if FindObj(x, y, 'ray', 1785912, 35) then //i do not have any of the actualy variables at the moment
begin
Mouse(x, y, 0, 0, false);
ChooseOption('ray');
end;
repeat
wait(400+random(250));
AntiBan;
Until not IsUpText('ray') or (InvFull); //want (invfull) to be invempty is it that simple?
until(InvFull); //same here
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
protectfrommelee;
ultimatestrength;
incrediblereflexes;
usealter;
end.


i still need to figure out how to use tpas so i can make sure it gets to the back to the alter as well as create a custom object for the alter itself can i use this?

function FindObjExXtra(var cx, cy: Integer; Color: TIntegerArray;
Tol, Step, xs, ys, xe, ye: Integer): Boolean;
var
MidX, MidY, i, j, k, x, y, width, height, HalfWidth, HalfHeight: Integer;
ColorFound: Boolean;
SearchBoxes: Array of Array of TBox;
p: TPointArray;
begin
Result := False;

//check for all the colors
for i := 0 to (GetArrayLength(Color)-1) do
if (FindColorSpiralTolerance(cx, cy, Color, xs, ys, xe, ye, Tol)) then
begin
ColorFound := True;
Break;
end;

if not(ColorFound) then
Exit; //None of the colors could be found on screen

//Start coordinates
MidX := Round((xe - xs) / 2);
MidY := Round((ye - ys) / 2);

//width and height in boxes
Width := Ceil(abs(xe - xs) / 2 / Step - 0.5) * 2 + 1;
Height := Ceil(abs(ye - ys) / 2 / Step - 0.5) * 2 + 1;

SetLength(SearchBoxes, Width);

//Getting mid of screen in boxes, not pixels
HalfWidth := Floor(Width / 2);
HalfHeight := Floor(Height / 2)

//Create the search boxes, starting in mid because of backwards compatibility
for x := -1 * HalfWidth to HalfWidth do
begin
SetLength(SearchBoxes[x + HalfWidth], Height);
for y := -1 * HalfHeight to HalfHeight do
SearchBoxes[x + HalfWidth][y + HalfHeight] := IntToBox(
Max(xs, xs + Round(MidX + ((x - 0.5) * Step))),
Max(ys, ys + Round(MidY + ((y - 0.5) * Step))),
Min(xe, xs + Round(MidX + ((x + 0.5) * Step))),
Min(ye, ys + Round(MidY + ((y + 0.5) * Step))));
end;

//Create a TPA, where points are representing the boxes
p := TPAFromBox(IntToBox(0, 0, Width-1, Height-1));

//Sort thid TPA from the middle to get a spiral like effect
SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));

//Loop through the boxes, searching for the object (the k and j loop might be better to switch though)
for k := 0 to High(Color) do
for j := 0 to High(p) do
begin
if (FindColorTolerance(cx, cy, Color[k], SearchBoxes[p[j].x][p[j].y].x1,
SearchBoxes[p[j].x][p[j].y].y1, SearchBoxes[p[j].x][p[j].y].x2,
SearchBoxes[p[j].x][p[j].y].y2, Tol)) then
begin
begin
Result := True;
Exit;
end;
end;
end;
end;
^this came from f caverv.15^
learning pretty much everything from disecting fcaver v.15 seems easier this way than it does the guides, and also it resonates with me more.

dumbassbots

2013-06-05 00:38:30

proper prayer functions?

procedure Suicidepray;
begin
if not SuicideP then
exit;
FindifonPtab; //Small prayer stuff.
waithumanclick;
mouse(RandomRange(672, 689),RandomRange(331, 353), random(3),random(3),true);
waithumanclick;
AntiBan;
end;

function Ispraying: Boolean;
var
overhead:tpointarray;
begin
if (not(loggedin)) then
exit;
result := (FindColorsTolerance(Overhead, 63226, MSX1, MSY1, MSX2, MSY2, 10) or // These are the colors ABOVE the player!! The yellow for the melee pray the green for Range pray!
FindColorsTolerance(Overhead, 621348, MSX1, MSY1, MSX2, MSY2, 10))
//SetLength(overhead,0);
end;

Function IsprayingMelee: Boolean;
var
overhead:tpointarray;
begin //this can also detect mage pray.
if (not(loggedin)) then
exit;
result := (FindColorsTolerance(Overhead, 63226, MSX1, MSY1, MSX2, MSY2, 10))
//SetLength(overhead,0);
end;

Element17

2013-06-05 00:54:21

program New;
{$DEFINE SMART8}
{$i srl/srl.simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;

end;


{begin
SetUpSRL;//dont need this twice
ActivateClient;//or this
DeclarePlayers;//or this
LoginPlayer;//or this
end.}

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(8) of
0:
begin
HoverSkill('Strength', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
end;
end;
end;

procedure protectfrommelee;
var x, y: interger; //could use help here
begin
end;

procedure ultimatestrength;
var x, y: interger; //could use help here
begin
end;

procedure incrediblereflexes;
var x, y: interger; //could use help here
begin
end;

procedure usealter;
var x, y: integer;
begin
repeat
if FindObj(x, y, 'ray', 1785912, 35) then //i do not have any of the actualy variables at the moment
begin
Mouse(x, y, 0, 0, false);
ChooseOption('ray');
end;
repeat
wait(400+random(250));
AntiBan;
Until not IsUpText('ray') or (InvFull); //want (invfull) to be invempty is it that simple?
until(InvFull); //same here
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
protectfrommelee;
ultimatestrength;
incrediblereflexes;
usealter;
end.


i still need to figure out how to use tpas so i can make sure it gets to the back to the alter as well as create a custom object for the alter itself can i use this?

function FindObjExXtra(var cx, cy: Integer; Color: TIntegerArray;
Tol, Step, xs, ys, xe, ye: Integer): Boolean;
var
MidX, MidY, i, j, k, x, y, width, height, HalfWidth, HalfHeight: Integer;
ColorFound: Boolean;
SearchBoxes: Array of Array of TBox;
p: TPointArray;
begin
Result := False;

//check for all the colors
for i := 0 to (GetArrayLength(Color)-1) do
if (FindColorSpiralTolerance(cx, cy, Color[i], xs, ys, xe, ye, Tol)) then
begin
ColorFound := True;
Break;
end;

if not(ColorFound) then
Exit; //None of the colors could be found on screen

//Start coordinates
MidX := Round((xe - xs) / 2);
MidY := Round((ye - ys) / 2);

//width and height in boxes
Width := Ceil(abs(xe - xs) / 2 / Step - 0.5) * 2 + 1;
Height := Ceil(abs(ye - ys) / 2 / Step - 0.5) * 2 + 1;

SetLength(SearchBoxes, Width);

//Getting mid of screen in boxes, not pixels
HalfWidth := Floor(Width / 2);
HalfHeight := Floor(Height / 2)

//Create the search boxes, starting in mid because of backwards compatibility
for x := -1 * HalfWidth to HalfWidth do
begin
SetLength(SearchBoxes[x + HalfWidth], Height);
for y := -1 * HalfHeight to HalfHeight do
SearchBoxes[x + HalfWidth][y + HalfHeight] := IntToBox(
Max(xs, xs + Round(MidX + ((x - 0.5) * Step))),
Max(ys, ys + Round(MidY + ((y - 0.5) * Step))),
Min(xe, xs + Round(MidX + ((x + 0.5) * Step))),
Min(ye, ys + Round(MidY + ((y + 0.5) * Step))));
end;

//Create a TPA, where points are representing the boxes
p := TPAFromBox(IntToBox(0, 0, Width-1, Height-1));

//Sort thid TPA from the middle to get a spiral like effect
SortTPAFrom(p, Point(floor(Width / 2), floor(Height / 2)));

//Loop through the boxes, searching for the object (the k and j loop might be better to switch though)
for k := 0 to High(Color) do
for j := 0 to High(p) do
begin
if (FindColorTolerance(cx, cy, Color[k], SearchBoxes[p[j].x][p[j].y].x1,
SearchBoxes[p[j].x][p[j].y].y1, SearchBoxes[p[j].x][p[j].y].x2,
SearchBoxes[p[j].x][p[j].y].y2, Tol)) then
begin
begin
Result := True;
Exit;
end;
end;
end;
end;

Enslaved

2013-06-05 10:40:38

variable declaration, you want to be using the "Float"/"Double"/"Extended" type when dealing with decimal functions