SRL Archive - First Scripts

First Script


JNCR

2007-09-19 00:41:11

Hi this is JNCR and I am just starting scripting. I need to put antirandoms in my teleporting script but I do not know exactly where to put them. I do know that I have to use FindNormalRandoms, but is that all? oh and also, other feedback would be greatly appreciated. thanks.

{<><><><><><><><><><><><><><><><><><><><><><><><>)
{ }
{ [SRL4]AutoTelly 1.0 By JNCR }
{ }
{<><><><><><><><><><><><><><><><><><><><><><><><>}
program AutoTelly;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Magic.scar}

{------------------------------------------------------------------------------}
{----------------------------------Setup---------------------------------------}
{------------------------------------------------------------------------------}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1; //How Many Players You Want To Auto With
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; //Starting Player Number

// For the Strings[0] you can put any of the following:
// Varrock Teleport
// Lumbridge Teleport
// Falador Teleport
// Camelot Teleport
// Ardougne teleport
// Trollheim Teleport

Players[0].Name :='user'; //Runescape Username
Players[0].Pass :='pass'; //Runescape Password
Players[0].Nick :='user'; //3 of 4 Letters of Your Username
Players[0].Integers[0] := 50; //Teleports To Do
Players[0].Strings[0] := 'Camelot Teleport'; //Type of Teleport (Refer to Above)
Players[0].Active := True;
{
Players[1].Name :='user';
Players[1].Pass :='pass';
Players[1].Nick :='user';
Players[1].Integers[1] := 50;
Players[1].Strings[1] := 'Camelot Teleport';
Players[1].Active := True;

Players[2].Name :='user';
Players[2].Pass :='pass';
Players[2].Nick :='user';
Players[2].Integers[2] := 50;
Players[2].Strings[2] := 'Camelot Teleport';
Players[2].Active := True;

Players[3].Name :='user';
Players[3].Pass :='pass';
Players[3].Nick :='user';
Players[3].Integers[3] := 50;
Players[3].Strings[3] := 'Camelot Teleport';
Players[3].Active := True;
}
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;

{------------------------------------------------------------------------------}
{--------------------------------End of Setup----------------------------------}
{------------------------------------------------------------------------------}

Procedure Telly;
var
I : Integer;
begin
I := 0
repeat
if not(LoggedIn) then LoginPlayer;
HighestAngle;
MakeCompass('N');
cast(Players[CurrentPlayer].Strings[0]);
O := O + 1;
I := I + 1;
wait(2000 + random(2000));
until(I = Players[CurrentPlayer].Integers[0])
Writeln('Completed Teleporting');
Logout;
exit;
end;

begin
SetupSRL;
DeclarePlayers;
GetSelf.WindowState := wsMinimized;
MouseSpeed := 15 + random(3);
if not (LoggedIn) then LoginPlayer;
Telly;
GetSelf.WindowState := wsMaximized;
end.

MasterKill

2007-09-19 01:18:03

nice start, but you should add anti randoms now

gl and keep it up!

HairyDuncan2

2007-09-19 01:23:23

Good job!

EDIT: I'm doing that RadialWalk tut now, so i'll reedit this post when it's done.

HyperSecret

2007-09-19 01:29:31

yes nice start, but like master said and also adding failsafe is a must especially for casting spells to make sure you have the right ammount of runes and all but keep it up

ammo2006

2007-09-19 01:36:59

This is what i have for anti randoms. Not shure its the best, but it's a start.

function FindFastRandoms: Boolean;
var
i: Integer;
begin
for i := 1 to 8 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
end;

Procedure Randoms;
begin
HighestAngle;
FindFastRandoms;
FindNormalRandoms;
FindLamp ('WoodCutting');
if (FindFight=True) then
begin
MakeCompass('N');
Wait(200 + random(300))
RunAwayDirection('N');
Wait(5000 + Random(1000));
MakeCompass('S');
RunBack;
SetRun(False);
end;
end;

