SRL Archive - Help and Support

Help with Players[x].Worked.


Wanted

2007-06-19 20:27:08

Hello, I'm trying to use the .Worked variable in the player array types.

Unfortunately, all I'm getting in my progress report is
-- Work: 0 mins.

I'm not doing anything for it, just using
WriteLn(' -- Work: ' + IntToStr(Players[I].Worked) + ' mins.');

Is there something else I need to do to other than just use it? because right now It's just a zero…

Thanks,

IceFire.

WhiteShadow

2007-06-19 20:28:28

It should show after the next player is logged in.

Wanted

2007-06-19 20:30:11

Is there anything I can do to avoid that? In other words, make it pick up before that happens?

Bobarkinator

2007-06-19 20:38:41

No. If you want to get the time while it is running you would have to ues a time mark

Wanted

2007-06-19 21:20:15

Oh, I see…

When the character logs out then it uses TimeFromMark, gotcha..

I need to find a way were it only displays the worked time for players who aren't currently being used, any ideas?

WhiteShadow

2007-06-19 21:50:00

From: Icefire908
Oh, I see…

When the character logs out then it uses TimeFromMark, gotcha..

I need to find a way were it only displays the worked time for players who aren't currently being used, any ideas?


When it hasn't been used yet (or it hasn't logged out yet….) it should always display 0 mins. If it is used before however, it displays the old time in minutes. Hopefully that's what you meant. ;D

Wanted

2007-06-19 22:09:31

I mean, like in my proggy report I don't want inaccurate time displaying, so I need a way of only showing the minutes worked for players who aren't currently being used…

Dark_Sniper

2007-06-19 22:34:44

mark time and time from mark?


ok make an array of integer….


here let me make an example…


hopefuly you get what i mean:

var
I : Integer;
PlayerI : Array of Integer;

begin
MarkTime(I)
//bah blah
PlayerI[currentPlayer]:=TimeFromMark(I);
end;



and add this if you want it in mins:
PlayerI[currentPlayer]:=((TimeFromMark(I)/ 1000) / 60)

Wanted

2007-06-19 22:46:07

Ok thanks.

Dark_Sniper

2007-06-19 22:47:40

np.. if you have any errors with that just ask me… that was off the top of my head………. i wrote the code in my post and not scar i think it looks about right :\

Pentti

2007-06-20 07:32:27

Integer Worked is used in SRL stats sytstem, so I think its zero because SRLRandomsReport makes it's value to 0 everytime when report is sent to SRL.

Also there is PlayerStarTime, which is time from that when player logs in, it returns as seconds.

grindisbest

2007-06-20 21:21:00

Add PTime and FTime as integer globals and player in a string global then run this procedure after logins. It will count up the time for you and add it into Worked. Personly I run this in the progress procedure so each time I give a progress it has live updates, and it saves it's own time so that it doesn't reset each time you run it.

procedure Playertiming;
begin
if Player=Players[CurrentPlayer].Name then
begin
FTime := FTime + TimeFromMark(PTime);
MarkTime(PTime);
Players[CurrentPlayer].Worked := (FTime/1000)/60;
end else
begin
Player:=Players[CurrentPlayer].Name;
MarkTime(PTime);
FTime := 0;
end;
end;

Wanted

2007-06-20 23:21:54

From: grindisbest
Add PTime and FTime as integer globals and player in a string global then run this procedure after logins. It will count up the time for you and add it into Worked. Personly I run this in the progress procedure so each time I give a progress it has live updates, and it saves it's own time so that it doesn't reset each time you run it.

procedure Playertiming;
begin
if Player=Players[CurrentPlayer].Name then
begin
FTime := FTime + TimeFromMark(PTime);
MarkTime(PTime);
Players[CurrentPlayer].Worked := (FTime/1000)/60;
end else
begin
Player:=Players[CurrentPlayer].Name;
MarkTime(PTime);
FTime := 0;
end;
end;


Wow, thanks!

Pentti

2007-06-21 04:56:30

I'm not sure if you should use worked variable… look this link: http://www.srl-forums.com/forum/showpost.php?p=97579&postcount=5

Yea… But still… Hmm.. Look at this link, this is how you do it right: http://www.srl-forums.com/forum/showpost.php?p=97627&postcount=6

Well, when you add worked variable wrong, this is what follows:

http://www.villavu.com/forum/showthread.php?t=7885
http://www.villavu.com/forum/showthread.php?t=10283
http://www.villavu.com/forum/showthread.php?t=7883

So you can decide by yourself. :D

Wanted

2007-06-21 13:42:05

Oh is that what happened with JuKKa having like 249857372 mins, I thought he was just screwin around haha.

Dark_Sniper

2007-06-21 14:01:55

he was screwing around :p

and then did it intensionally.

so ya just setup a new var like..

MarkTime(Player[currentplayer].integer1)


just replace worked with integer1…..





like so :

procedure Playertiming;
begin
if Player=Players[CurrentPlayer].Name then
begin
FTime := FTime + TimeFromMark(PTime);
MarkTime(PTime);
Players[CurrentPlayer].integer1:= (FTime/1000)/60;
end else
begin
Player:=Players[CurrentPlayer].Name;
MarkTime(PTime);
FTime := 0;
end;
end;

Wanted

2007-06-21 19:28:51

Ha, ok..

Lol, Pin is the only integer left I haven't used in my rune crafter, I guess I'll start having to make an extra array after this :sasmokin: