Announcements: Introducing INK, the Writer's Currency » RPG's New Design Team » Now Open: RPG Staff Applications » 10 Years of RPG: Share Your Story » Can't Send PMs? Need Your 10-Forum Posts NOW? » A (Friendly) Reminder to All Romance RPers. » The Newbie's Guide to RolePlayGateway: Read This First! »

GWing and XChat

a topic in Discussion & Debate, a part of the RPG forum.

Moderator: dealing with it

Have a subject that you'd like to debate that isn't about roleplay? This is the place.

GWing and XChat

Tips: 0.00 INK Postby Remæus on Mon Feb 12, 2007 11:35 pm

XChat for Windows

Add a new network.
Name it "SurrealChat".
Edit it. Change the server address to: irc.surrealchat.net
You're mostly done.

You want to auto-join this network on startup.
You want to hide the network list at startup.
You want to autojoin #GWing and #OOC on connect.
Ludwig von Mises, The Theory of Money and Credit wrote:Perpetual vigilance on the part of the citizens can achieve what a thousand laws and dozens of alphabetical bureaus with hordes of employees never have and never will achieve: the preservation of a sound currency.

Tip jar: the author of this post has received 0.00 INK in return for their work.

User avatar
Remæus
Architect
Member for 13 years
Contributor Progenitor Author Promethean Conversation Starter Inspiration World Builder Conversationalist Friendly Beginnings Builder Greeter Beta Tester Arc Warden Party Starter Codeweaver Group Theory Person of Interest Streamwatcher Helmsman Recruiter Maiden Voyager Tipworthy Salesman Property Buyer Visual Appeal Concierge

Tips: 0.00 INK Postby Remæus on Mon Feb 12, 2007 11:37 pm

If you're into using scripts, here's a few that I found, untested.


These are both coded using Python, and you will need to save these files as .py files, then load them into XChat.
Code: Select all
use strict;
use warnings;

my $max_length = 25;

Xchat::register( "Action Splitter", "1.0" );
Xchat::hook_command( "me", \&command_me );
my $count = 0;
sub command_me {
my $text = $_[1][1];

if( length( $text ) > $max_length ) {
my @segments = segments( $text, $max_length );
Xchat::print ++$count;
Xchat::commandf( "me %s", shift @segments );
Xchat::command( [map { s/^/say /; $_ } @segments] );
$count--;
return Xchat::EAT_ALL;
}

return Xchat::EAT_NONE;
}