JNCR

2007-09-19 12:35:07

Thanks, but how do I check for runes? I think that I use ExistsItem, but HOW?

sorry that I am new to scripting. i dont really know much but at least I'm trying :p.

thanks,
~JNCR

JNCR

2007-09-19 17:19:08

Nevermind the above.
:duh:

But i need help with this error:

Failed when compiling
Line 79: [Error] (13032:1): Unknown identifier 'Randoms' in script G:\SCAR\[SRL4] JNCR AutoTelly 1.0.scar

I just dont understand. it makes no sense. yes, there is a procedure named Randoms. im confused…. :confused:

{<><><><><><><><><><><><><><><><><><><><><><><><>)
{ }
{ [SRL4]AutoTelly 1.0 By JNCR }
{ }
{<><><><><><><><><><><><><><><><><><><><><><><><>}
program CammyTelly;
var
I : Integer;
O : Integer;
magiclevel1 : Integer;
magiclevel2 : Integer;
magiclevel3 : Integer;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Magic.scar}

{------------------------------------------------------------------------------}
{----------------------------------Setup---------------------------------------}
{------------------------------------------------------------------------------}

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

// For the Strings[0] you can put any of the following:
// Varrock Teleport
// Lumbridge Teleport
// Falador Teleport
// Camelot Teleport
// Ardougne teleport
// Trollheim Teleport

Players[0].Name :='user'; //Runescape Username
Players[0].Pass :='pass'; //Runescape Password
Players[0].Nick :='pass'; //3 of 4 Letters of Your Username
Players[0].Integers[0] := 30; //Teleports To Do
Players[0].Strings[0] := 'Camelot Teleport'; //Type of Teleport (Refer to Above)
Players[0].Active := True;
{
Players[1].Name :='user';
Players[1].Pass :='pass';
Players[1].Nick :='user';
Players[1].Integers[0] := 50;
Players[1].Strings[0] := 'Camelot Teleport';
Players[1].Active := True;

Players[2].Name :='user';
Players[2].Pass :='pass';
Players[2].Nick :='user';
Players[2].Integers[0] := 50;
Players[2].Strings[0] := 'Camelot Teleport';
Players[2].Active := True;

Players[3].Name :='user';
Players[3].Pass :='pass';
Players[3].Nick :='user';
Players[3].Integers[0] := 50;
Players[3].Strings[0] := 'Camelot Teleport';
Players[3].Active := True;
}
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;

{------------------------------------------------------------------------------}
{--------------------------------End of Setup----------------------------------}
{------------------------------------------------------------------------------}

Procedure Telly;
begin
I := 0
O := 0
repeat
if not(LoggedIn) then LoginPlayer;
cast(Players[CurrentPlayer].Strings[0]);
O := O + 1;
I := I + 1;
wait(500 + random(500));
Randoms;
until(I = Players[CurrentPlayer].Integers[0])
Writeln('Completed Teleporting');
Logout;
exit;
end;

Procedure Randoms;
begin
HighestAngle;
FindFastRandoms;
FindNormalRandoms;
If InAbyss Then
Begin
GuessAbyssRandom;
FindLamp ('Magic');
if (FindFight=True) then
begin
MakeCompass('N');
Wait(200 + random(300))
RunAwayDirection('N');
Wait(5000 + Random(1000));
MakeCompass('S');
RunBack;
SetRun(False);
end;
end;

function FindFastRandoms: Boolean;
var
i: Integer;
begin
for i := 1 to 8 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
end;

Function InAbyss: Boolean;

Var
A : Integer;

Begin
A := ScanMiniMap(0, 359, 50);
Status('In Abyss gave '+IntToStr(A)+'.');
If A = 360 Then
Begin
WriteLn('We are in the Abyss random.');
Result := True;
End
End;

Function GuessAbyssRandom: Boolean;

