GWing and XChat

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

Moderators: dealing with it, Ambassadors

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.
Alvin Toffler wrote:The illiterates of the 21st century will not be those who cannot read and write but those who cannot learn, unlearn, and relearn.

Take a moment and consider joining my Patreon group, where I share personal development updates and plans for the future...

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

User avatar
Remæus
Architect
Member for 15 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 Cult Leader Lifegiver Storyteller

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 15 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 Cult Leader Lifegiver Storyteller

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 15 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 Cult Leader Lifegiver Storyteller

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
Contributor
Member for 14 years
Promethean Conversation Starter Author Inspiration Conversationalist Friendly Beginnings Donated! Contributor Greeter World Builder Arc Warden Visual Appeal Tipworthy Lifegiver Person of Interest

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 15 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 Cult Leader Lifegiver Storyteller

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
Contributor
Member for 14 years
Promethean Conversation Starter Author Inspiration Conversationalist Friendly Beginnings Donated! Contributor Greeter World Builder Arc Warden Visual Appeal Tipworthy Lifegiver Person of Interest


Post a reply

Make a Donation

$

Become a Patron!

RPG relies exclusively on user donations to support the platform.

Donors earn the "Contributor" achievement and are permanently recognized in the credits. Consider donating today!

 

Who is online

Users browsing this forum: No registered users and 1 guest