sub segments {
my ($text, $max) = @_;
my @segments;

if( length( $text ) > $max ) {
while( length( $text ) > $max ) {
my $end = rindex( $text, ' ', $max );

if( $end <0> $max_length ) {
    my @segments = segments( $text, $max_length );
    Xchat::commandf( "me %s", shift @segments );
    Xchat::command( [map { s/^/say /; $_ } @segments] );
    return Xchat::EAT_ALL;
  }

  return Xchat::EAT_NONE;
}

sub segments {
   my ($text, $max) = @_;
   my @segments;

   if( length( $text ) > $max ) {
      while( length( $text ) > $max ) {
         my $end = rindex( $text, ' ', $max );

         if( $end <0> $max_length ) {
    my @segments = segments( $text, $max_length );
    Xchat::commandf( "me %s", shift @segments );
    Xchat::command( [map { s/^/say /; $_ } @segments] );
    return Xchat::EAT_ALL;
  }

  return Xchat::EAT_NONE;
}

sub segments {
   my ($text, $max) = @_;
   my @segments;

   if( length( $text ) > $max ) {
      while( length( $text ) > $max ) {
         my $end = rindex( $text, ' ', $max );

         if( $end < 0 ) { # no space in the message
            $end = $max - 1;
            push @segments, substr( $text, 0, $end );
            $text = substr( $text, $end+1 );
         } else {
            push @segments, substr( $text, 0, $end );
            $text = substr( $text, $end+2 );
         }
      }
      push @segments, $text;
   } else {
      push @segments, $text;
   }

   return @segments;
}

Tip jar: the author of this post has received 0.00 INK in return for their work.

User avatar
Remæus
Architect
Member for 13 years
Contributor Progenitor Author Promethean Conversation Starter Inspiration World Builder Conversationalist Friendly Beginnings Builder Greeter Beta Tester Arc Warden Party Starter Codeweaver Group Theory Person of Interest Streamwatcher Helmsman Recruiter Maiden Voyager Tipworthy Salesman Property Buyer Visual Appeal Concierge

Tips: 0.00 INK Postby Remæus on Mon Feb 12, 2007 11:38 pm

Code: Select all
use strict;
use warnings;

my $max_length = 400;

Xchat::register( "Action Splitter", "1.0" );
Xchat::hook_command( "me", \&command_me );

sub command_me {
  my $text = $_[1][1];

  if( length( $text ) > $max_length ) {
    my @segments = segments( $text, $max_length );
    Xchat::commandf( "me %s", shift @segments );
    Xchat::command( [map { s/^/say /; $_ } @segments] );
    return Xchat::EAT_ALL;
  }

  return Xchat::EAT_NONE;
}

sub segments {
   my ($text, $max) = @_;
   my @segments;

   if( length( $text ) > $max ) {
      while( length( $text ) > $max ) {
         my $end = rindex( $text, ' ', $max );

         if( $end < 0 ) { # no space in the message
            $end = $max - 1;
            push @segments, substr( $text, 0, $end );
            $text = substr( $text, $end+1 );
         } else {
            push @segments, substr( $text, 0, $end );
            $text = substr( $text, $end+2 );
         }
      }
      push @segments, $text;
   } else {
      push @segments, $text;
   }

   return @segments;
}

Tip jar: the author of this post has received 0.00 INK in return for their work.

User avatar
Remæus
Architect
Member for 13 years
Contributor Progenitor Author Promethean Conversation Starter Inspiration World Builder Conversationalist Friendly Beginnings Builder Greeter Beta Tester Arc Warden Party Starter Codeweaver Group Theory Person of Interest Streamwatcher Helmsman Recruiter Maiden Voyager Tipworthy Salesman Property Buyer Visual Appeal Concierge

Tips: 0.00 INK Postby Lord Saladin on Tue Feb 13, 2007 12:55 am

Ok, cool. So... what do the scripts do? What functions are they for? Are are they just for the whole auto-join thing?

Tip jar: the author of this post has received 0.00 INK in return for their work.

User avatar
Lord Saladin
Contributor
Member for 12 years
Promethean Conversation Starter Author Inspiration Conversationalist Friendly Beginnings Donated! Contributor Greeter World Builder Arc Warden Visual Appeal Tipworthy

Tips: 0.00 INK Postby Remæus on Tue Feb 13, 2007 8:35 am

Both of those are different variants of cutscripts. I've not tested them, so do so at your own risk. They're also an example of how to code using Python, so maybe Kouketsu could create a Ghalerion Script for XChat.

(XChat also supports Ruby and Perl. I'm not a mIRC guy, but all three of these languages are similiar, though I'm not sure which one is most similiar to mIRC's scripting language.)

Tip jar: the author of this post has received 0.00 INK in return for their work.

User avatar
Remæus
Architect
Member for 13 years
Contributor Progenitor Author Promethean Conversation Starter Inspiration World Builder Conversationalist Friendly Beginnings Builder Greeter Beta Tester Arc Warden Party Starter Codeweaver Group Theory Person of Interest Streamwatcher Helmsman Recruiter Maiden Voyager Tipworthy Salesman Property Buyer Visual Appeal Concierge

Tips: 0.00 INK Postby Lord Saladin on Tue Feb 13, 2007 2:03 pm

I see. No worries, I will have a look at the scripts soon, and push Kouketsu in this direction to see if he can do anything.

Thanks dude!

Tip jar: the author of this post has received 0.00 INK in return for their work.

User avatar
Lord Saladin
Contributor
Member for 12 years
Promethean Conversation Starter Author Inspiration Conversationalist Friendly Beginnings Donated! Contributor Greeter World Builder Arc Warden Visual Appeal Tipworthy


Post a reply

RolePlayGateway is a site built by a couple roleplayers who wanted to give a little something back to the roleplay community. The site has no intention of earning any profit, and is paid for out of their own pockets.

If you appreciate what they do, feel free to donate your spare change to help feed them on the weekends. After selecting the amount you want to donate from the menu, you can continue by clicking on PayPal logo.

 

Who is online

Users browsing this forum: No registered users and 1 guest