• Home
  • Servers
  • Chat
  • Channels
  • Commands
  • Forum
  • FAQ
  • Software
  • Quotes
Topic Options
Rate This Topic
#3805 - 12/27/08 03:44 PM X-Chat Brag Script
Zack Offline
n00b

Registered: 04/22/08
Posts: 11
Loc: USA
So everyone that uses X-Chat wants this script.. Here it is.

NOTE: X-Chat Aqua has issues getting the number of networks. On line 53, replace $znetworks with the number of networks your on. If you run linux or windows, it should run fine.

Code:
#!/usr/bin/perl

### Xchat registers and hooks.

Xchat::register("Zack's Brag Script", "1.0", "Zack's /brag script.", "");
Xchat::hook_command("brag", "power_main");

use warnings;
use strict;

### Main routine.


sub power_main {
	my $opped = my $whole = my $znetworks = my $oppedchans = my $hoppedchans = my $voppedchans = my $wholechannels = 0;
	my $oldcontext = Xchat::get_context();
	my @channels = Xchat::get_list('channels');
	foreach my $temp (@channels){
		my $type = $temp->{'type'};
		my @id = $temp->{'id'};
		if($type == 1){
			$znetworks++;
		} elsif($type == 2){
			my $chan = $temp->{'channel'};
			Xchat::set_context("$chan");
			my $userinfo = Xchat::user_info();
			if($userinfo->{'prefix'} =~ /^[~&@\!]$/){
				my $users = Xchat::get_list('users');
				$oppedchans++;
				$wholechannels++;
				$opped = $opped+$users;
				$whole = $whole+$users;
			} elsif($userinfo->{'prefix'} =~ /^[%\!]$/){
				my $husers = Xchat::get_list('users');
				$hoppedchans++;
				$wholechannels++;
				$opped = $opped+$husers;
				$whole = $whole+$husers;
			} elsif($userinfo->{'prefix'} =~ /^[+\!]$/){
				my $vusers = Xchat::get_list('users');
				$voppedchans++;
				$wholechannels++;
				$whole = $whole+$vusers;
			} else {
				my $uopusers = Xchat::get_list('users');
				$wholechannels++;
				$whole = $whole+$uopusers;
			}
			
		}
	}
	Xchat::set_context("$oldcontext");
	Xchat::command("say I am on $wholechannels channels, across $znetworks networks. I have 0 olines, $oppedchans ops, $hoppedchans halfops and $voppedchans voices. I have non-abusive power over $opped people.");
	return 1;
}


ALSO NOTE: You have to fill in your olines..

Top
Sponsored Links
Sponsored Links
Member
*****

Registered: 27/08/04
Posts: 10136
Loc: Mountain View, CA
Top
#3876 - 01/02/09 03:38 AM Re: X-Chat Brag Script [Re: Zack]
Thirteen Offline
n00b

Registered: 06/10/08
Posts: 2
Loc: Pacific Coast, USA
Thanks for the script, I made modifications and use it now. smile Thanks again.
_________________________
Until the next time,

Thirteen

Top
#3898 - 01/02/09 11:39 PM Re: X-Chat Brag Script [Re: Thirteen]
Dj 801 Offline
newbie

Registered: 06/12/08
Posts: 31
Loc: Ogden, UT
what do i save it as?

Top


Moderator:  mandy