Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   player.sendtoirc (https://forums.graalonline.com/forums/showthread.php?t=134262247)

xAndrewx 02-27-2011 01:21 PM

player.sendtoirc
 
1 Attachment(s)
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.

gwFCCtennis 02-27-2011 03:31 PM

Quote:

Originally Posted by xAndrewx (Post 1633537)
very cool script

I was very surprised not to see "FEEDBACK: LOL CAN I BE ADMINZ PLZ I BE VERY GOOD PLZ OR AT LEAST GIMME A HAT PLZ!!!!1!" in the screenshot.

But anyway, very nice.

fowlplay4 02-27-2011 06:41 PM

It's about time he separated those... it was annoying as hell watching RC get spammed on Classic iPhone's RC.


All times are GMT +2. The time now is 03:17 AM.

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