RISK
2011-12-05 01:09:33
How Long have You Played Runescape?
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No.
Were you Referred to SRL?
What is your general programming knowledge?
Pascal
Are you a member of any other communities?
No. Not anymore.
Tell us about yourself…
Please show us one (or multiple) of your scripts.
The first script is my RTanner script and the second one is an example of radial walking to show that I am indeed capable of radial walking.
8 Year(s)
Are you affilated in anyway with Jagex LTD?
No.
Were you Referred to SRL?
What is your general programming knowledge?
Pascal
Are you a member of any other communities?
No. Not anymore.
Tell us about yourself…
From: RISK
My name is Jesse, I am seventeen years old and I have a passion for development and helping others succeed in their personal goals.
Please show us one (or multiple) of your scripts.
The first script is my RTanner script and the second one is an example of radial walking to show that I am indeed capable of radial walking.
program RTanner;
{$DEFINE SMART}
{$i SRL/SRL.scar}
{$I SPS/SPS.simba}
const
WORLD = 35;
MEMBERS = False;
// Player integers:
TANNED = 1;
TO_TAN = 2;
// Player strings:
LEATHER = 0;
// --
procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
Strings[LEATHER] := 'leather';
Integers[TO_TAN] := 100;
Active := True;
end;
end;
procedure Write(T: string);
begin
WriteLn(TheTime + ': ' + PadR(T, 12));
end;
procedure ExitPlayer(Message: string);
begin
Write(Message);
Players[CurrentPlayer].Active := False;
Logout;
end;
procedure SetCTS(Hue, Sat: Extended);
begin
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue, Sat);
end;
procedure RevertCTS;
begin
SetColorSpeed2Modifiers(0.2, 0.2);
SetColorToleranceSpeed(1);
end;
function LoadDTM(DTM: string): Integer;
var dtmText : string;
begin
case Lowercase(DTM) of
'cowhide' : dtmText := 'mbQAAAHicY2VgYJjKxMCwCIjnAXEnELcDcTQjA0MUEKcCcTIQ' +
'RwDx0nnzgKqZUDAPAyZgxILBAAAq5gbJ';
'leather' : dtmText := 'mbQAAAHicY2VgYNjPxMBwBoiPAfEWIN4AxDGMEJwOxClAHAXE' +
'thacQNVMKJiVARMwYsFgAAAiUAY3';
end;
Result := DTMFromString(dtmText);
end;
function IsShopOpen: Boolean;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
Result := FindTextTPA(2070783, 10, MSX1, MSX1, MSX2, MSY2, 'What', +
'UpCharsEx', Nothing);
end;
function CanTan: Boolean;
var Tanning, leatherText, Amount : string;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
Tanning := Players[CurrentPlayer].Strings[LEATHER];
case Lowercase(Tanning) of
'leather' :
begin
leatherText := 'Soft';
Amount := '1';
end;
end;
Result := FindTextTPA(65280, 10, MSX1, MSY1, MSX2, MSY2, leatherText,
'SmallChars', Nothing) and FindTextTPA(65280, 10,
MSX1, MSY1, MSX2, MSY2, Amount, 'SmallChars',
Nothing);
end;
procedure Antiban;
begin
case Random(150) of
0 : BoredHuman;
1 .. 8 : PickUpMouse;
55 : RandomRClick;
60 .. 77 : Wait(RandomRange(1622, 3444));
end;
end;
function ClickSymbol(Symbol: string; Accuracy: Extended): Boolean;
var
X, Y : Integer;
tempAcc : Extended;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
tempAcc := SymbolAccuracy;
SymbolAccuracy := Accuracy;
if (not(FindSymbol(X, Y, Symbol))) then
begin
Write('We were unable to find the symbol ' + Symbol + '...');
Result := False;
end;
SymbolAccuracy := tempAcc;
end;
function OnEllis_Sym: Boolean; // Fail-safe for function OnEllis_SPS: Boolean;
var
X, Y : Integer;
tempAcc : Extended;
oldPos, curPos : TPoint;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
oldPos := SPS_GetMyPos;
if ((oldPos <> Point(4935, 3890))) then
begin
Write('We do not need to fix our position.');
Result := True;
Exit;
end;
tempAcc := SymbolAccuracy;
SymbolAccuracy := 0.5;
if (not(FindSymbol(X, Y, 'tanner'))) then
begin
SymbolAccuracy := tempAcc;
ExitPlayer('We were unable to fix our position by clicking the symbol...');
end;
SymbolAccuracy := tempAcc;
Mouse(X, Y, 5, 5, True)
Flag;
curPos := SPS_GetMyPos;
Result := (curPos <> Point(4935, 3890));
end;
function OnEllis_SPS: Boolean; // Fixes the bug where we get stuck on Ellis
var
oldPos, curPos, newPos : TPoint;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
oldPos := SPS_GetMyPos;
if (oldPos = Point(4935, 3890)) then
begin
// Facing north: (4930, 3890) = Tile left of Ellis
// Facing north: (4940, 3890) = Tile right of Ellis
case Random(2) of
0 : newPos := Point(4930, 3890);
1 : newPos := Point(4940, 3890);
end;
if (not(SPS_WalkToPos(newPos))) then
begin
Write('SPS walking failed to walk to point: "' + ToStr(newPos) + '"...');
if (not(OnEllis_Sym)) then
ExitPlayer('We were unable to fix our position...');
end;
end;
curPos := SPS_GetMyPos;
Result := (curPos <> oldPos);
end;
function SPSWalks(Where: string): Boolean;
var
Path : TPointArray;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
case Lowercase(Where) of
'bank' : Path := [Point(4943 + Random(5), 3955 + Random(5)),
Point(4917 + Random(5), 3993 + Random(5))];
'shop' : Path := [Point(4944 + Random(5), 3955 + Random(5)),
Point(4940 + Random(5), 3896 + Random(5))];
end;
Result := SPS_WalkPath(Path);
end;
function TanHides: Boolean;
var
X, Y, R, leatherDTM : Integer;
Hide, Text : string;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
if (not(IsShopOpen)) then ExitPlayer('The shop is not open...');
Hide := Players[CurrentPlayer].Strings[LEATHER];
case Lowercase(Hide) of
'leather' :
begin
Text := 'Soft';
leatherDTM := LoadDTM('leather');
end;
end;
if FindDTM(leatherDTM, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
FreeDTM(leatherDTM);
Write('We already have tanned leather in our inventory!');
Result := True;
Exit;
end;
if (not(CanTan)) then ExitPlayer('Can not tan...');
if (not(FindTextTPAEx(65280, 10, MSX1, MSY1, MSX2, MSY2, X, Y, Text,
'SmallChars', Nothing))) then
begin
FreeDTM(leatherDTM);
ExitPlayer('We were unable to tan the hides...');
end;
Mouse(X, Y, 10, 5, False);
if (not(WaitOption('All', 1050))) then
begin
FreeDTM(leatherDTM);
ExitPlayer('We were unable to tan the hides...');
end;
for R := 1 to 5 do
begin
if (FindDTM(leatherDTM, X, Y, MIX1, MIY1, MIX2, MIY2)) then
begin
Result := True;
IncEx(Players[CurrentPlayer].Integers[TANNED], 27);
Break;
end;
Wait(RandomRange(350, 550));
end;
FreeDTM(leatherDTM);
if (R = 5) then
begin
ExitPlayer('We were unable to tan the hides...');
end;
end;
function TradeEllis: Boolean;
var X, Y, R : Integer;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
if (IsShopOpen) then
begin
Result := True;
Exit;
end;
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
if (not(WaitOption('Trad', 1477))) then
begin
ExitPlayer('We were unable to find the option to trade Ellis...');
end;
for R := 1 to 5 do
begin
if (IsShopOpen) then
begin
Result := True;
Break;
end;
Wait(RandomRange(250, 550));
end;
end;
function MouseEllis: Boolean;
var
X, Y, R, L, H : Integer;
curPos : TPoint;
ellisTPA : TPointArray;
ellisATPA : T2DPointArray;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
if (IsShopOpen) then
begin
Write('The shop is already open.');
Result := True;
Exit;
end;
while (IsMoving) do
begin
Antiban;
Wait(RandomRange(150, 250));
end;
if (not(SPS_PosOnMM(Point(4935, 3850)))) then
begin
Write('We might be stuck in the middle of the road...');
if (not(ClickSymbol('tanner', 0.5))) then
begin
ExitPlayer('We were unable to fix our position...');
end;
end;
curPos := SPS_GetMyPos;
if (curPos = Point(4935, 3890)) then
OnEllis_SPS;
repeat
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
if (IsShopOpen) then
begin
Write('The shop is already open.');
Result := True;
Exit;
end;
SetCTS(0.01, 0.63);
FindColorsSpiralTolerance(X, Y, ellisTPA, 2246820, MSX1, MSY1, MSX2, MSY2, +
22);
RevertCTS;
ellisATPA := SplitTPAEx(ellisTPA, 10, 10);
if (Length(ellisATPA) > 0) then
begin
SortATPAFromFirstPoint(ellisATPA, Point(MSCX, MSCY));
H := High(ellisATPA);
for L := 0 to H do
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
if (IsShopOpen) then Exit;
if (Length(ellisATPA[L]) > 15) then
begin
MiddleTPAEx(ellisATPA[L], X, Y);
MMouse(X, Y, 5, 5);
Wait(RandomRange(350, 450));
Result := WaitUpText('Talk', 1050);
end;
if (Result) then Exit;
end;
end;
Inc(R);
until((R >= 5) or (Result) or (not(LoggedIn)));
if (R >= 5) then
begin
ExitPlayer('We were unable to find Ellis...');
end;
end;
function BankHides: Boolean;
var
X, Y, I, R, L, hideDTM, leatherDTM : Integer;
Tanning : string;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
Tanning := Players[CurrentPlayer].Strings[LEATHER];
case Lowercase(Tanning) of
'leather' :
begin
hideDTM := LoadDTM('cowhide');
leatherDTM := LoadDTM('leather');
end;
end;
if (PinScreen) then
InPin(Players[CurrentPlayer].Pin);
if (not(BankScreen)) then
ExitPlayer('Unable to bank...');
for I := 1 to 2 do
begin
case (I) of
1 : // Deposits leather
begin
if (not(FindDTM(leatherDTM, X, Y, MIX1, MIY1, MIX2, MIY2))) then
begin
Write('No leather in our inventory to bank...');
FreeDTM(leatherDTM);
Continue;
end;
FreeDTM(leatherDTM);
Mouse(X, Y, 5, 5, False);
if (not(WaitOption('All', 1080))) then
ExitPlayer('We did not find the option to bank the leather...');
leatherDTM := LoadDTM('leather');
for R := 1 to 5 do
begin
if (not(FindDTM(leatherDTM, X, Y, MIX1, MIY1, MIX2, MIY2))) then
Break;
Wait(RandomRange(250, 450));
end;
FreeDTM(leatherDTM);
if (R = 5) then
begin
ExitPlayer('We were unable to bank the leather in our inventory.');
end;
end;
2 : // Withdraws hides
begin
if (not(FindDTM(hideDTM, X, Y, MSX1, MSY1, MSX2, MSY2))) then
begin
FreeDTM(hideDTM);
ExitPlayer('We have no more hides...');
end;
FreeDTM(hideDTM);
Mouse(X, Y, 5, 5, False);
if (not(WaitOption('All', 1077))) then
begin
ExitPlayer('We were unable to withdraw more hides (ChooseOption).');
end;
hideDTM := LoadDTM('cowhide');
for L := 1 to 5 do
begin
if ((FindDTM(hideDTM, X, Y, MIX1, MIY1, MIX2, MIY2))) then
begin
Result := True;
Break;
end;
Wait(RandomRange(250, 450));
end;
FreeDTM(hideDTM);
if (L = 5) then
begin
ExitPlayer('We were unable to withdraw more hides...');
end;
end;
end;
end;
end;
function RI_OpenBank: Boolean; // Opens the bank by the NPCs - Uses TPAs
var
X, Y, R, L, H, N : Integer;
bankerTPA : TPointArray;
bankerATPA : T2DPointArray;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
if ((BankScreen) or (PinScreen)) then
begin
Write('The bank is already open.');
Result := True;
Exit;
end;
while (IsMoving) do
begin
Antiban;
Wait(RandomRange(150, 350));
end;
if (not(SPS_PosOnMM(Point(4885, 4045)))) then
begin
if (not(SPSWalks('bank'))) then
ExitPlayer('We were unable to find the bank...');
end;
repeat
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
SetCTS(0.03, 0.07);
FindColorsSpiralTolerance(X, Y, bankerTPA, 3099499, MSX1, MSY1, MSX2, MSY2,
13);
RevertCTS;
bankerATPA := SplitTPAEx(bankerTPA, 15, 15);
if (Length(bankerATPA) > 0) then
begin
SortATPAFromFirstPoint(bankerATPA, Point(MSCX, MSCY));
H := High(bankerATPA);
for L := 0 to H do
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
if (Length(bankerATPA[L]) > 20) then
begin
MiddleTPAEx(bankerATPA[L], X, Y);
MMouse(X, Y, 3, 5);
if (WaitUpText('Talk', 1050)) then
begin
Mouse(X, Y, 0, 0, False);
if WaitOption('ank B', 1101) then
begin
for N := 1 to 5 do
begin
if ((BankScreen) or (PinScreen)) then
begin
Result := True;
Exit;
end;
Wait(RandomRange(350, 550));
end;
end;
end;
end;
end;
end;
Inc(R);
until((R >= 5) or (Result) or (not(LoggedIn)));
if (R >= 5) then
ExitPlayer('We were unable to open the bank...');
end;
procedure MainLoop;
var hidesTanned, hidesToTan : Integer;
begin
repeat
hidesToTan := Players[CurrentPlayer].Integers[TO_TAN];
repeat
if (SPSWalks('shop')) then
if (MouseEllis) then
if (TradeEllis) then
if (TanHides) then
if (SPSWalks('bank')) then
if (RI_OpenBank) then
BankHides;
hidesTanned := Players[CurrentPlayer].Integers[TANNED];
until((hidesTanned >= hidesToTan) or (not(LoggedIn)));
if (hidesTanned >= hidesToTan) then
ExitPlayer('Finished tanning ' + ToStr(hidesToTan) + ' hides.');
until((AllPlayersInactive));
end;
procedure Setup;
var DTM, X, Y : Integer;
begin
SMART_Server := WORLD;
SMART_Members:= MEMBERS;
SetupSRL;
DeclarePlayers;
LoginPlayer;
SPS_Setup(RUNESCAPE_SURFACE, ['12_9']);
SetAngle(True);
ClearDebug;
MainLoop;
end;
begin
Setup;
end.
program RadialWalking;
{$DEFINE SMART}
{$i SRL/SRL.scar}
const
WORLD = 35;
MEMBERS = False;
procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
end;
end;
function aColor: Integer; // Finds the varrock road color/colour
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(3.89, 0.22);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 7763825, MMX1,
MMY1, MMX2, MMY2, 10);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 10.72) and (X <= 24.95) and (Y >= 11.37) and (Y <= 26.34) and +
(Z >= 11.73) and (Z <= 27.16) then
begin
Result := arC[i];
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function WalkToWestBank(Step: Integer): Boolean;
var
Color : Integer;
R : TIntegerArray;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
Color := aColor;
case (Step) of
1 : R := [276, 261, 56];
2 : R := [281, 264, 61];
3 : R := [276, 261, 67];
4 : R := [277, 266, 68];
end;
Result := RadialWalkTolerance(Color, R[0], R[1], R[2], 5, 5, 30);
end;
function Walk: Boolean;
var X, Y, I : Integer;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
for I := 1 to 4 do
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;
if (WalkToWestBank(I)) then
begin
WriteLn('Step ' + ToStr(I) + ' completed.');
Flag;
end;
end;
SymbolAccuracy := 0.5;
Result := FindSymbol(X, Y, 'bank');
SymbolAccuracy := 0.8;
end;
procedure Setup;
begin
SMART_Server := WORLD;
SMART_Members:= MEMBERS;
SetupSRL;
DeclarePlayers;
LoginPlayer;
SetAngle(True);
MakeCompass('N');
SetRun(True);
if (Walk) then
WriteLn('We have successfully walked to Varrock west bank.');
end;
begin
Setup;
end.