Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-25-2007, 02:48 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
Login Message

Here's the login message that is used on Utopia. I'm releasing it to the public, since it's not getting too much use here.

The files are control/serverNews.txt, control/serverHirings.txt, control/serverStaff.txt, and control/serverInfo.txt. Change these files to change what text shows up when you log on.

Script of Weapon/GUI-Script -System/LoginMessage:
PHP Code:
function onActionServerSide( cmd )
{
  if ( 
cmd == "getMessage" )
  {
    
temp.n.loadLines( "control/serverNews.txt" );
    
temp.h.loadLines( "control/serverHirings.txt" );
    
temp.s.loadLines( "control/serverStaff.txt" );
    
temp.i.loadLines( "control/serverInfo.txt" );
    
triggerclient( "gui", name, "returnMessage", temp.n, temp.h, temp.s, temp.i );
  }
}
//#CLIENTSIDE
function onCreated()
{
  
triggerserver( "gui", name, "getMessage" );
}
function 
onActionClientSide( cmd, n, h, s, i )
{
  if ( 
cmd == "returnMessage" )
  {
    for ( 
temp.a : n )
    {
      
temp.ne @= temp.a @ "\n";
    }
    
    for ( 
temp.a : h )
    {
      
temp.hi @= temp.a @ "\n";
    }
    
    for ( 
temp.a : s )
    {
      
temp.st @= temp.a @ "\n";
    }
    
    for ( 
temp.a : i )
    {
      
temp.inf @= temp.a @ "\n";
    }
    
    
showMessage( temp.ne, temp.hi, temp.st, temp.inf );
  }
}
function 
showMessage( news, hirings, staff, info )
{
  new 
GuiWindowCtrl( "LoginMessage_Window" )
  {
    
profile = "GuiBlueWindowProfile";
    
    
width = 440;
    
height = 368;
    
    
x = screenwidth / 2 - ( width / 2 );
    
y = screenheight / 2 - ( height / 2 );
    
    
canMaximize = canResize = false;
    
canClose = canMinimize = visible = title = true;
    
    
text = "Welcome to" SPC servername @ "!";
    
    new 
GuiScrollCtrl( "LoginMessage_NewsScroll" )
    {
      
profile = "GuiBlueScrollProfile";
      
      
x = 15;
      
y = 54;
      
      
width = 410;
      
height = 300;
      
      
vScrollBar = "dynamic";
      
hScrollBar = "alwaysOff";
      
      
visible = false;
      
      new 
GuiMLTextCtrl( "LoginMessage_NewsText" )
      {
        
profile = "GuiBlueTextProfile";
        
        
x = 3;
        
y = 0;
        
        
width = 390;
        
height = 300;
        
        
text = news;
      }
    }
    
    new 
GuiScrollCtrl( "LoginMessage_HiringsScroll" )
    {
      
profile = "GuiBlueScrollProfile";
      
      
x = 15;
      
y = 54;
      
      
width = 410;
      
height = 300;
      
      
vScrollBar = "dynamic";
      
hScrollBar = "alwaysOff";
      
      
visible = false;
      
      new 
GuiMLTextCtrl( "LoginMessage_HiringsText" )
      {
        
profile = "GuiBlueTextProfile";
        
        
x = 3;
        
y = 0;
        
        
width = 390;
        
height = 300;
        
        
text = hirings;
      }
    }
    
    new 
GuiScrollCtrl( "LoginMessage_StaffScroll" )
    {
      
profile = "GuiBlueScrollProfile";
      
      
x = 15;
      
y = 54;
      
      
width = 410;
      
height = 300;
      
      
vScrollBar = "dynamic";
      
hScrollBar = "alwaysOff";
      
      
visible = false;
      
      new 
GuiMLTextCtrl( "LoginMessage_StaffText" )
      {
        
profile = "GuiBlueTextProfile";
        
        
x = 3;
        
y = 0;
        
        
width = 390;
        
height = 300;
        
        
text = staff;
      }
    }
    
    new 
GuiScrollCtrl( "LoginMessage_InfoScroll" )
    {
      
profile = "GuiBlueScrollProfile";
      
      
x = 15;
      
y = 54;
      
      
width = 410;
      
height = 300;
      
      
vScrollBar = "dynamic";
      
hScrollBar = "alwaysOff";
      
      
visible = false;
      
      new 
GuiMLTextCtrl( "LoginMessage_InfoText" )
      {
        
profile = "GuiBlueTextProfile";
        
        
x = 3;
        
y = 0;
        
        
width = 390;
        
height = 300;
        
        
text = info;
      }
    }
    new 
GuiTabCtrl( "LoginMessage_Tab" )
    {
      
profile = "GuiBlueTabProfile";
      
      
x = 35;
      
y = 30;
      
      
width = 450;
      
height = 24;
      
      
tabwidth = 90;
      
      
clearRows();
      
      
temp.r = {
                 { 
"News", "LoginMessage_NewsScroll" },
                 { 
"Hirings", "LoginMessage_HiringsScroll" },
                 { 
"Staff", "LoginMessage_StaffScroll" },
                 { 
"Info", "LoginMessage_InfoScroll" }
               };
      
      for ( 
temp.a : temp.r )
      {
        
with ( addRow( 0, temp.a[0] ) )
        {
          
this.iPane = temp.a[1];
        }
      }
      
thiso.catchevent( name, "onSelect", "onTabSelected" );
      
setSelectedRow( 0 );
    }
  }
}
function 
onTabSelected( tabs )
{
  for ( 
temp.t : tabs.rows )
  {
    if ( 
temp.t == tabs.selected )
    {
      ( @ 
temp.t.iPane[0] ).visible = true;
    }
    else
    {
      ( @ 
temp.t.iPane[0] ).visible = false;
    }
  }
} 
Attached are some screenshots. Please give me feedback!
Attached Thumbnails
Click image for larger version

Name:	graal_1195951532.png
Views:	816
Size:	73.1 KB
ID:	43371  
__________________
Reply With Quote
 


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:45 PM.


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