View Single Post
  #1  
Old 02-27-2011, 01:21 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
player.sendtoirc

Here is how it works:

Creating the IRC Channels & Adding the player(s)
First we create a loop, to find out who can have the irc in their rc- on Era iPhone we have a loop which runs through all the players every 5 seconds to detect certain things (in a Database NPC- We have called it PlayerControl).

HTML Code:
  temp.oldrcplayers = this.rcplayers;
  this.rcplayers = {};
  this.clientrcplayers = {};
    
  for (temp.pl: allplayers) {
    if (temp.pl.level == NULL) {
      if (temp.pl.adminlevel >= 1) {
        this.rcplayers.add(temp.pl);
        if (!(temp.pl in temp.oldrcplayers)) {
            //Now let's add them to join the two (Feedback & Reports)
          temp.pl.sendtoirc("join","Feedback");
          temp.pl.sendtoirc("join","Reports");
        }
      }
      continue;
    }
      //Client RC players
    if (temp.pl.adminlevel >= 1)
      this.clientrcplayers.add(temp.pl);
  }
Now the admins have joined the IRC channels. (Check the snapshot to see how it looks)

How to add text to the IRC channel
HTML Code:
  for (temp.rc: PlayerControl.rcplayers)
    temp.rc.sendtoirc("privmsg", "xAndrewx", "Feedback", "Message to show in rc");
    //temp.rc.sendtoirc("privmsg", "Player Account here that sent the message- it's the prefix before the : in an RC message chat", "send to which IRC", "Message here");
  for (temp.rc: PlayerControl.clientrcplayers)
    temp.rc.sendtorc("FEEDBACK: Message here");
Straight forward on how to use it. It will then display the chat in the IRC.


Useful Links
http://wiki.graal.net/index.php/Crea...v/Graal_v4_IRC
(Explains IRC)

http://forums.graalonline.com/forums...hp?t=134258222
(Sendtext / RequestText / onReceiveText information)

Stefan designed this system for iPhone worlds to seperate reports.
Attached Thumbnails
Click image for larger version

Name:	irc.png
Views:	927
Size:	222.3 KB
ID:	52496  
__________________

Last edited by xAndrewx; 02-27-2011 at 05:23 PM..
Reply With Quote