PDA

View Full Version : New RC Announcer


xXziroXx
06-07-2008, 10:55 PM
Well, a system that can be useful to inform staff about new tasks etc., or a staff newsletter - whatever floats your boat!

Paste this script into a database NPC:

function onCreated()
{
if (this.remotecontrols == NULL) {
for (pl: allplayers) {
if (pl.level.name == NULL) this.remotecontrols.add(pl.account);
}
}
setTimer(1);
}

function onTimeOut()
{
for (pl: allplayers) {
if (pl.level.name == NULL) temp.remotecontrols.add(pl);
}

for (pl: temp.remotecontrols) {
if (!(pl.account in this.remotecontrols)) {
temp.remotecontrols[temp.var].sendPM("No slacking, get to work!");
sendToRC("Welcome" SPC (temp.remotecontrols[temp.var].communityname == NULL ? temp.remotecontrols[temp.var].account : temp.remotecontrols[temp.var].communityname) @ "! You have received a new PM!");
}
temp.var ++;
}
this.remotecontrols = temp.remotecontrols;
setTimer(1);
}


Gosh I'm so bored... :cry:

Deas_Voice
06-07-2008, 10:58 PM
nice,
no time to test it thought,
but doas onCreated get calld then someone log in too?

Tigairius
06-07-2008, 11:02 PM
I don't like the serverside timer of 1 for something so useless :x I think a timer of 2 or 3 would get the job done just as effectively in this case.

xXziroXx
06-07-2008, 11:23 PM
but doas onCreated get calld then someone log in too?

No, it's not supposed too.

I don't like the serverside timer of 1 for something so useless :x I think a timer of 2 or 3 would get the job done just as effectively in this case.

Definitely, even up to 5 would work perfectly. But in the end, it depends on how much lag it's causing. For example... while a timer of 1 might work fine on your average UC server, a timer of 5 would be more suited for Zodiac/Era etc.

cbk1994
06-07-2008, 11:39 PM
Definitely, even up to 5 would work perfectly. But in the end, it depends on how much lag it's causing. For example... while a timer of 1 might work fine on your average UC server, a timer of 5 would be more suited for Zodiac/Era etc.

Why should a UC server have to worry about lag any less?

It's best to have your scripts lag-free, regardless of the server.

Making the scripts suck because it's a UC server is like saying "this server will never take off, so it's okay if the scripts suck".

Tigairius
06-07-2008, 11:45 PM
Making the scripts suck because it's a UC server is like saying "this server will never take off, so it's okay if the scripts suck".

Similar to how I was talking to some lady the other day and she told me, "It's okay to burn tires out here because we live in the coutry." She doesn't realize your carbon footprint is the same size regardless of where you live... -_-

xXziroXx
06-08-2008, 12:04 AM
Simply because a UC server can afford to "gimp" itself in some areas due to not getting as much strain on it, compared to a server with 100+ players.

cbk1994
06-08-2008, 12:11 AM
Simply because a UC server can afford to "gimp" itself in some areas due to not getting as much strain on it, compared to a server with 100+ players.

But then if it becomes popular (lol) everything has to be rescripted.

See Zodiac.

xXziroXx
06-08-2008, 01:27 AM
But then if it becomes popular (lol) everything has to be rescripted.

We're talking about changing a timer in one script... I think we're making a hen out of a feather here. >_<

cbk1994
06-08-2008, 02:38 AM
We're talking about changing a timer in one script... I think we're making a hen out of a feather here. >_<

Yes, but what purpose does a timeout of one versus five or even ten serve?

xXziroXx
06-08-2008, 02:40 AM
Yes, but what purpose does a timeout of one versus five or even ten serve?

It might not be much, but I'm sure it'd be noticeable depending on how many players you have.

Looping through 20 people every 1 second might not be too CPU heavy, but I'm sure looping through 150 of them every 1 second would be.

cbk1994
06-08-2008, 02:42 AM
It might not be much, but I'm sure it'd be noticeable depending on how many players you have.

Looping through 20 people every 1 second might not be too CPU heavy, but I'm sure looping through 150 of them every 1 second would be.

That's not what I meant to say; my bad.

I was saying why do you need a timeout of 1 when five or ten works just as well?

Even on Utopia where we only had ~30 players, we would use 5 or 10 second timeouts whenever possible.

xXziroXx
06-08-2008, 02:52 AM
That's not what I meant to say; my bad.

I was saying why do you need a timeout of 1 when five or ten works just as well?

Even on Utopia where we only had ~30 players, we would use 5 or 10 second timeouts whenever possible.

It's up to personal choise. Have it at 1, 5, 10 seconds - whatever you want. Does it matter for most? No, not really.