Jump to content
  • 0

Server Online Peak By Day.......


Question

Posted (edited)

I would like to request a by day server peak....

like.......... monday's user peak is 47 then at 11:59 of monday the script would reset... and then start from 0 again and record the peak for tuesday.... and so on.....

Edited by caspa

12 answers to this question

Recommended Posts

Posted (edited)

Something like this ?

prontera,158,170,5	script	rtyui	78,{

if( .date$ == "" ) {
	mes "There is no record.";
	close;
}
explode( .@d$, .date$, " " );
mes "Max player online today at "+ .@d$[ 1 ] +" <3";
close;

OnPCLoginEvent:
explode( .@d$, .date$, " " );
if(  atoi( .@d$[ 0 ] ) != gettime(4) )
	.peak = 0;
if( getusers( 1 ) > .peak ) {
	.peak = getusers( 1 );
	.date$ = gettimestr("%d %H:%M:%S",21);
}
end;
}

Edited by Capuche
Posted (edited)

prontera,154,180,5    script    kjhfdkjsf    100,{
   if ( gettime(8) != .peak_date_time )
       callsub L_setpeak;
   mes "max online today is "+ .peak_date_num;
   close;
OnPCLoginEvent:
   callsub L_setpeak;
   end;
OnInit:
   sscanf $peak_date$, "%d %d", .peak_date_num, .peak_date_time;
   end;
L_setpeak:
   if ( getusers(1) <= .peak_date_num ) end;
   .peak_date_num = getusers(1);
   .peak_date_time = gettime(8);
   $peak_date$ = .peak_date_num +" "+ .peak_date_time;
   return;
}

@Capuche

your script will have bug, if say Tuesday there's nobody login on the 1st few hours of that day

it says 'today'... but it should be yesterday

@Emistry

much better, but you just always forgot about gettimestr

prontera,155,181,5    script    Sample    757,{
   mes gettimestr("%A",10) +" peaks : "+ $peak[gettime(4)];
   close;

OnPCLoginEvent:
   if ( getusers(1) > $peak[ gettime(4) ] )
       $peak[ gettime(4) ] = getusers(1);
   end;
}

EDIT: remove the useless gettime(7) ...

EDIT2: wahahaha Capuche post#10 damn fun !

Edited by AnnieRuru
  • Upvote 1
Posted (edited)

[ PROBLEM SOLVED ] ----- Thank you guyzzzzzzz =3

Oppsss....... Sorry for reviving this TOPIC but i suddenly get this kind of error........

post-3034-0-20483700-1359825160_thumb.jpg

Edited by caspa
Posted

sir........ i already separated the online peak from my in-game cp script and i still get the warning and debug.......... is there anyway to get a script like this but without the sscanf

Posted

@AnnieRuru

There is a small error in typo for .peak_date_time$

   .peak_date_time = gettime(8);
   $peak_date$ = .peak_date_num +" "+ .peak_date_time$;

>> .peak_date_time

  • Upvote 1
Posted

@AnnieRuru

There is a small error in typo for .peak_date_time$

.peak_date_time = gettime(8);
$peak_date$ = .peak_date_num +" "+ .peak_date_time$;

>> .peak_date_time

LMAO !!

actually the original script goes like this, which I did something according to my usual logic

prontera,154,180,5	script	kjhfdkjsf	100,{
mes "max server online was "+ .peak_date_num +" at "+ .peak_date_time$;
close;
OnPCLoginEvent:
if ( getusers(1) <= .peak_date_num ) end;
.peak_date_num = getusers(1);
.peak_date_time$ = gettimestr( "%A, %d/%b/", 20 ) + gettime(7) + gettimestr( " %I:%M:%S %p", 20 );
$peak_date$ = .peak_date_num +" "+ .peak_date_time$;
end;
OnInit:
sscanf $peak_date$, "%d %40c", .peak_date_num, .peak_date_time$;
end;
}

I reread the request again and found out its not in the request

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...