------------------------------------------------
On Fri, 7 Feb 2003 13:53:03 -0500 (EST), "G.D. Bell" <[EMAIL PROTECTED]> wrote:

> Hi all
> 
> I've started composing this script but seem to be a
> little stuck at the moment ..when I run script as it
> is presntly these errors occur..Name "main::alt_nick"
> used only once: possible typo at maria.pl line 26.
> Name "main::awaytime" used only once: possible typo at
> maria.pl line 28.
> Name "main::idletime" used only once: possible typo at
> maria.pl line 29.
> Name "main::awayreason" used only once: possible typo
> at maria.pl line 27.

The above are because you set variables to a value and never use the variables. (You 
hard code the values twice. See below.

> Undefined subroutine &IRC::register called at maria.pl
> line 18.
> 

This is because you have not imported the IRC module you are using.  Something like:

use IRC;

should help, but see the docs for that module.

> the script I have began is as follows..it may not look
> the greatest due to cut and paste.
> 
> #!/usr/bin/perl -w

use strict;  # always!

> ############################################################
> # Maria V0.1 (this script is for spam protection      
>     #                                             #
> # and xchat related away functions)                   
>     #
> # load into ~/.xchat directory                        
>     #
> #                                                     
>     #
> # Copyright 2003-2004 Gbell72  <[EMAIL PROTECTED]>  
>     #
> #                                                     
>     #
> #                                                     
>     #
> # Please submit bug-reports to the email provided     
>     #                                               #
> #                                                     
>     #
> #                                                     
>     #
> #                                                     
>     #
> ############################################################
> 
> # Script begins here
> 
> IRC::register("Maria", "v0.1", "", "");
> IRC::print ("loading Maria\n");
> IRC::print ("registering handlers\n");
> 
> # Message Logging
> IRC::add_message_handler("PRIVMSG",
> "privmsg_handler");
> 
> # Variables
> $alt_nick = "set_alt_nick";
> $awayreason = "now rests in peace.";
> $awaytime = "500";
> $idletime = "5000";
> 

Right here you set variables and never use them.

> # Away Functions
> IRC::add_command_handler("gbell72", set_alt_nick);
> IRC::add_command_handler("gbell72|afk", set_alt_nick);
> IRC::add_command_handler("working be back later",
> set_away_reason);

IRC::add_command_handler($awayreason,set_away_reason);

> IRC::add_command_handler("500", set_away_time);

IRC::add_command_handler($awaytime,set_away_time);

> IRC::add_command_handler("5000", set_idle_time);

IRC::add_command_handler($idletime,set_idle_time);

You get the picture.  Remember that naming a script after your girlfriend may be a bad 
idea when you get a new one she will be jealous... ;-)

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to