Jump to content
  • 0

Can I request Script every 5min log in BC online status


Question

13 answers to this question

Recommended Posts

Posted (edited)

every 5 minute's there will be auto announcer that will broadcast  the status online of the server in all maps.. 

Edited by zhen
Posted (edited)

Untested.
 

-    script    whoisonline    -1,{
OnMinute05:
set .@h, query_sql("SELECT `online`  FROM `char` WHERE `online` = '1';");
announce "There "+(.@h>1)?"are":"is"+" currently "+.@h+" "+(.@h>1)?"people":"person"+" online!",0;
end;
}
Edited by Skorm
Posted
OnMinute05:

He want every 5 min not at 5 min (I think)

 

set .@h, query_sql("SELECT `online`  FROM `char` WHERE `online` = '1';");

Use the command Getusers

 

 

 

 

 

 

 

 

-	script	sample	-1,{
OnInit:
	while(1) {
		sleep 1000 * 60 * 5; // delay = 5 mins
		.@count = getusers(1);
		announce "There "+ ( .@count > 1 ? "are" : "is" ) +" currently "+ .@count +" "+ ( .@count > 1 ? "people" : "person" ) +" online!",0;
	}
}
  • Upvote 1
Posted (edited)
prontera.gat,146,163,3    script    Online Users    833,{
OnInit:
while (1) {
.@u = getusers(1);
delwaitingroom;
waitingroom "There "+((.@u>1||.@u<1)?"are":"is")+" currently "+.@u+" "+((.@u>1||.@u<1)?"people":"person")+" online!",0;
sleep 1000*60*5;
}
}
Edited by Skorm
Posted

You could also trigger the count to update when a player logs in/out.

prontera,155,180,0	script	Online Count	837,{

end;

OnPCLoginEvent:

OnPCLogoutEvent:

// sleep 1000; // I'm not sure if online count updates before or after Login/Logout events trigger

delwaitingroom;

waitingroom getusers(1)+" "+( (getusers(1)==1) ? "user" : "users" )+" online", 0;

end;

}

Posted

You could also trigger the count to update when a player logs in/out.

prontera,155,180,0	script	Online Count	837,{
	end;
OnPCLoginEvent:
OnPCLogoutEvent:
	// sleep 1000; // I'm not sure if online count updates before or after Login/Logout events trigger
	delwaitingroom;
	waitingroom getusers(1)+" "+( (getusers(1)==1) ? "user" : "users" )+" online", 0;
	end;
}

 

 

Yeah that would probably be best unless you had like 300+ players. :)

Also I wanted to ask how to keep tabs in code posted O_O I remember from eAthena you had to use /

 that doesn't seem to work here.
Posted

Just use [ code ]

You can also click the "code" button code.png then paste your code there. If the Rich Text editor is removing your tabs, try switching to the plain text editor (click the first button that looks like a light switch).

Posted

You could also trigger the count to update when a player logs in/out.

prontera,155,180,0	script	Online Count	837,{
	end;
OnPCLoginEvent:
OnPCLogoutEvent:
	// sleep 1000; // I'm not sure if online count updates before or after Login/Logout events trigger
	delwaitingroom;
	waitingroom getusers(1)+" "+( (getusers(1)==1) ? "user" : "users" )+" online", 0;
	end;
}

 

i have to relog then will see how much online :)

nice bro. haha~

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