SRL Archive - Outdated / Broken

East Varrock Power miner/Banker


The Un-Named

2007-03-03 20:31:30

East Varrock Power miner with Banking ability's


Yes, hopefully I've returned for good. I didn't write this script in mind for it to be released, but then why keep it for me? :p It can power mine either copper or iron, it can bank either copper or iron. I haven't tested it properly but the mining works perfect. It has no progress report(if someone would like to teach me how to use SRL's progress report properly I'd be grateful :)), but it does work.

How to use:-


Players[0].Name :='hawkr882';
//Character Name
Players[0].Pass :='9s2msa';
//Character Password
Players[0].Nick :='wkr';
//A (unique) part of the name
Players[0].Loc :='EVarMns';
//The location of the player(EVarBnk for east varrock bank, EVarMns for east varrock mines)
Players[0].Ore :='copper';
// Ore to mine(copper or iron, lowercase)
Players[0].Integer1 := 100;
//Total ores to mine
Players[0].Boolean1 := False;
//Do you want to bank the ores? True or False
Players[0].Skill :='Mining';
//Lamp skill

Known Bugs
Banking might deposit your pickaxe.

Thank you for taking a look, and please post all bugs you encounter. :)

Ejjman

2007-03-03 21:02:45

Sweet dude u releaseed! Maybe people who don't feel like Wizzup? will use, which I really hope will happen. U rox.

WhiteShadow

2007-03-03 21:32:38

GOOOOOOOD JOB.

477 lines too, nice job foo. :D


What's not to get with the progress reports?

Haha.

Well, look up a PlayerStats from any script, your good enough to learn right? :D

The Un-Named

2007-03-03 22:00:07

From: WhiteShadow
GOOOOOOOD JOB.

477 lines too, nice job foo. :D


What's not to get with the progress reports?

Haha.

Well, look up a PlayerStats from any script, your good enough to learn right? :D


I'm not around SRL enough and there's no real tuts for it. I'd gladly look up the manual for a SRL progress report procedures but then I need to look up the code to see how to use them. :( I'll do them next version.

WhiteShadow

2007-03-03 23:09:31

From: The Un-Named
I'm not around SRL enough and there's no real tuts for it. I'd gladly look up the manual for a SRL progress report procedures but then I need to look up the code to see how to use them. :( I'll do them next version.


Well basically think of regular array and how you use for to do to loop through them; for i:= 0 to HowManyPlayers - 1 do.
So it loops through the Player numbers i.e : Players[0], Players[1], Players[2], ect until it meets the do, (which i'm sure you probably already know so I'llmove on).

  for i := 0 to HowManyPlayers - 1 do
begin
if(Players[i].Active = True)then
Active := 'True'
else
Active := 'False';

If Players.Active is true then the variable active string for this loop is true.

Here are other arguments for Players[].

type
TUser = record
Name: string; // * User Name
Pass: string; // * User Pass
Nick: string; // * Screen Name for random detection
Active: Boolean; // * Set to True if Ok, False if Lost.
Loc: string; // * User Location
Skill: string; // * User Action to Perform
Level: array[0..21] of word;
// * Levels of all skills. SetIn GetPlayerLevels.
Ore: string; // * test
WaitTime: Integer; // * Wait Time for Each User, Good for Autofighters
Fight: Boolean; // * If we want the Char to randomly fight
Worked: Integer; // * Time User has worked
Banked: Integer; // * Number of Banks User has done
Killed: Integer; // * Number of Kills User has made
Boolean1: Boolean; // * For reports, etc.
Boolean2: Boolean; // * For reports, etc.
Boolean3: Boolean; // * For reports, etc.
Integer1: Integer; // * For reports, etc.
Integer2: Integer; // * For reports, etc.
Integer3: Integer; // * For reports, etc.
Integer4: Integer; // * For reports, etc.
String1: string; // * For reports, etc.
String2: string; // * For reports, etc.
String3: string; // * For reports, etc.
Extended1: Extended; // * For reports, etc.
Extended2: Extended; // * For reports, etc.
Extended3: Extended; // * For reports, etc.
end;

For example you can use Integer1 to hold it's mining lvl. So sometime before writing in the progress report use:

Players[CurrentPlayer].Integer1:= GetSkillLevel('Mining');

CurrentPlayer is set by NextPlayer ( in your case RRandomPlayer) they always update the variable for you. :P

Then you could add that in your for loop also. I hope I'm making sense but sorry I'm partly in a rush.

