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 08-13-2009, 05:33 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
Client-RC Addon System

This should come in handy when Client-RC is more mainstream in the next Graal version, and even now for quick access to any client debugging tools you may have scripted.

Installation is simple! Just put the weapon script below in a weapon npc called -RCAddons or whatever you like, and add it to staff when they log in.

Then you just adjust the rc addon's array, write the appropriate button_pressed function, and it's active and ready to use for your local staff.

However you'll probably have to adjust the createAddon function to prevent people from getting buttons they don't have rights or even need access to. But I'll leave that part up to you

You can check if they're staff and add the weapon to the them with the following script in your Control-NPC.

PHP Code:
function onActionPlayerOnline() {
  
temp.staffmembers serveroptions.staff.tokenize(",");
  if (
player.account in temp.staffmembers) {
    
player.addweapon("-RCAddons");
  }

Weapon Name: -RCAddons

PHP Code:
//#CLIENTSIDE

function onCreated() {
  
// Creates Addons if script is updated.
  // Useful when developing add-ons 
  
if (isObject(ScriptedRCWindow)) {
    
createAddons();
  }
}

function 
ScriptedRCWindow.onWake() {
  
// Create Addons when Client-RC is opened.
  
createAddons();
}

function 
createAddons() {
  
// RC Addon Array
  
temp.rcaddons = {
    
/* 
       RC Addons Array Explaination
       
       { "addonID", "image", "hint description" }
    
       addonID makes the button unique
       image: rc_<image>_normal.png
              rc_<image>_pressed.png
              
       Default RC Images can be found on RC with the command:
       /finddef rc_*
              
       hint description is what text is displayed when
       hovering over the button.
       
    */
    
{"Example""datablocks""Description of addon."},
    {
"RawrButton""accounts""Just a test button.."}
  };
  
// Clear any Existing Add-ons
  
clearAddons();
  
// Create Add-ons
  
for (temp.rcaddontemp.rcaddons) {
    
onClientRCAddon(temp.rcaddon[0], temp.rcaddon[1], temp.rcaddon[2]);
  }
}

function 
clearAddons() {
  
with (ScriptedRCWindow) {
    for (
temp.objthis.addonstemp.obj.destroy();
    
this.addons "";
  }
}

function 
onClientRCAddon(temp.addontemp.rcimagetemp.hintmsg) {
  
with (ScriptedRCWindow) {
    new 
GuiBitmapButtonCtrl("ScriptedRCButton_" temp.addon) {
      
// Determine which button to sit beside..
      
if (ScriptedRCWindow.addons.size() > 0) {
        
temp.obj ScriptedRCWindow.addons[ScriptedRCWindow.addons.size()-1];
      } else {
        
temp.obj ScriptedRCButton_classlist;
      }
      
// Button Images
      
normalbitmap "rc_" temp.rcimage "_normal.png"
      
pressedbitmap "rc_" temp.rcimage "_pressed.png";
      
mouseoverbitmap "rc_" temp.rcimage "_normal.png";  
      
// Determine Width + Height
      
width getimgwidth(normalbitmap);
      
height getimgheight(normalbitmap);
      
// Determine X + Y
      
temp.obj.width 1;
      
temp.obj.y;
      
// Record Hint
      
hint temp.hintmsg temp.hintmsg temp.addon;
      
// Catch onAction Event
      
thiso.catchevent(this.name"onAction"temp.addon "_Pressed");
    }
    
this.addons.add(makevar("ScriptedRCButton_" temp.addon));
  }
}

function 
ScriptedRCWindow.onResize() {
  
// Keeps the Addons in line
  
with (ScriptedRCWindow) {
    for (
temp.0temp.this.addons.size(); temp.i++) {
      
temp.linkobj = (temp.== 0) ? ScriptedRCButton_classlist this.addons[temp.i-1];
      
with (this.addons[temp.i]) {
        
temp.linkobj.width 1;
        
temp.linkobj.y;
      }
    }
  }
}

/*
   Example Addons

   You generally won't need much script here since you'll probably
   just make calls to the Staff weapon, trigger, or whatever you want
   to do.
*/

function Example_Pressed() {
  
cRCecho("Example Button Pressed!");
}

function 
cRCecho(msg) {
  
ScriptedRCRCchat.text @= "\n" msg;
  
ScriptedRCScroll.scrolltobottom();
}

function 
RawrButton_Pressed() {
  
sendtorc("Rawr");

The script neatly adds them to the Client-RC as well. Enjoy!
Attached Thumbnails
Click image for larger version

Name:	rcaddons.png
Views:	515
Size:	72.7 KB
ID:	49177  
__________________
Quote:
Reply With Quote
  #2  
Old 08-13-2009, 06:40 AM
Seich Seich is offline
Noctorious' NeoHunter
Seich's Avatar
Join Date: Jun 2008
Location: Honduras
Posts: 193
Seich will become famous soon enough
Send a message via MSN to Seich Send a message via Yahoo to Seich
Nice script and good idea.
Reply With Quote
  #3  
Old 08-13-2009, 08:29 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Can definitely prove useful to some, nice work.
Reply With Quote
  #4  
Old 08-13-2009, 10:02 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
Cool, though I can't really see any practical uses for it right now. Could be interesting for some stuff, though.
__________________
Reply With Quote
  #5  
Old 08-13-2009, 12:03 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by cbk1994 View Post
Cool, though I can't really see any practical uses for it right now. Could be interesting for some stuff, though.
The possibilites are many, Zodiac could add a Nation Control Panel or something, or even something as an Archetype Manager/Creator, Mud Controls, etc.

I can think of many uses of this
__________________
Reply With Quote
  #6  
Old 08-13-2009, 12:20 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 Chompy View Post
The possibilites are many, Zodiac could add a Nation Control Panel or something, or even something as an Archetype Manager/Creator, Mud Controls, etc.

I can think of many uses of this
Well, not sure about you, but I don't use client-RC, which is why I said I didn't see it being very useful. It'd probably be more beneficial to put them elsewhere, though I guess client-RC is just as good a place as any.
__________________
Reply With Quote
  #7  
Old 10-23-2011, 08:56 PM
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
Updated this to include profile modification which also makes the chat window look more like the default external RC theme.

Link: http://pastie.org/2746588
Attached Thumbnails
Click image for larger version

Name:	hack_progress.JPG
Views:	257
Size:	127.8 KB
ID:	53821  
Attached Images
  
__________________
Quote:
Reply With Quote
  #8  
Old 10-25-2011, 12:17 AM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a name known to allff7chocoboknight is a name known to allff7chocoboknight is a name known to all
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
That's pretty neato.
__________________
Reply With Quote
  #9  
Old 10-25-2011, 02:56 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
Quote:
Originally Posted by ff7chocoboknight View Post
That's pretty neato.
I agree.
Reply With Quote
  #10  
Old 10-25-2011, 05:21 PM
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
Nice job
__________________
Need Playerworld or Account support?
GraalOnline/Toonslab Support Center
Reply With Quote
  #11  
Old 07-23-2012, 04:49 AM
Vlad1 Vlad1 is offline
Registered User
Join Date: Apr 2012
Posts: 30
Vlad1 can only hope to improve
i noticed the rc u displayed wasn't a new window it was a window on graal
Reply With Quote
  #12  
Old 07-23-2012, 02:07 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Now can you make it a stand-alone client so we don't have to have Graal open to have RC open?!
__________________

Last edited by Darlene159; 07-25-2012 at 04:49 PM.. Reason: No need to start something
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 03:15 AM.


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