Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-05-2003, 11:56 PM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Login Alert for Idle RCs

Considering how many people, including me, have suggested that they want some sort of way to prevent missing people while RC is minimized, I thought I would script up something. All servers are welcome to use this. Just stick it in your NPC server. To activate it, just type /npclogins in your rc chat.

NPC Code:

if (rcchat)
{
if (strequals(#p(0),logins))
{
timeout=1;
setstring this.alert,accountnames,here;
this.oldcount=allplayerscount;
}
}

if (timeout)
{
if (this.oldcount<allplayerscount)
{
for (this.i=0;this.i<allplayerscount;this.i++)
{
with (allplayers[this.i])
{
if (lindexof(#a,this.alert)!=-1)
{
sendpm A player logged in;
}
}
}
this.oldcount=allplayerscount;
}
if (this.oldcount>allplayerscount)
{
this.oldcount=allplayerscount;
}
timeout=1;
}

__________________


Help me keep scripting
Reply With Quote
  #2  
Old 08-06-2003, 12:03 AM
voicedcow6666 voicedcow6666 is offline
Registered User
Join Date: May 2002
Location: Texas
Posts: 182
voicedcow6666 is on a distinguished road
Congradulations, a new way to help lag the control-npc.
__________________
-Zega, Staff Advisor of Delteria
Reply With Quote
  #3  
Old 08-06-2003, 12:06 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Once a second isn't too bad, and all it does is check one variable - nothing too laggy at all. If you are really concerned about lag change the timeout to every 5, or even 10 seconds.
__________________


Help me keep scripting
Reply With Quote
  #4  
Old 08-06-2003, 12:10 AM
voicedcow6666 voicedcow6666 is offline
Registered User
Join Date: May 2002
Location: Texas
Posts: 182
voicedcow6666 is on a distinguished road
You should NEVER have a timeout in the control-npc, ESPECIALLY a never-ending one.
__________________
-Zega, Staff Advisor of Delteria
Reply With Quote
  #5  
Old 08-06-2003, 12:10 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by TribulationStaff
Once a second isn't too bad, and all it does is check one variable - nothing too laggy at all. If you are really concerned about lag change the timeout to every 5, or even 10 seconds.
timeout loops on the control-npc aren't really good for the server, since the control-npc does a lot for the npc server (which is why the NPC Server goes down if you kill the control npc)
Reply With Quote
  #6  
Old 08-06-2003, 12:22 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
I would appreciate if someone would explain why instead of just saying don't do it. My CPU time on the control npc is less than a twentieth of a second.
__________________


Help me keep scripting
Reply With Quote
  #7  
Old 08-06-2003, 12:27 AM
voicedcow6666 voicedcow6666 is offline
Registered User
Join Date: May 2002
Location: Texas
Posts: 182
voicedcow6666 is on a distinguished road
Jagen said why.

And I personally don't like it when the Control-NPC is even in the top 10.
__________________
-Zega, Staff Advisor of Delteria
Reply With Quote
  #8  
Old 08-06-2003, 12:33 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
He said it was bad, that is a little vague.

Additionally, if timeout is so bad for the control npc, why isn't it just disabled?
__________________


Help me keep scripting
Reply With Quote
  #9  
Old 08-06-2003, 12:39 AM
voicedcow6666 voicedcow6666 is offline
Registered User
Join Date: May 2002
Location: Texas
Posts: 182
voicedcow6666 is on a distinguished road
Quote:
timeout loops on the control-npc aren't really good for the server, since the control-npc does a lot for the npc server (which is why the NPC Server goes down if you kill the control npc)
And why should they disable it in the control-npc? You have people telling you it's bad, so if you do it it's your own fault. *shrugs*
__________________
-Zega, Staff Advisor of Delteria
Reply With Quote
  #10  
Old 08-06-2003, 12:46 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Lots of people say lots of things are bad, it doesn't mean they 100% right 100% of the time. I do not think it is unreasonable to ask for the reasoning behind dubbing timeout "bad" for the control npc.
__________________


Help me keep scripting
Reply With Quote
  #11  
Old 08-06-2003, 01:32 AM
voicedcow6666 voicedcow6666 is offline
Registered User
Join Date: May 2002
Location: Texas
Posts: 182
voicedcow6666 is on a distinguished road
Quote:
Originally posted by TribulationStaff
Lots of people say lots of things are bad, it doesn't mean they 100% right 100% of the time. I do not think it is unreasonable to ask for the reasoning behind dubbing timeout "bad" for the control npc.
Never once did I say it was "bad" to ask why you shouldn't use timeouts in the control-npc...we friggin pointed it out...because it's a primary part of the npc server.

And never said I was 100% right 100% of the time...simply said it's a bad idea. Jagen is a damn good scripter, I'm a pretty good scripter....both of us are saying it's a bad idea. You should think about that...
__________________
-Zega, Staff Advisor of Delteria
Reply With Quote
  #12  
Old 08-06-2003, 02:49 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
But how does being part of the NPCServer have anything to do with it?
__________________


Help me keep scripting
Reply With Quote
  #13  
Old 08-06-2003, 03:01 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Two points.

1) Nobody has actually answered Giltwist's question. Yes, it's an integral part of the NPC Server. So?
2) Giltwist is a pretty darn good scripter too. In this case, you can't pull the 'I am better than you so just listen to me' card.
__________________
Reply With Quote
  #14  
Old 08-06-2003, 03:16 AM
voicedcow6666 voicedcow6666 is offline
Registered User
Join Date: May 2002
Location: Texas
Posts: 182
voicedcow6666 is on a distinguished road
Quote:
Originally posted by Kaimetsu
Two points.

1) Nobody has actually answered Giltwist's question. Yes, it's an integral part of the NPC Server. So?
2) Giltwist is a pretty darn good scripter too. In this case, you can't pull the 'I am better than you so just listen to me' card.
1) It's a vital part of the NPC Server, as jagen said, and a timeout in something like that is bad. Any lag that the control-npc gets can help add more lag throughout the rest of the server.

2) I never said I was a better scripter than he, I simply said Jagen is a good scripter, and I'm a pretty good scripter, and that when two people who are both pretty good at something, especially Jagen, is most likely correct, since he was basically saying we were wrong with this 100% thing.
__________________
-Zega, Staff Advisor of Delteria
Reply With Quote
  #15  
Old 08-06-2003, 03:18 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Quote:
1) It's a vital part of the NPC Server, as jagen said, and a timeout in something like that is bad. Any lag that the control-npc gets can help add more lag throughout the rest of the server.
I also told you I checked the CPU time, there is virtually no lag from this script.
__________________


Help me keep scripting
Reply With Quote
Reply


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 11:12 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.