Whole thing I took from a private Chopper;

procedure PlayerStats;
var
Active: string;
i : Integer;
begin
Writeln('****************************************************');
Writeln(' Name : '+ Players[CurrentPlayer].Name);
Writeln(' Number : '+ IntToStr(CurrentPlayer));
Writeln(' Worked : '+ IntToStr (Players[CurrentPlayer].Worked)+' minutes.');
Writeln(' Banked : '+ IntToStr (Players[CurrentPlayer].Banked) + ' loads.');
Writeln(' Location: '+ Players[CurrentPlayer].loc);
Writeln(' Level : '+ IntToStr(Players[CurrentPlayer].Integer1));
Writeln('****************************************************');
for i := 0 to HowManyPlayers - 1 do
begin
if(Players[i].Active = True)then
Active := 'True'
else
Active := 'False';
Writeln (IntToStr(i) + ' : '+Players[i].Name + ' = ' + Active + '. - Lvl: '+IntToStr(Players[i].Integer1)+
'. - B :'+IntToStr (Players[i].Banked)+' times.'+
' - '+IntToStr (Players[i].Worked)+' mins.'+' - Loc: '+Players[i].loc);
end;
Writeln('*****************************************************');
end;

Then in your progress report just put PlayerStats;
under it.

haha, i hope that helps. :\

:D

Here I wrote this just now, maybe this could help. It basically works just like what you want.

program New;

procedure RegularArray;
var
haha : array of String;
i, baDump : Integer;
begin
ClearDebug;
SetArrayLength(haha, 3); // aka HowManyPlayers:= 3;
haha[0]:= 'lala'; // like DeclarePlayers?
haha[1]:= 'tsins'; // ""
haha[2]:= 'hausdhan'; // ""
for i:= 0 to getarraylength(haha) - 1 do
begin
Writeln(haha[i]);
Writeln(Chr(32)); // justlike Writeln('');btw..
end;
end;

begin
Regulararray;
end.

I'm SOOO SORRY i didn't just PM you this, but I was hoping other people who needed help could see this.. >.<

Btw, your coding is shoooo pretty.<3

The Un-Named

2007-03-03 23:18:46

From: WhiteShadow
Well basically think of regular array and how you use for to do to loop through them; for i:= 0 to HowManyPlayers - 1 do.
So it loops through the Player numbers i.e : Players[0], Players[1], Players[2], ect until it meets the do, (which i'm sure you probably already know so I'llmove on).

  for i := 0 to HowManyPlayers - 1 do
begin
if(Players[i].Active = True)then
Active := 'True'
else
Active := 'False';

If Players.Active is true then the variable active string for this loop is true.

Here are other arguments for Players[].

type
TUser = record
Name: string; // * User Name
Pass: string; // * User Pass
Nick: string; // * Screen Name for random detection
Active: Boolean; // * Set to True if Ok, False if Lost.
Loc: string; // * User Location
Skill: string; // * User Action to Perform
Level: array[0..21] of word;
// * Levels of all skills. SetIn GetPlayerLevels.
Ore: string; // * test
WaitTime: Integer; // * Wait Time for Each User, Good for Autofighters
Fight: Boolean; // * If we want the Char to randomly fight
Worked: Integer; // * Time User has worked
Banked: Integer; // * Number of Banks User has done
Killed: Integer; // * Number of Kills User has made
Boolean1: Boolean; // * For reports, etc.
Boolean2: Boolean; // * For reports, etc.
Boolean3: Boolean; // * For reports, etc.
Integer1: Integer; // * For reports, etc.
Integer2: Integer; // * For reports, etc.
Integer3: Integer; // * For reports, etc.
Integer4: Integer; // * For reports, etc.
String1: string; // * For reports, etc.
String2: string; // * For reports, etc.
String3: string; // * For reports, etc.
Extended1: Extended; // * For reports, etc.
Extended2: Extended; // * For reports, etc.
Extended3: Extended; // * For reports, etc.
end;

For example you can use Integer1 to hold it's mining lvl. So sometime before writing in the progress report use:

Players[CurrentPlayer].Integer1:= GetSkillLevel('Mining');

CurrentPlayer is set by NextPlayer ( in your case RRandomPlayer) they always update the variable for you. :P

Then you could add that in your for loop also. I hope I'm making sense but sorry I'm partly in a rush.

Whole thing I took from a private Chopper;