Var
AbyssalMark, iX, iY, I, ChosenColor, Tol, Tries: Integer;
WeirdColors: Array [0..3] Of Integer;
Operate: TPoint;
Begin
WeirdColors[0] := 13751777;
WeirdColors[1] := 4953873;
WeirdColors[2] := 2509833;
Repeat
Case Random(4) Of
0: Begin Operate.X := 252; Operate.Y := 150; End;
1: Begin Operate.X := 278; Operate.Y := 170; End;
2: Begin Operate.X := 238; Operate.Y := 200; End;
3: Begin Operate.X := 215; Operate.Y := 166; End;
End;

For I := 0 To 2 Do
Begin
Tol := 0;
Repeat
Tol := Tol + 1;
iX := MSCX;
iY := MSCY;
If FindColorSpiralTolerance(iX, iY, WeirdColors[I], MSX1, MSY1, MSX2, MSY2, Tol) Then
Begin
ChosenColor := WeirdColors[I];
If (Distance (iX, iY, MSCX, MSCY) < 120) Then Break;
End;
If ChosenColor <> 0 Then Break;
Until Tol > 9;
End;

If ChosenColor <> 0 Then
Begin
MMouse(iX, iY, 0, 0);
Wait(100);
If IsUpText('perate') Then
Begin
GetMousePos(iX, iY);
Mouse(iX, iY, 0, 0, True);
End;
End;

Wait(5000+Random(500));
If Not InAbyss Then
Begin
Abyss := Abyss + 1;
ReportVars[8] := ReportVars[8] + 1;
Result := True;
Wait(1000);
ClickToContinue;
SRLRandomsReport;
Exit;
End;
Tries := Tries + 1;
If TimeFromMark(AbyssalMark) > 60000 * 5 Then Break;
Until Tries > 30;

Tries := 0;
If InAbyss Then
Begin
Repeat
Case Random(4) Of
0: Begin Operate.X := 252; Operate.Y := 150; End;
1: Begin Operate.X := 278; Operate.Y := 170; End;
2: Begin Operate.X := 238; Operate.Y := 200; End;
3: Begin Operate.X := 215; Operate.Y := 166; End;
End;
iX := Operate.X;
iY := Operate.Y;
If FindColorSpiralTolerance(iX, iY, 3393, MSX1, MSY1, MSX2, MSY2, Tol)
Or FindColorSpiralTolerance(iX, iY, 2040150, MSX1, MSY1, MSX2, MSY2, Tol) Then
Begin
If (Distance (iX, iY, MSCX, MSCY) < 80) Then
Begin
MMouse(iX, iY, 0, 0);
Wait(100);
If IsUpText('perate') Then
Begin
GetMousePos(iX, iY);
Mouse(iX, iY, 0, 0, True);
Wait(5000+ Random(500));
If Not InAbyss Then
Begin
Abyss := Abyss + 1;
ReportVars[8] := ReportVars[8] + 1;
Result := True;
ClickToContinue;
SRLRandomsReport;
Exit;
End;
End;
End;
End;
Tries := Tries + 1;
Tol := Tol + 2;
If Tol > 20 Then Tol := 2;
Until Tries > 50;
End;
LogOut;
NOAbyss := NOAbyss + 1;
ReportVars[9] := ReportVars[9] + 1;
Players[CurrentPlayer].Loc := 'Abyss';
SRLRandomsReport;
WriteLn('Abyss Random Event.');
End;

begin
SetupSRL;
DeclarePlayers;
GetSelf.WindowState := wsMinimized;
MouseSpeed := 15 + random(3);
if not (LoggedIn) then LoginPlayer;
Telly;
GetSelf.WindowState := wsMaximized;
end.

lordcisco

2007-09-19 17:59:53

ok i was ok with the adding randoms part well as far as understanding it but definately lost me on the last one if you thought you were new im definately an oldschool newbie in ne type of scripting ill get there