Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-13-2006, 06:26 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Exclamation Dynamic serverlist info

Classic, hosted and gold servers can now dynamically send their own information to the serverlist by adding some code into their EventsBot. This allows servers to display live statistics, and event information (like Era does at the minute). If you choose not to feed information from your EventsBot, then the information that is on the serverlist will remain.

Here is the code that is required to create a serverinfo response. If you have an eventsbot already, it should not be difficult to adapt it:
PHP Code:
function onCreated()
{
  
sendtext("irc""login""EventsBot_servername");
}

function 
onReceiveText(texttypetextoptionstextlines

  if (
texttype != "irc" ||
      
textoptions != "privmsg")
  {
    return;
  }

  switch (
textlines[2][0]) 
  { 
    case 
"!eventsbotlogin"
    { 
      
sendtext("irc""privmsg", {"IRCBot", {"!eventadmins", {"acc""acc"}}}); 
      
sendtext("irc""privmsg", {"IRCBot", {"!eventchannel""#channel"}}); 
      
// tell the serverlist that you are serving serverlist info
      
sendtext("irc""privmsg", {"IRCBot", {"!handleserverinfo"1}});

      break; 
    } 

    
// called whenever anybody clicks the server on the serverlist
    
case "!getserverinfo"
    { 
      
temp.list = { 
        
"<center>"
        
"<font size=24>Server Name</font><br>"
        
"<img src=login_server_servername.png><br>"
        
"</center><sbreak>"
        
"<ignorelinebreaks>"
        
"Description" 
      
}; 
      
sendtext("irc""notice", {textlines[0], {"!serverinfo"temp.list}}); 

      break; 
    } 
  } 

If you want the existing info for your server, contact me via forum PM and I will send it to you. Also, if you are not sure about your server's image, run /find login_server_*.png in RC.
__________________
Skyld

Last edited by Skyld; 05-13-2006 at 08:36 PM..
Reply With Quote
  #2  
Old 05-13-2006, 06:37 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Very cool Skyld, very cool.
Reply With Quote
  #3  
Old 05-15-2006, 05:11 AM
bumbo bumbo is offline
Registered User
bumbo's Avatar
Join Date: Apr 2002
Location: Canada
Posts: 26
bumbo is on a distinguished road
Send a message via ICQ to bumbo Send a message via AIM to bumbo Send a message via MSN to bumbo
Here is a question, does the picture required need to be on some central server location? Or can we host it on our server in a directory somewhere?

if it needs to be centralized we will run into the same problems as before, but if it can be hosted locally on our own servers (perhaps a coding issue?) then we can avoid having to track someone down to upload.

Edit:I assume after re-reading skyld's post that it can be held locally, I'd just like that confirmed please
__________________
[email protected]
Reply With Quote
  #4  
Old 05-15-2006, 10:29 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
We might add some way to share the images with the login server, right now it's not possible. But with the dynamic serverlist thing you can display different text, event results, ongoing events etc.
Reply With Quote
  #5  
Old 05-15-2006, 10:11 PM
dNeonb dNeonb is offline
OOB
dNeonb's Avatar
Join Date: Feb 2003
Location: Germany
Posts: 1,240
dNeonb is on a distinguished road
Send a message via ICQ to dNeonb Send a message via AIM to dNeonb Send a message via Yahoo to dNeonb
I like this. Could be quite useful. Good job
__________________

Forum PM
AIM GraalNeoN
ICQ 201894166
Reply With Quote
  #6  
Old 12-24-2010, 06:06 AM
Matt Matt is offline
iZone Administrator
Matt's Avatar
Join Date: Apr 2005
Location: United States
Posts: 2,690
Matt is a jewel in the roughMatt is a jewel in the rough
Sorry for the bump, but i recommend this get stuck. This is extremely wanted, and useful.
__________________
Need Playerworld or Account support?
GraalOnline/Toonslab Support Center
Reply With Quote
  #7  
Old 01-31-2011, 10:32 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
Quote:
Originally Posted by Matt View Post
Sorry for the bump, but i recommend this get stuck. This is extremely wanted, and useful.
what he said.

--and it doesn't work for hosted anymore, could hosted have this function back? also, how do you set the icon of a server thought? i mean on the server list.
__________________
.
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
  #8  
Old 02-01-2011, 12:09 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Deas_Voice View Post
what he said.

--and it doesn't work for hosted anymore, could hosted have this function back? also, how do you set the icon of a server thought? i mean on the server list.
You don't you have to make a request to Stefan to have it changed to the one you supply him.
__________________
Quote:
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 06:04 PM.


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