SRL Archive - SRL Archives

TrueOther


Harry

2007-07-10 21:41:27

It is kinda the same as http://www.srl-forums.com/forum/player-priorities-p156755.html#post156755 .

But heres how I explain it.. I am running Sum Power Miner, and I have 12 players total. The players I want 60 mining are players 0-5. So Active=True.. the 6-11 are just noobs to keep the script running (for proggies :D )

So 6-11, active would be "TrueOther" so after 0-5 is false from some random like scaperune, it will run 6-11..

Sound good? It does to me! :D

-Harry

Harry

2007-07-11 11:47:55

? Any Ideas ?

JAD

2007-07-11 12:16:50

I'm not sure if there is a function called no more players active.. If there isn't then just make your own :p But you could just set the players you want to auto with first (0-5) to active, and the others to active false. Then, do this:


var I: Integer;

begin
repeat
//main loop stuff
if(NoMorePlayersActive)tehn
begin
for I := 6 to 10 do
Players[I].Active := True;
end;
until(False);
end.

Get it? =) Once those players you want to auto with mainly are done, it will set the other batch to true, so it will auto with those.

Pentti

2007-07-11 12:17:33

Hy: http://www.srl-forums.com/forum/player-priorities-p156755.html#post156755
Isnt that just the same thing you are talking about?

Harry

2007-07-11 12:22:21

I said that in the first post.. but my idea is a little different.. easier to put into scripts. :D

XcanadamanX

2007-07-11 12:38:14

im sure its the exact same thing

The script first starts on his lv60+ characters, the script doesn't use the lv16 characters.
But after 6 hours, all of his elite characters are false. He got like 400 iron an hour, so he'll earn some nice profit.
Now all his priority 0 chars are false, it'll switch over to the priority 1 chars, they are lower mining, but instead of earning no iron (all his high level chars are false), it'll continue on his lower level chars, instead of 0 iron now, it'll keep mining (but a bit slower), so he'll still earns profit.


what you said is basically that in a nutshell

shaunthasheep

2007-07-11 13:04:54

yea, just declare this with the other variables at the top of the script:

var
CurrentPrioritie : integer;
HighestPrioritie : integer;

replace declareplayers with this
your good miners prioritie 0, noobs prioritie 1
remember to change highestprioritie

procedure DeclarePlayers;
begin
HowManyPlayers := 9; //No CurrentPlayer, The priorities will sort that out
CurrentPrioritie := 0; //Will start at this priorite, stops at highest prioritie (last group of players)
HighestPrioritie := 5;
NumberOfPlayers(HowManyPlayers);

Players[0].Name :='apple0';
Players[0].Integer1 := 0; //Prioritie
Players[0].Active:= True;

Players[1].Name :='bill1';
Players[1].Integer1 := 1; //Prioritie
Players[1].Active:= True;

Players[2].Name :='chicken3';
Players[2].Integer1 := 3; //Prioritie
Players[2].Active:= True;

Players[3].Name :='dewww1';
Players[3].Integer1 := 1; //Prioritie
Players[3].Active:= True;

Players[4].Name :='eww2';
Players[4].Integer1 := 2; //Prioritie
Players[4].Active:= True;

Players[5].Name :='failure2';
Players[5].Integer1 := 2; //Prioritie
Players[5].Active:= True;

Players[6].Name :='giggity5';
Players[6].Integer1 := 5; //Prioritie
Players[6].Active:= True;

Players[7].Name :='holley5';
Players[7].Integer1 := 5; //Prioritie
Players[7].Active:= True;

Players[8].Name :='import6'; //shouldn't play, prioritie 6.
Players[8].Integer1 := 6; //Prioritie
Players[8].Active:= True;

end;

add these 3 functions anywhere:

function AnyActive(Prioritie : integer) : boolean;
var
i, a : integer;
begin
a := GetArrayLength(Players) - 1;
for i := 0 to a do
if Players[i].integer1 = Prioritie then
if Players[i].Active then
begin
Result := True;
Exit;
end;
end;

function IsLastActiveInPrioritie(Player, Prioritie : integer) : boolean;
var
i,a : integer;
begin
result := True;
a := GetArrayLength(Players) - 1;
if Player = a then Exit;
for i := Player + 1 to a do
if Players[i].Active then
if Players[i].Integer1 = Prioritie then
begin
Result := False
Exit;
end;
end;

procedure PNextPlayer(active : boolean);
var
i, a : integer;
firstloop : boolean;
begin
Players[CurrentPlayer].Active := active;
if AnyActive(CurrentPrioritie) then
begin
a := GetArrayLength(Players) - 1;
if IsLastActiveInPrioritie(CurrentPlayer, CurrentPrioritie) then
CurrentPlayer := -1;
for i := CurrentPlayer + 1 to a do
if Players[i].Integer1 = CurrentPrioritie then
if Players[i].Active then
begin
CurrentPlayer := i;
LoginPlayer;
Writeln(Players[i].Name);
Exit;
end;
end else
begin
if CurrentPrioritie = HighestPrioritie then
begin
if not AnyActive(HighestPrioritie) then
begin
Writeln('No More Players! Terminating!');
TerminateScript;
end;
end;
CurrentPrioritie := CurrentPrioritie + 1;
PNextPlayer(Active);
end;
end;

Edit -> Replace in script

NextPlayer

with

PNextPlayer

Its pretty much does what you say =S just a bit more complicated.. overall, it gets the job done.

Harry

2007-07-11 13:45:39

Ah.. ok, thanks! I will try to implant it into my next script.. muhaha.

Johura

2007-07-12 05:08:45

Hold on. So say there is 8 players, it will do 1,2,3,4 but in case 3 gets stuck in a random it will then do 1,2,4,5 ??

shaunthasheep

2007-07-12 10:37:32

no.

say there are 8 players. # 0 - 4 are your good miners (say 60+) and 5-8 are your noobs.

you set 0 - 4 on prioritie 0.
then you set 5-8 on prioritie 1.

it will only run on players 0 - 4 since there prioritie 0 (first).
once all 5 players(0,1,2,3,4) are fale, then it will start autoing on prioritie 1, which is 5-8 players.

n3ss3s

2007-07-18 09:52:20

Damit im kinda late but this works, no extra variables needed, short code:


function NoPlayersActive(FromP, ToP: Integer): Boolean;
// by n3ss3s
var
F: Integer;
AnyActive: Boolean;
begin
for F := FromP to ToP do
begin
if(Players[F].Active)then
begin
AnyActive := True;
end;
end;
Result := AnyActive;
end;
Owned :spot: