Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #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:	499
Size:	222.3 KB
ID:	52496  
__________________

Last edited by xAndrewx; 02-27-2011 at 05:23 PM..
Reply With Quote
  #2  
Old 02-27-2011, 03:31 PM
gwFCCtennis gwFCCtennis is offline
Chaotic
gwFCCtennis's Avatar
Join Date: Aug 2010
Location: VA
Posts: 229
gwFCCtennis is on a distinguished road
Send a message via AIM to gwFCCtennis
Quote:
Originally Posted by xAndrewx View Post
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.
Reply With Quote
  #3  
Old 02-27-2011, 06:41 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
It's about time he separated those... it was annoying as hell watching RC get spammed on Classic iPhone's RC.
__________________
Quote:
Reply With Quote
Reply

Tags
rc tab, tab, tabs

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:41 PM.


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