Jump to content

Question

9 answers to this question

Recommended Posts

Posted

OnPCLogin:
iLoop:
sleep2 3600000;
set @playhour,@playhour+1;
dispbottom "You have been playing for "+ @playhour +" hour(s)";
goto iLoop;
end;

There, that should do what you want... its been nearly 4years since i've been active in the scripting community, but I'm starting to come back, bigger and harder than ever, with the release of several advanced scripts, never before seen. So until then, I appologize if its bugged...

Basically, when a player logs on, it will do nothing for exactly 1 hour, after that, it will announce to the player only, that they have been on for X amount of hours, and will repeat the proccess every hour.

Posted

I see, thats nice.. but i thought like an npc for this:

[acc infos]

mes "overall playtime xx:xx hours/days";

mes "playtime today: xx:xx";

mes "login count: xxx";

etc.?

more like this x_x

Posted
poring_c01,100,100,0	script	TotalTimeOnline	910,{
mes "[Acc Infos]";
mes "For your account, you have been online a total of:";
mes callsub(S_SecToTime, @login_time ? (#secs_online + (gettimetick(2)-@login_time)) : #secs_online);

mes "Playtime today: " + callsub(S_SecToTime, (gettimetick(2)-@login_time));

query_sql "SELECT logincount FROM login WHERE account_id='"+playerattached()+"'", .@logincount;
mes "Login Count: " + .@logincount;
close;

S_SecToTime:
set .@seconds, getarg(0);

set .@seconds, .@seconds - set(.@weeks, .@seconds / 604800)*604800;
set .@str$, .@str$ + .@weeks+((.@weeks==1) ? " week":" weeks")+", ";

set .@seconds, .@seconds - set(.@days, .@seconds / 86400)*86400;
set .@str$, .@str$ +  .@days+((.@days==1) ? " day":" days")+", ";

set .@seconds, .@seconds - set(.@hours, .@seconds / 3600)*3600;
set .@str$, .@str$ +  .@hours+((.@hours==1) ? " hour":" hours")+", ";

set .@seconds, .@seconds - set(.@mins, .@seconds / 60)*60;
set .@str$, .@str$ +  .@mins+((.@mins==1) ? " min":" mins")+", and ";

set .@str$, .@str$ +  .@seconds+((.@seconds==1) ? " second":" seconds");

return .@str$;

OnPCLoginEvent:
set @login_time, gettimetick(2);
end;
OnPCLogoutEvent:
if (@login_time)
	set #secs_online, #secs_online + (gettimetick(2)-@login_time);
end;
}

  • Upvote 1
Posted

i dont think there is a way for this...we cant calculate how long a players has been online for the past 2 month...

we wont know how long they have online during the 2 month...

  • Upvote 1
Posted

hmm, theres maybe a way to display the date when the char was created, the charlog saves it:

2012-05-22 05:40:53

name: blabla

char_msg: create new char

this is how the sql table looks.

  • Upvote 1
Posted

hmm.. what about an login count ladder? like top 3 login accounts?

probably it should show charnames instead of accnames

Top 3 Logins:

Playername / Logins: xxxx

Playername / Logins: xxxx

Playername / Logins: xxxx

this would be nice i guess.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...