procedure PlayerStats;
var
Active: string;
i : Integer;
begin
Writeln('****************************************************');
Writeln(' Name : '+ Players[CurrentPlayer].Name);
Writeln(' Number : '+ IntToStr(CurrentPlayer));
Writeln(' Worked : '+ IntToStr (Players[CurrentPlayer].Worked)+' minutes.');
Writeln(' Banked : '+ IntToStr (Players[CurrentPlayer].Banked) + ' loads.');
Writeln(' Location: '+ Players[CurrentPlayer].loc);
Writeln(' Level : '+ IntToStr(Players[CurrentPlayer].Integer1));
Writeln('****************************************************');
for i := 0 to HowManyPlayers - 1 do
begin
if(Players[i].Active = True)then
Active := 'True'
else
Active := 'False';
Writeln (IntToStr(i) + ' : '+Players[i].Name + ' = ' + Active + '. - Lvl: '+IntToStr(Players[i].Integer1)+
'. - B :'+IntToStr (Players[i].Banked)+' times.'+
' - '+IntToStr (Players[i].Worked)+' mins.'+' - Loc: '+Players[i].loc);
end;
Writeln('*****************************************************');
end;

Then in your progress report just put PlayerStats;
under it.

haha, i hope that helps. :\

:D

Here I wrote this just now, maybe this could help. It basically works just like what you want.

program New;

procedure RegularArray;
var
haha : array of String;
i, baDump : Integer;
begin
ClearDebug;
SetArrayLength(haha, 3); // aka HowManyPlayers:= 3;
haha[0]:= 'lala'; // like DeclarePlayers?
haha[1]:= 'tsins'; // ""
haha[2]:= 'hausdhan'; // ""
for i:= 0 to getarraylength(haha) - 1 do
begin
Writeln(haha[i]);
Writeln(Chr(32)); // justlike Writeln('');btw..
end;
end;

begin
Regulararray;
end.

I'm SOOO SORRY i didn't just PM you this, but I was hoping other people who needed help could see this.. >.<

Btw, your coding is shoooo pretty.<3


Thanks. I'll work something out for the next version. :) I like your coding too. :spot:

WhiteShadow

2007-03-07 18:53:43

begin
ActivateClient;
DeclarePlayers;
DeclareOres;
SetupSRL;
LoadBitmapsAndDtms;
if FindDTM(Road, x, y, 550, 6, 753, 176) then
RoadColor := GetColor(x + 5, y);
if not(LoggedIn) then RRandomNextPlayer(True);
repeat
Mine;
until False;
end.

Looks like an incomplete main loop to me. haha

The Un-Named

2007-03-07 18:56:12

From: WhiteShadow
begin
ActivateClient;
DeclarePlayers;
DeclareOres;
SetupSRL;
LoadBitmapsAndDtms;
if FindDTM(Road, x, y, 550, 6, 753, 176) then
RoadColor := GetColor(x + 5, y);
if not(LoggedIn) then RRandomNextPlayer(True);
repeat
Mine;
until False;
end.

Looks like an incomplete main loop to me. haha



Everything is done in the mining procedure, and I'd presume SRL stops the script once there are no active members so that solves the infinite loop.

WhiteShadow

2007-03-07 19:03:26

procedure Mine;
begin
if Players[CurrentPlayer].Loc = 'EVarMns' then
begin
if InventoryFull then
begin
if Players[CurrentPlayer].Boolean1 then
begin
WalkToBank;
WalkToMine;
end else
Drop2;
end
end;

HitRock(LowerCase(Players[CurrentPlayer].Ore));
Writeln('Hit the rock');

if (Players[CurrentPlayer].Integer2 >= Players[CurrentPlayer].Integer1) then
RRandomNextPlayer(False);
end;

Then when does if current loc is EVarBnk come into play?

The Un-Named

2007-03-08 03:29:46

From: WhiteShadow
procedure Mine;
begin
if Players[CurrentPlayer].Loc = 'EVarMns' then
begin
if InventoryFull then
begin
if Players[CurrentPlayer].Boolean1 then
begin
WalkToBank;
WalkToMine;
end else
Drop2;
end
end;

HitRock(LowerCase(Players[CurrentPlayer].Ore));
Writeln('Hit the rock');

if (Players[CurrentPlayer].Integer2 >= Players[CurrentPlayer].Integer1) then
RRandomNextPlayer(False);
end;

Then when does if current loc is EVarBnk come into play?


In the PlayerSetup procedure, if if finds the bank symbol it will walk to the mines. I'll fix it up later on tonight. :P