Jump to content
  • 0

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


caspa

Question


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

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
Link to comment
Share on other sites

12 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

haha ...yaya you are right annie..xD

i alway forget the gettimestr ..

and initially i was script to make it show the peak of everyday...

but then changed to display 1 day only..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

[ 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
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

it's not from this script...it's your other script... "In-game control panel"

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

only my script use sscanf

weird, I thought latest revision already fix this error

http://rathena.org/board/tracker/issue-7059-sscanf-script-command-display-error-in-map-server/

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

@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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

@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

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

^_^ Edited by Capuche
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  308
  • Reputation:   24
  • Joined:  11/26/12
  • Last Seen:  

Link to comment
Share on other sites

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.

×
×
  • Create New...