Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-07-2008, 10:55 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
New RC Announcer

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:
Graal Script Code:
function onCreated()
{
  if (
this.remotecontrols == NULL) {
    for (
plallplayers) {
      if (
pl.level.name == NULLthis.remotecontrols.add(pl.account);
    }
  }
  
setTimer(1);
}

function 
onTimeOut()
{
  for (
plallplayers) {
    if (
pl.level.name == NULLtemp.remotecontrols.add(pl);
  }
  
  for (
pltemp.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...
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto

Last edited by xXziroXx; 06-07-2008 at 11:27 PM..
Reply With Quote
  #2  
Old 06-07-2008, 10:58 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
nice,
no time to test it thought,
but doas onCreated get calld then someone log in too?
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #3  
Old 06-07-2008, 11:02 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
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.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #4  
Old 06-07-2008, 11:23 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Deas_Voice View Post
but doas onCreated get calld then someone log in too?
No, it's not supposed too.

Quote:
Originally Posted by Tigairius View Post
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.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #5  
Old 06-07-2008, 11:39 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
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".
__________________
Reply With Quote
  #6  
Old 06-07-2008, 11:45 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by cbk1994 View Post
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... -_-
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #7  
Old 06-08-2008, 12:04 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
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.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #8  
Old 06-08-2008, 12:11 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
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.
__________________
Reply With Quote
  #9  
Old 06-08-2008, 01:27 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by cbk1994 View Post
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.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #10  
Old 06-08-2008, 02:38 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
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?
__________________
Reply With Quote
  #11  
Old 06-08-2008, 02:40 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by cbk1994 View Post
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.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #12  
Old 06-08-2008, 02:42 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
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.
__________________
Reply With Quote
  #13  
Old 06-08-2008, 02:52 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by cbk1994 View Post
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.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:20 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.