mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-22 20:09:43 +01:00
== MAJOR NEW BETA RELEASE ==
Converted single large "amalgamate" monolithic pbot2.pl script into multiple Perl packages/modules. Tons of refactoring and clean-ups. Consider this version to be beta. Use at your own risk.
This commit is contained in:
parent
8695fdb30f
commit
f725743ccb
108
PBot/AntiFlood.pm
Normal file
108
PBot/AntiFlood.pm
Normal file
@ -0,0 +1,108 @@
|
||||
# File: NewModule.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: New module skeleton
|
||||
|
||||
package PBot::AntiFlood;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw($logger $botnick %flood_watch $MAX_NICK_MESSAGES $FLOOD_CHAT $conn $last_timestamp $flood_msg
|
||||
%channels);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
|
||||
*logger = \$PBot::PBot::logger;
|
||||
*botnick = \$PBot::PBot::botnick;
|
||||
*conn = \$PBot::PBot::conn;
|
||||
*MAX_NICK_MESSAGES = \$PBot::PBot::MAX_NICK_MESSAGES;
|
||||
*channels = \%PBot::ChannelStuff::channels;
|
||||
|
||||
# do not modify
|
||||
$FLOOD_CHAT = 0;
|
||||
#$FLOOD_JOIN = 1; # currently unused -- todo?
|
||||
|
||||
$last_timestamp = gettimeofday;
|
||||
$flood_msg = 0;
|
||||
|
||||
%flood_watch = ();
|
||||
|
||||
sub check_flood {
|
||||
my ($channel, $nick, $user, $host, $text, $max, $mode) = @_;
|
||||
my $now = gettimeofday;
|
||||
|
||||
$channel = lc $channel;
|
||||
|
||||
$logger->log(sprintf("check flood %-48s %-16s %s\n", "$nick!$user\@$host", "[$channel]", $text));
|
||||
|
||||
return if $nick eq $botnick;
|
||||
|
||||
if(exists $flood_watch{$nick}) {
|
||||
#$logger->log("nick exists\n");
|
||||
|
||||
if(not exists $flood_watch{$nick}{$channel}) {
|
||||
#$logger->log("adding new channel for existing nick\n");
|
||||
$flood_watch{$nick}{$channel}{offenses} = 0;
|
||||
$flood_watch{$nick}{$channel}{messages} = [];
|
||||
}
|
||||
|
||||
#$logger->log("appending new message\n");
|
||||
|
||||
push(@{ $flood_watch{$nick}{$channel}{messages} }, { timestamp => $now, msg => $text, mode => $mode });
|
||||
|
||||
my $length = $#{ $flood_watch{$nick}{$channel}{messages} } + 1;
|
||||
|
||||
#$logger->log("length: $length, max nick messages: $MAX_NICK_MESSAGES\n");
|
||||
|
||||
if($length >= $MAX_NICK_MESSAGES) {
|
||||
my %msg = %{ shift(@{ $flood_watch{$nick}{$channel}{messages} }) };
|
||||
#$logger->log("shifting message off top: $msg{msg}, $msg{timestamp}\n");
|
||||
$length--;
|
||||
}
|
||||
|
||||
return if not exists $channels{$channel} or $channels{$channel}{is_op} == 0;
|
||||
|
||||
#$logger->log("length: $length, max: $max\n");
|
||||
|
||||
if($length >= $max) {
|
||||
# $logger->log("More than $max messages spoken, comparing time differences\n");
|
||||
my %msg = %{ @{ $flood_watch{$nick}{$channel}{messages} }[$length - $max] };
|
||||
my %last = %{ @{ $flood_watch{$nick}{$channel}{messages} }[$length - 1] };
|
||||
|
||||
#$logger->log("Comparing $last{timestamp} against $msg{timestamp}: " . ($last{timestamp} - $msg{timestamp}) . " seconds\n");
|
||||
|
||||
if($last{timestamp} - $msg{timestamp} <= 10 && not PBot::BotAdminStuff::loggedin($nick, $host)) {
|
||||
$flood_watch{$nick}{$channel}{offenses}++;
|
||||
my $length = $flood_watch{$nick}{$channel}{offenses} * $flood_watch{$nick}{$channel}{offenses} * 30;
|
||||
if($channel =~ /^#/) { #channel flood (opposed to private message or otherwise)
|
||||
if($mode == $FLOOD_CHAT) {
|
||||
PBot::OperatorStuff::quiet_nick_timed($nick, $channel, $length);
|
||||
$conn->privmsg($nick, "You have been quieted due to flooding. Please use a web paste service such as http://codepad.org for lengthy pastes. You will be allowed to speak again in $length seconds.");
|
||||
$logger->log("$nick $channel flood offense $flood_watch{$nick}{$channel}{offenses} earned $length second quiet\n");
|
||||
}
|
||||
} else { # private message flood
|
||||
$logger->log("$nick msg flood offense $flood_watch{$nick}{$channel}{offenses} earned $length second ignore\n");
|
||||
PBot::IgnoreList::ignore_user("", "floodcontrol", "", "$nick" . '@' . "$host $channel $length");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#$logger->log("brand new nick addition\n");
|
||||
# new addition
|
||||
$flood_watch{$nick}{$channel}{offenses} = 0;
|
||||
$flood_watch{$nick}{$channel}{messages} = [];
|
||||
push(@{ $flood_watch{$nick}{$channel}{messages} }, { timestamp => $now, msg => $text, mode => $mode });
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
41
PBot/BotAdminStuff.pm
Normal file
41
PBot/BotAdminStuff.pm
Normal file
@ -0,0 +1,41 @@
|
||||
# File: NewModule.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: New module skeleton
|
||||
|
||||
package PBot::BotAdminStuff;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw(%admins);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
%admins = ();
|
||||
|
||||
sub loggedin {
|
||||
my ($nick, $host) = @_;
|
||||
|
||||
if(exists $admins{$nick} && $host =~ /$admins{$nick}{host}/
|
||||
&& exists $admins{$nick}{login}) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub load_admins {
|
||||
}
|
||||
|
||||
sub save_admins {
|
||||
}
|
||||
|
||||
1;
|
118
PBot/Changes
Normal file
118
PBot/Changes
Normal file
@ -0,0 +1,118 @@
|
||||
#
|
||||
# TODO: Make InternalCommands have Setter function add_internal_command(%hash) and move all itnernal commands to respective modules
|
||||
# TODO: Tons of more of refactoring and clean-ups and conversion to OOP
|
||||
#
|
||||
# TODO: add support for admin management - needs support for adding/removing/saving! [for 1.0]
|
||||
# TODO: multi-channel support pathetic (note 12/08/09, fixed multi-channel for anti-flood and for ignore)
|
||||
# e.g., factoids need channel parameter, e.g. C factoids vs. C++ factoids (with an option to allow a factoid across all channels)
|
||||
# [for 1.0]
|
||||
# TODO: most of this crap needs to be refactored (note 11/23/09, refactored execute_module; 03/12/10, refactored and cleaned up a lot)
|
||||
# TODO: fix quotegrab ids -- ids not adjusted when quotegrab deleted [for 0.5.0]
|
||||
# TODO: make most, if not all, hash key comparisions case-insensitive, but store values with case intact! [for 0.5.0]
|
||||
#
|
||||
# 0.5.0-beta (03/16/10): split single large pbot2.pl file into packages and modules
|
||||
# replaced nick@host with full nick!user@host hostmask throughout [TODO for admin stuff (logged_in, etc)]
|
||||
# ignore list saves/loads [TODO]
|
||||
# factoids/modules now case-insensitive in interpret_command
|
||||
# when using !tell foo about bar, replaced "(nick)" on end of text with "nick wants you to know:" at beginning of text
|
||||
# added STDIN reader and pass all input to interpret_command (was fun working out the POSIX suspend/bg/fg kinks!)
|
||||
# lots of code clean-up and refactoring
|
||||
# 0.4.6 (03/06/10): channel name now always lower-cased in hashes
|
||||
# added trigger for NOTICE events
|
||||
# 0.4.5 (12/11/09): set quotegrab id when loading and grabbing; export quotegrabs to webpage
|
||||
# 0.4.4 (12/10/09): added [channel] optional parameter to !grab
|
||||
# fixed !rq's [channel] parameter
|
||||
# 0.4.3 (12/10/09): added !delq to delete quotegrabs
|
||||
# 0.4.2 (12/09/09): added support for quotegrabs: !grab, !getq, and !rq
|
||||
# 0.4.1 (12/08/09): improved anti-flood system to be significantly more accurate and per-channel
|
||||
# added per-nick-per-channel message history using %flood_watch
|
||||
# add per-channel support to ignore system
|
||||
# automatically remove message history for nicks that haven't spoken in one day (run once per hour)
|
||||
# do not ignore !login command
|
||||
# 0.3.16(11/23/09): refactored module execution to execute_module() subroutine
|
||||
# added trigger to execute get_title.pl module when URL is
|
||||
# detected in regular untriggered chat
|
||||
# 0.3.15(11/20/09): replace 'me' with '$nick' in arguments
|
||||
# 0.3.14(07/03/07): do not expand escaped dollar-signs in factoids (adlib)
|
||||
# 0.3.13(07/01/07): fork all modules
|
||||
# added unload_module, enable_command, disable_command
|
||||
# automatically export factoids every $export_factoids_timeout seconds
|
||||
# 0.3.12(05/20/07): lol? Prevent recursive aliasing infinite loop, x -> a, a -> x
|
||||
# 0.3.11(05/20/07): added 'alias'
|
||||
# 0.3.10(05/08/05): dont ban by nick, wait for nickserv response before joining chans
|
||||
# 0.3.9 (05/06/05): stop logging joins, fixed join flood ban?
|
||||
# 0.3.8 (04/28/05): changed 'top10' to 'top20' throughout
|
||||
# 0.3.7 (04/28/05): 'top10 recent' command lists 10 most recent factoid additions
|
||||
# 0.3.6 (04/15/05): join/part flood earns ban (broken, I'm lazy)
|
||||
# 0.3.5 (03/24/05): fix bug in interpret_command re $commands and $keyword
|
||||
# keeps track of op state in multi-channels (but not commands)
|
||||
# added nick searching to top10
|
||||
# 0.3.4 (03/22/05): added kick
|
||||
# list also lists admins
|
||||
# ban also kicks nick
|
||||
# unban also modes -b in addition to ChanServ AUTOREM DEL
|
||||
# oops, moved $is_opped = 0 from lose_ops() to on_mode()
|
||||
# 0.3.3 (03/21/05): added ban, unban using ChanServ AUTOREM
|
||||
# 0.3.2 (03/20/05): stays opped for a minimum of 5 minutes before deop
|
||||
# 0.3.1 (03/18/05): log out departed admins
|
||||
# implemented ignore and unignore
|
||||
# flooding with commands triggers timed ignore
|
||||
# no flood consequences for logged in admins
|
||||
# 0.3.0 (03/17/05): Hi-res timer support.
|
||||
# renamed %admin_commands to %internal_commands
|
||||
# added admin levels to %admin_commands
|
||||
# added access levels to internal commands
|
||||
# interpret_command uses access levels and checks login status
|
||||
# removed all extraneous loggedin() checks
|
||||
# internal commands processed before bot commands
|
||||
# added flood control
|
||||
# flooding channel tiggers timed quiet
|
||||
# 0.2.18(03/16/05): direct at $nick within channel
|
||||
# 0.2.17(03/11/05): Most confirmation and warning messages sent via /msg
|
||||
# restricted parsing to bot's name or ! only
|
||||
# 0.2.16(03/02/05): added '/msg'
|
||||
# /msg doesn't show ($nick) if admin
|
||||
# 0.2.15(02/20/05): special variable lists, "adlibs"
|
||||
# 0.2.14(02/19/05): added $botnick and $altbotnick
|
||||
# added more rules to trigger interpret_command
|
||||
# added '/me'
|
||||
# added '$args', allowed factoids to take arguments
|
||||
# 0.2.13(02/19/05): added '/say' for no '<foo> is'
|
||||
# added $nick expansion in factoids
|
||||
# added 'show' command to display factoid literal
|
||||
# 0.2.12(02/16/05): improved html for export
|
||||
# added 'commands' to list command
|
||||
# 0.2.11(02/12/05): added popularity to 'info' command
|
||||
# 'top10' command for factoids
|
||||
# 0.2.10(02/07/05): added histogram command
|
||||
# 0.2.9 (02/03/05): info <factoid> || info <module>
|
||||
# find <factoid keyword>
|
||||
# use eval {} in change_text
|
||||
# count <nick> returns # of factoids <nick> has submitted
|
||||
# 0.2.8 (02/02/05): change_text: show result of change
|
||||
# ... debugging prints throughout
|
||||
# Allowed factoids to be appended using 'is also'
|
||||
# 0.2.7 (01/27/05): Removed '<command> for <nick>' syntax to direct
|
||||
# a command at a user. Using 'tell <nick> about <command>'
|
||||
# instead.
|
||||
# 0.2.6 (01/22/05): Major source overhaul.
|
||||
# Allowed any non-word character to be used
|
||||
# as delimiter in change_text.
|
||||
# 0.2.5 (01/18/05): Don't die in save_commands.
|
||||
# 0.2.4 (01/18/05): Added 'change' command.
|
||||
# 0.2.3 (01/17/05): Allowed factoids to be added using '%foo is bar'
|
||||
# 0.2.2 (01/17/05): Responds only when addressed or explicitly triggered.
|
||||
# 0.2.1 (01/17/05): Allowed trailing question marks.
|
||||
# Allowed 'is' for add_text.
|
||||
# Some minor bug fixes.
|
||||
# Aliased forget => remove.
|
||||
# 0.2.0 (01/16/05): Revamped hash structures for factoids.
|
||||
# All commands have a timestamp and owner.
|
||||
# Added 'export' command and modifed 'list'.
|
||||
# 0.1.4 (01/16/05): Minor tweaks and fixes for logging.
|
||||
# 0.1.3 (01/16/05): Can direct commands at nicks.
|
||||
# example: man fork for <nick>
|
||||
# 0.1.2 (01/15/05): Added 'list' admin command.
|
||||
# 0.1.1 (01/15/05): Some minor tweaks and fixes.
|
||||
# 0.1.0 (01/15/05): Initial version
|
||||
|
68
PBot/ChannelStuff.pm
Normal file
68
PBot/ChannelStuff.pm
Normal file
@ -0,0 +1,68 @@
|
||||
# File: NewModule.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: New module skeleton
|
||||
|
||||
package PBot::ChannelStuff;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw($channels_file $logger %channels);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
*channels_file = \$PBot::PBot::channels_file;
|
||||
*logger = \$PBot::PBot::logger;
|
||||
|
||||
%channels = ();
|
||||
|
||||
sub load_channels {
|
||||
open(FILE, "< $channels_file") or die "Couldn't open $channels_file: $!\n";
|
||||
my @contents = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
$logger->log("Loading channels from $channels_file ...\n");
|
||||
|
||||
my $i = 0;
|
||||
foreach my $line (@contents) {
|
||||
$i++;
|
||||
chomp $line;
|
||||
my ($channel, $enabled, $is_op, $showall) = split(/\s+/, $line);
|
||||
if(not defined $channel || not defined $is_op || not defined $enabled) {
|
||||
die "Syntax error around line $i of $channels_file\n";
|
||||
}
|
||||
|
||||
$channel = lc $channel;
|
||||
|
||||
if(defined $channels{$channel}) {
|
||||
die "Duplicate channel $channel found in $channels_file around line $i\n";
|
||||
}
|
||||
|
||||
$channels{$channel}{enabled} = $enabled;
|
||||
$channels{$channel}{is_op} = $is_op;
|
||||
$channels{$channel}{showall} = $showall;
|
||||
|
||||
$logger->log(" Adding channel $channel (enabled: $enabled, op: $is_op, showall: $showall) ...\n");
|
||||
}
|
||||
|
||||
$logger->log("Done.\n");
|
||||
}
|
||||
|
||||
sub save_channels {
|
||||
open(FILE, "> $channels_file") or die "Couldn't open $channels_file: $!\n";
|
||||
foreach my $channel (keys %channels) {
|
||||
$channel = lc $channel;
|
||||
print FILE "$channel $channels{$channel}{enabled} $channels{$channel}{is_op} $channels{$channel}{showall}\n";
|
||||
}
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
1;
|
127
PBot/FactoidStuff.pm
Normal file
127
PBot/FactoidStuff.pm
Normal file
@ -0,0 +1,127 @@
|
||||
# File: NewModule.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: New module skeleton
|
||||
|
||||
package PBot::FactoidStuff;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw($logger %commands $commands_file $export_factoids_path $export_factoids_timeout);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
*logger = \$PBot::PBot::logger;
|
||||
*commands_file = \$PBot::PBot::commands_file;
|
||||
*export_factoids_path = \$PBot::PBot::export_factoids_path;
|
||||
*export_factoids_timeout = \$PBot::PBot::export_factoids_timeout;
|
||||
|
||||
# TODO: move into pbot object, or make FactoidStuff an object and move this into it
|
||||
%commands = ();
|
||||
|
||||
sub load_commands {
|
||||
$logger->log("Loading commands from $commands_file ...\n");
|
||||
|
||||
open(FILE, "< $commands_file") or die "Couldn't open $commands_file: $!\n";
|
||||
my @contents = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
my $i = 0;
|
||||
foreach my $line (@contents) {
|
||||
chomp $line;
|
||||
$i++;
|
||||
my ($command, $type, $enabled, $owner, $timestamp, $ref_count, $ref_user, $value) = split(/\s+/, $line, 8);
|
||||
if(not defined $command || not defined $enabled || not defined $owner || not defined $timestamp
|
||||
|| not defined $type || not defined $ref_count
|
||||
|| not defined $ref_user || not defined $value) {
|
||||
die "Syntax error around line $i of $commands_file\n";
|
||||
}
|
||||
if(exists $commands{$command}) {
|
||||
die "Duplicate command $command found in $commands_file around line $i\n";
|
||||
}
|
||||
$commands{$command}{enabled} = $enabled;
|
||||
$commands{$command}{$type} = $value;
|
||||
$commands{$command}{owner} = $owner;
|
||||
$commands{$command}{timestamp} = $timestamp;
|
||||
$commands{$command}{ref_count} = $ref_count;
|
||||
$commands{$command}{ref_user} = $ref_user;
|
||||
# $logger->log(" Adding command $command ($type): $owner, $timestamp...\n");
|
||||
}
|
||||
$logger->log(" $i commands loaded.\n");
|
||||
$logger->log("Done.\n");
|
||||
}
|
||||
|
||||
sub save_commands {
|
||||
open(FILE, "> $commands_file") or die "Couldn't open $commands_file: $!\n";
|
||||
|
||||
foreach my $command (sort keys %commands) {
|
||||
next if $command eq "version";
|
||||
if(defined $commands{$command}{module} || defined $commands{$command}{text} || defined $commands{$command}{regex}) {
|
||||
print FILE "$command ";
|
||||
} else {
|
||||
$logger->log("save_commands: unknown command type $command\n");
|
||||
next;
|
||||
}
|
||||
#bleh, this is ugly - duplicated
|
||||
if(defined $commands{$command}{module}) {
|
||||
print FILE "module ";
|
||||
print FILE "$commands{$command}{enabled} $commands{$command}{owner} $commands{$command}{timestamp} ";
|
||||
print FILE "$commands{$command}{ref_count} $commands{$command}{ref_user} ";
|
||||
print FILE "$commands{$command}{module}\n";
|
||||
} elsif(defined $commands{$command}{text}) {
|
||||
print FILE "text ";
|
||||
print FILE "$commands{$command}{enabled} $commands{$command}{owner} $commands{$command}{timestamp} ";
|
||||
print FILE "$commands{$command}{ref_count} $commands{$command}{ref_user} ";
|
||||
print FILE "$commands{$command}{text}\n";
|
||||
} elsif(defined $commands{$command}{regex}) {
|
||||
print FILE "regex ";
|
||||
print FILE "$commands{$command}{enabled} $commands{$command}{owner} $commands{$command}{timestamp} ";
|
||||
print FILE "$commands{$command}{ref_count} $commands{$command}{ref_user} ";
|
||||
print FILE "$commands{$command}{regex}\n";
|
||||
} else {
|
||||
$logger->log("save_commands: skipping unknown command type for $command\n");
|
||||
}
|
||||
}
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
sub export_factoids() {
|
||||
my $text;
|
||||
open FILE, "> $export_factoids_path" or return "Could not open export path.";
|
||||
my $time = localtime;
|
||||
print FILE "<html><body><i>Generated at $time</i><hr><h3>Candide's factoids:</h3><br>\n";
|
||||
my $i = 0;
|
||||
print FILE "<table border=\"0\">\n";
|
||||
foreach my $command (sort keys %commands) {
|
||||
if(exists $commands{$command}{text}) {
|
||||
$i++;
|
||||
if($i % 2) {
|
||||
print FILE "<tr bgcolor=\"#dddddd\">\n";
|
||||
} else {
|
||||
print FILE "<tr>\n";
|
||||
}
|
||||
$text = "<td><b>$command</b> is " . encode_entities($commands{$command}{text}) . "</td>\n";
|
||||
print FILE $text;
|
||||
my ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) = localtime($commands{$command}{timestamp});
|
||||
my $t = sprintf("%02d:%02d:%02d-%04d/%02d/%02d\n",
|
||||
$hours, $minutes, $seconds, $year+1900, $month+1, $day_of_month);
|
||||
print FILE "<td align=\"right\">- submitted by<br> $commands{$command}{owner}<br><i>$t</i>\n";
|
||||
print FILE "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
print FILE "</table>\n";
|
||||
print FILE "<hr>$i factoids memorized.<br>This page is automatically generated every $export_factoids_timeout seconds.</body></html>";
|
||||
close(FILE);
|
||||
#$logger->log("$i factoids exported.\n");
|
||||
return "$i factoids exported to http://blackshell.com/~msmud/candide/factoids.html";
|
||||
}
|
||||
|
||||
1;
|
168
PBot/IRCHandlers.pm
Normal file
168
PBot/IRCHandlers.pm
Normal file
@ -0,0 +1,168 @@
|
||||
# File: IRCHandlers.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: Subroutines to handle IRC events
|
||||
|
||||
package PBot::IRCHandlers;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw($logger $identify_password %channels $botnick %is_opped %unban_timeout %admins);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
*logger = \$PBot::PBot::logger;
|
||||
*unban_timeout = \%PBot::OperatorStuff::unban_timeout;
|
||||
*admins = \%PBot::BotAdminStuff::admins;
|
||||
*channels = \%PBot::ChannelStuff::channels;
|
||||
*identify_password = \$PBot::PBot::identify_password;
|
||||
*botnick = \$PBot::PBot::botnick;
|
||||
*is_opped = \%PBot::OperatorStuff::is_opped;
|
||||
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
|
||||
# IRC related subroutines
|
||||
#################################################
|
||||
|
||||
sub on_connect {
|
||||
my $conn = shift;
|
||||
$logger->log("Connected! Identifying with NickServ . . .\n");
|
||||
$conn->privmsg("nickserv", "identify $identify_password");
|
||||
$conn->{connected} = 1;
|
||||
}
|
||||
|
||||
sub on_disconnect {
|
||||
my ($self, $event) = @_;
|
||||
$logger->log("Disconnected, attempting to reconnect...\n");
|
||||
$self->connect();
|
||||
if(not $self->connected) {
|
||||
sleep(5);
|
||||
on_disconnect($self, $event)
|
||||
}
|
||||
}
|
||||
|
||||
sub on_init {
|
||||
my ($self, $event) = @_;
|
||||
my (@args) = ($event->args);
|
||||
shift (@args);
|
||||
$logger->log("*** @args\n");
|
||||
}
|
||||
|
||||
sub on_public {
|
||||
my ($conn, $event) = @_;
|
||||
|
||||
my $from = $event->{to}[0];
|
||||
my $nick = $event->nick;
|
||||
my $user = $event->user;
|
||||
my $host = $event->host;
|
||||
my $text = $event->{args}[0];
|
||||
|
||||
PBot::Interpreter::process_line($from, $nick, $user, $host, $text);
|
||||
}
|
||||
|
||||
sub on_msg {
|
||||
my ($conn, $event) = @_;
|
||||
my ($nick, $host) = ($event->nick, $event->host);
|
||||
my $text = $event->{args}[0];
|
||||
|
||||
$text =~ s/^!?(.*)/\!$1/;
|
||||
$event->{to}[0] = $nick;
|
||||
$event->{args}[0] = $text;
|
||||
on_public($conn, $event);
|
||||
}
|
||||
|
||||
sub on_notice {
|
||||
my ($conn, $event) = @_;
|
||||
my ($nick, $host) = ($event->nick, $event->host);
|
||||
my $text = $event->{args}[0];
|
||||
|
||||
$logger->log("Received NOTICE from $nick $host '$text'\n");
|
||||
|
||||
if($nick eq "NickServ" && $text =~ m/You are now identified/i) {
|
||||
foreach my $chan (keys %channels) {
|
||||
if($channels{$chan}{enabled} != 0) {
|
||||
$logger->log("Joining channel: $chan\n");
|
||||
$conn->join($chan);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub on_action {
|
||||
my ($conn, $event) = @_;
|
||||
|
||||
on_public($conn, $event);
|
||||
}
|
||||
|
||||
sub on_mode {
|
||||
my ($conn, $event) = @_;
|
||||
my ($nick, $host) = ($event->nick, $event->host);
|
||||
my $mode = $event->{args}[0];
|
||||
my $target = $event->{args}[1];
|
||||
my $channel = $event->{to}[0];
|
||||
$channel = lc $channel;
|
||||
|
||||
$logger->log("Got mode: nick: $nick, host: $host, mode: $mode, target: " . (defined $target ? $target : "") . ", channel: $channel\n");
|
||||
|
||||
if(defined $target && $target eq $botnick) { # bot targeted
|
||||
if($mode eq "+o") {
|
||||
$logger->log("$nick opped me in $channel\n");
|
||||
if(exists $is_opped{$channel}) {
|
||||
$logger->log("warning: erm, I was already opped?\n");
|
||||
}
|
||||
$is_opped{$channel}{timeout} = gettimeofday + 300; # 5 minutes
|
||||
PBot::OperatorStuff::perform_op_commands();
|
||||
} elsif($mode eq "-o") {
|
||||
$logger->log("$nick removed my ops in $channel\n");
|
||||
if(not exists $is_opped{$channel}) {
|
||||
$logger->log("warning: erm, I wasn't opped?\n");
|
||||
}
|
||||
delete $is_opped{$channel};
|
||||
}
|
||||
} else { # bot not targeted
|
||||
if($mode eq "+b") {
|
||||
if($nick eq "ChanServ") {
|
||||
$unban_timeout{$target}{timeout} = gettimeofday + 3600 * 2; # 2 hours
|
||||
$unban_timeout{$target}{channel} = $channel;
|
||||
}
|
||||
} elsif($mode eq "+e" && $channel eq $botnick) {
|
||||
foreach my $chan (keys %channels) {
|
||||
if($channels{$chan}{enabled} != 0) {
|
||||
$logger->log("Joining channel: $chan\n");
|
||||
$conn->join($chan);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub on_join {
|
||||
my ($conn, $event) = @_;
|
||||
my ($nick, $host, $channel) = ($event->nick, $event->host, $event->to);
|
||||
|
||||
#$logger->log("$nick!$user\@$host joined $channel\n");
|
||||
#check_flood($nick, $host, $channel, 3, $FLOOD_JOIN);
|
||||
}
|
||||
|
||||
sub on_departure {
|
||||
my ($conn, $event) = @_;
|
||||
my ($nick, $host, $channel) = ($event->nick, $event->host, $event->to);
|
||||
|
||||
#check_flood($nick, $host, $channel, 3, $FLOOD_JOIN);
|
||||
|
||||
if(exists $admins{$nick} && exists $admins{$nick}{login}) {
|
||||
$logger->log("Whoops, $nick left while still logged in.\n");
|
||||
$logger->log("Logged out $nick.\n");
|
||||
delete $admins{$nick}{login};
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
105
PBot/IgnoreList.pm
Normal file
105
PBot/IgnoreList.pm
Normal file
@ -0,0 +1,105 @@
|
||||
# File: NewModule.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: New module skeleton
|
||||
|
||||
package PBot::IgnoreList;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw($logger %ignore_list);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
*logger = \$PBot::PBot::logger;
|
||||
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
|
||||
%ignore_list = ();
|
||||
|
||||
sub ignore_user {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
return "/msg $nick Usage: ignore nick!user\@host [channel] [timeout]" if not defined $arguments;
|
||||
|
||||
my ($target, $channel, $length) = split /\s+/, $arguments;
|
||||
|
||||
|
||||
if(not defined $target) {
|
||||
return "/msg $nick Usage: ignore host [channel] [timeout]";
|
||||
}
|
||||
|
||||
if($target =~ /^list$/i) {
|
||||
my $text = "Ignored: ";
|
||||
my $sep = "";
|
||||
|
||||
foreach my $ignored (keys %ignore_list) {
|
||||
foreach my $channel (keys %{ $ignore_list{$ignored} }) {
|
||||
$text .= $sep . "[$ignored][$channel]" . int(gettimeofday - $ignore_list{$ignored}{$channel});
|
||||
$sep = "; ";
|
||||
}
|
||||
}
|
||||
return "/msg $nick $text";
|
||||
}
|
||||
|
||||
if(not defined $channel) {
|
||||
$channel = ".*"; # all channels
|
||||
}
|
||||
|
||||
if(not defined $length) {
|
||||
$length = 300; # 5 minutes
|
||||
}
|
||||
|
||||
$logger->log("$nick added [$target][$channel] to ignore list for $length seconds\n");
|
||||
$ignore_list{$target}{$channel} = gettimeofday + $length;
|
||||
return "/msg $nick [$target][$channel] added to ignore list for $length seconds";
|
||||
}
|
||||
|
||||
sub unignore_user {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my ($target, $channel) = split /\s+/, $arguments;
|
||||
|
||||
if(not defined $target) {
|
||||
return "/msg $nick Usage: unignore host [channel]";
|
||||
}
|
||||
|
||||
if(not defined $channel) {
|
||||
$channel = ".*";
|
||||
}
|
||||
|
||||
if(not exists $ignore_list{$target}{$channel}) {
|
||||
$logger->log("$nick attempt to remove nonexistent [$target][$channel] from ignore list\n");
|
||||
return "/msg $nick [$target][$channel] not found in ignore list (use '!ignore list' to list ignores";
|
||||
}
|
||||
|
||||
delete $ignore_list{$target}{$channel};
|
||||
$logger->log("$nick removed [$target][$channel] from ignore list\n");
|
||||
return "/msg $nick [$target][$channel] unignored";
|
||||
}
|
||||
|
||||
sub check_ignore {
|
||||
my ($nick, $user, $host, $channel) = @_;
|
||||
$channel = lc $channel;
|
||||
|
||||
my $hostmask = "$nick!$user\@$host";
|
||||
|
||||
foreach my $ignored (keys %ignore_list) {
|
||||
foreach my $ignored_channel (keys %{ $ignore_list{$ignored} }) {
|
||||
$logger->log("check_ignore: comparing '$hostmask' against '$ignored' for channel '$channel'\n");
|
||||
if(($channel =~ /$ignored_channel/i) && ($hostmask =~ /$ignored/i)) {
|
||||
$logger->log("$nick!$user\@$host message ignored in channel $channel (matches [$ignored] host and [$ignored_channel] channel)\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
667
PBot/InternalCommands.pm
Normal file
667
PBot/InternalCommands.pm
Normal file
@ -0,0 +1,667 @@
|
||||
package PBot::InternalCommands;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw(%flood_watch $logger %commands $conn %admins $botnick %internal_commands);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
*flood_watch = \%PBot::AntiFlood::flood_watch;
|
||||
*logger = \$PBot::PBot::logger;
|
||||
*commands = \%PBot::FactoidStuff::commands;
|
||||
*conn = \$PBot::PBot::conn;
|
||||
*admins = \%PBot::BotAdminStuff::admins;
|
||||
*botnick = \$PBot::PBot::botnick;
|
||||
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
|
||||
#internal commands
|
||||
# TODO: Move commands to respective module files
|
||||
%internal_commands = (
|
||||
alias => { sub => \&alias, level=> 0 },
|
||||
add => { sub => \&add_text, level=> 0 },
|
||||
regex => { sub => \&add_regex, level=> 0 },
|
||||
learn => { sub => \&add_text, level=> 0 },
|
||||
grab => { sub => \&PBot::Quotegrabs::quotegrab, level=> 0 },
|
||||
delq => { sub => \&PBot::Quotegrabs::delete_quotegrab, level=> 40 },
|
||||
getq => { sub => \&PBot::Quotegrabs::show_quotegrab, level=> 0 },
|
||||
rq => { sub => \&PBot::Quotegrabs::show_random_quotegrab, level=> 0 },
|
||||
info => { sub => \&info, level=> 0 },
|
||||
show => { sub => \&show, level=> 0 },
|
||||
histogram => { sub => \&histogram, level=> 0 },
|
||||
top20 => { sub => \&top20, level=> 0 },
|
||||
count => { sub => \&count, level=> 0 },
|
||||
find => { sub => \&find, level=> 0 },
|
||||
change => { sub => \&change_text, level=> 0 },
|
||||
remove => { sub => \&remove_text, level=> 0 },
|
||||
forget => { sub => \&remove_text, level=> 0 },
|
||||
export => { sub => \&export, level=> 20 },
|
||||
list => { sub => \&list, level=> 0 },
|
||||
load => { sub => \&load_module, level=> 40 },
|
||||
unload => { sub => \&unload_module, level=> 40 },
|
||||
enable => { sub => \&enable_command, level=> 20 },
|
||||
disable => { sub => \&disable_command, level=> 20 },
|
||||
quiet => { sub => \&PBot::OperatorStuff::quiet, level=> 10 },
|
||||
unquiet => { sub => \&PBot::OperatorStuff::unquiet, level=> 10 },
|
||||
ignore => { sub => \&PBot::IgnoreList::ignore_user, level=> 10 },
|
||||
unignore => { sub => \&PBot::IgnoreList::unignore_user, level=> 10 },
|
||||
ban => { sub => \&PBot::OperatorStuff::ban_user, level=> 10 },
|
||||
unban => { sub => \&PBot::OperatorStuff::unban_user, level=> 10 },
|
||||
kick => { sub => \&PBot::OperatorStuff::kick_nick, level=> 10 },
|
||||
login => { sub => \&login, level=> 0 },
|
||||
logout => { sub => \&logout, level=> 0 },
|
||||
join => { sub => \&join_channel, level=> 50 },
|
||||
part => { sub => \&part_channel, level=> 50 },
|
||||
addadmin => { sub => \&add_admin, level=> 40 },
|
||||
deladmin => { sub => \&del_admin, level=> 40 },
|
||||
die => { sub => \&ack_die, level=> 50 }
|
||||
);
|
||||
|
||||
|
||||
sub list {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my $text;
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "/msg $nick Usage: list <modules|factoids|commands|admins>";
|
||||
}
|
||||
|
||||
if($arguments =~/^messages\s+(.*?)\s+(.*)$/) {
|
||||
my $nick_search = $1;
|
||||
my $channel = $2;
|
||||
|
||||
if(not exists $flood_watch{$nick_search}) {
|
||||
return "/msg $nick No messages for $nick_search yet.";
|
||||
}
|
||||
|
||||
if(not exists $flood_watch{$nick_search}{$channel}) {
|
||||
return "/msg $nick No messages for $nick_search in $channel yet.";
|
||||
}
|
||||
|
||||
my @messages = @{ $flood_watch{$nick_search}{$channel}{messages} };
|
||||
|
||||
for(my $i = 0; $i <= $#messages; $i++) {
|
||||
$conn->privmsg($nick, "" . ($i + 1) . ": " . $messages[$i]->{msg} . "\n") unless $nick =~ /\Q$botnick\E/i;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
if($arguments =~ /^modules$/i) {
|
||||
$text = "Loaded modules: ";
|
||||
foreach my $command (sort keys %commands) {
|
||||
if(exists $commands{$command}{module}) {
|
||||
$text .= "$command ";
|
||||
}
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
if($arguments =~ /^commands$/i) {
|
||||
$text = "Internal commands: ";
|
||||
foreach my $command (sort keys %internal_commands) {
|
||||
$text .= "$command ";
|
||||
$text .= "($internal_commands{$command}{level}) "
|
||||
if $internal_commands{$command}{level} > 0;
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
if($arguments =~ /^factoids$/i) {
|
||||
return "For a list of factoids see http://blackshell.com/~msmud/candide/factoids.html";
|
||||
}
|
||||
|
||||
if($arguments =~ /^admins$/i) {
|
||||
$text = "Admins: ";
|
||||
foreach my $admin (sort { $admins{$b}{level} <=> $admins{$a}{level} } keys %admins) {
|
||||
$text .= "*" if exists $admins{$admin}{login};
|
||||
$text .= "$admin ($admins{$admin}{level}) ";
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
return "/msg $nick Usage: list <modules|commands|factoids|admins>";
|
||||
}
|
||||
|
||||
sub alias {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my ($alias, $command) = $arguments =~ /^(.*?)\s+(.*)$/ if defined $arguments;
|
||||
|
||||
if(not defined $command) {
|
||||
$logger->log("alias: invalid usage\n");
|
||||
return "/msg $nick Usage: alias <keyword> <command>";
|
||||
}
|
||||
|
||||
if(exists $commands{$alias}) {
|
||||
$logger->log("attempt to overwrite existing command\n");
|
||||
return "/msg $nick '$alias' already exists";
|
||||
}
|
||||
|
||||
$commands{$alias}{text} = "/call $command";
|
||||
$commands{$alias}{owner} = $nick;
|
||||
$commands{$alias}{timestamp} = time();
|
||||
$commands{$alias}{enabled} = 1;
|
||||
$commands{$alias}{ref_count} = 0;
|
||||
$commands{$alias}{ref_user} = "nobody";
|
||||
$logger->log("$nick!$user\@$host aliased $alias => $command\n");
|
||||
PBot::FactoidStuff::save_commands();
|
||||
return "/msg $nick '$alias' aliases '$command'";
|
||||
}
|
||||
|
||||
sub add_regex {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my ($keyword, $text) = $arguments =~ /^(.*?)\s+(.*)$/ if defined $arguments;
|
||||
|
||||
if(not defined $keyword) {
|
||||
$text = "";
|
||||
foreach my $command (sort keys %commands) {
|
||||
if(exists $commands{$command}{regex}) {
|
||||
$text .= $command . " ";
|
||||
}
|
||||
}
|
||||
return "Stored regexs: $text";
|
||||
}
|
||||
|
||||
if(not defined $text) {
|
||||
$logger->log("add_regex: invalid usage\n");
|
||||
return "/msg $nick Usage: regex <regex> <command>";
|
||||
}
|
||||
|
||||
if(exists $commands{$keyword}) {
|
||||
$logger->log("$nick!$user\@$host attempt to overwrite $keyword\n");
|
||||
return "/msg $nick $keyword already exists.";
|
||||
}
|
||||
|
||||
$commands{$keyword}{regex} = $text;
|
||||
$commands{$keyword}{owner} = $nick;
|
||||
$commands{$keyword}{timestamp} = time();
|
||||
$commands{$keyword}{enabled} = 1;
|
||||
$commands{$keyword}{ref_count} = 0;
|
||||
$commands{$keyword}{ref_user} = "nobody";
|
||||
$logger->log("$nick!$user\@$host added [$keyword] => [$text]\n");
|
||||
PBot::FactoidStuff::save_commands();
|
||||
return "/msg $nick $keyword added.";
|
||||
}
|
||||
|
||||
sub add_text {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my ($keyword, $text) = $arguments =~ /^(.*?)\s+(.*)$/ if defined $arguments;
|
||||
|
||||
if(not defined $text) {
|
||||
$logger->log("add_text: invalid usage\n");
|
||||
return "/msg $nick Usage: add <keyword> <factoid>";
|
||||
}
|
||||
|
||||
if(not defined $keyword) {
|
||||
$logger->log("add_text: invalid usage\n");
|
||||
return "/msg $nick Usage: add <keyword> <factoid>";
|
||||
}
|
||||
|
||||
$text =~ s/^is\s+//;
|
||||
|
||||
if(exists $commands{$keyword}) {
|
||||
$logger->log("$nick!$user\@$host attempt to overwrite $keyword\n");
|
||||
return "/msg $nick $keyword already exists.";
|
||||
}
|
||||
|
||||
$commands{$keyword}{text} = $text;
|
||||
$commands{$keyword}{owner} = $nick;
|
||||
$commands{$keyword}{timestamp} = time();
|
||||
$commands{$keyword}{enabled} = 1;
|
||||
$commands{$keyword}{ref_count} = 0;
|
||||
$commands{$keyword}{ref_user} = "nobody";
|
||||
|
||||
$logger->log("$nick!$user\@$host added $keyword => $text\n");
|
||||
|
||||
PBot::FactoidStuff::save_commands();
|
||||
|
||||
return "/msg $nick $keyword added.";
|
||||
}
|
||||
|
||||
sub histogram {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my %hash;
|
||||
my $factoids = 0;
|
||||
|
||||
foreach my $command (keys %commands) {
|
||||
if(exists $commands{$command}{text}) {
|
||||
$hash{$commands{$command}{owner}}++;
|
||||
$factoids++;
|
||||
}
|
||||
}
|
||||
|
||||
my $text;
|
||||
my $i = 0;
|
||||
|
||||
foreach my $owner (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
|
||||
my $percent = int($hash{$owner} / $factoids * 100);
|
||||
$percent = 1 if $percent == 0;
|
||||
$text .= "$owner: $hash{$owner} ($percent". "%) ";
|
||||
$i++;
|
||||
last if $i >= 10;
|
||||
}
|
||||
return "$factoids factoids, top 10 submitters: $text";
|
||||
}
|
||||
|
||||
sub show {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "/msg $nick Usage: show <factoid>";
|
||||
}
|
||||
|
||||
if(not exists $commands{$arguments}) {
|
||||
return "/msg $nick $arguments not found";
|
||||
}
|
||||
|
||||
if(exists $commands{$arguments}{command} || exists $commands{$arguments}{module}) {
|
||||
return "/msg $nick $arguments is not a factoid";
|
||||
}
|
||||
|
||||
my $type;
|
||||
$type = 'text' if exists $commands{$arguments}{text};
|
||||
$type = 'regex' if exists $commands{$arguments}{regex};
|
||||
return "$arguments: $commands{$arguments}{$type}";
|
||||
}
|
||||
|
||||
sub info {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "/msg $nick Usage: info <factoid|module>";
|
||||
}
|
||||
|
||||
if(not exists $commands{$arguments}) {
|
||||
return "/msg $nick $arguments not found";
|
||||
}
|
||||
|
||||
# factoid
|
||||
if(exists $commands{$arguments}{text}) {
|
||||
my ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) =
|
||||
localtime($commands{$arguments}{timestamp});
|
||||
my $t = sprintf("%02d:%02d:%02d-%04d/%02d/%02d",
|
||||
$hours, $minutes, $seconds, $year+1900, $month+1, $day_of_month);
|
||||
return "$arguments: Factoid submitted by $commands{$arguments}{owner} on $t, referenced $commands{$arguments}{ref_count} times (last by $commands{$arguments}{ref_user})";
|
||||
}
|
||||
|
||||
# module
|
||||
if(exists $commands{$arguments}{module}) {
|
||||
my ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) =
|
||||
localtime($commands{$arguments}{timestamp});
|
||||
my $t = sprintf("%02d:%02d:%02d-%04d/%02d/%02d",
|
||||
$hours, $minutes, $seconds, $year+1900, $month+1, $day_of_month);
|
||||
return "$arguments: Module loaded by $commands{$arguments}{owner} on $t -> http://code.google.com/p/pbot2-pl/source/browse/trunk/modules/$commands{$arguments}{module}, used $commands{$arguments}{ref_count} times (last by $commands{$arguments}{ref_user})";
|
||||
}
|
||||
|
||||
# regex
|
||||
if(exists $commands{$arguments}{regex}) {
|
||||
my ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) =
|
||||
localtime($commands{$arguments}{timestamp});
|
||||
my $t = sprintf("%02d:%02d:%02d-%04d/%02d/%02d",
|
||||
$hours, $minutes, $seconds, $year+1900, $month+1, $day_of_month);
|
||||
return "$arguments: Regex created by $commands{$arguments}{owner} on $t, used $commands{$arguments}{ref_count} times (last by $commands{$arguments}{ref_user})";
|
||||
}
|
||||
|
||||
return "/msg $nick $arguments is not a factoid or a module";
|
||||
}
|
||||
|
||||
sub top20 {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my %hash = ();
|
||||
my $text = "";
|
||||
my $i = 0;
|
||||
|
||||
if(not defined $arguments) {
|
||||
foreach my $command (sort {$commands{$b}{ref_count} <=> $commands{$a}{ref_count}} keys %commands) {
|
||||
if($commands{$command}{ref_count} > 0 && exists $commands{$command}{text}) {
|
||||
$text .= "$command ($commands{$command}{ref_count}) ";
|
||||
$i++;
|
||||
last if $i >= 20;
|
||||
}
|
||||
}
|
||||
$text = "Top $i referenced factoids: $text" if $i > 0;
|
||||
return $text;
|
||||
} else {
|
||||
|
||||
if(lc $arguments eq "recent") {
|
||||
foreach my $command (sort { $commands{$b}{timestamp} <=> $commands{$a}{timestamp} } keys %commands) {
|
||||
#my ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) = localtime($commands{$command}{timestamp});
|
||||
#my $t = sprintf("%04d/%02d/%02d", $year+1900, $month+1, $day_of_month);
|
||||
|
||||
$text .= "$command ";
|
||||
$i++;
|
||||
last if $i >= 50;
|
||||
}
|
||||
$text = "$i most recent submissions: $text" if $i > 0;
|
||||
return $text;
|
||||
}
|
||||
|
||||
my $user = lc $arguments;
|
||||
foreach my $command (sort keys %commands) {
|
||||
if($commands{$command}{ref_user} =~ /\Q$arguments\E/i) {
|
||||
if($user ne lc $commands{$command}{ref_user} && not $user =~ /$commands{$command}{ref_user}/i) {
|
||||
$user .= " ($commands{$command}{ref_user})";
|
||||
}
|
||||
$text .= "$command ";
|
||||
$i++;
|
||||
last if $i >= 20;
|
||||
}
|
||||
}
|
||||
$text = "$i factoids last referenced by $user: $text" if $i > 0;
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
|
||||
sub count {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my $i = 0;
|
||||
my $total = 0;
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "/msg $nick Usage: count <nick|factoids>";
|
||||
}
|
||||
|
||||
$arguments = ".*" if($arguments =~ /^factoids$/);
|
||||
|
||||
eval {
|
||||
foreach my $command (keys %commands) {
|
||||
$total++ if exists $commands{$command}{text};
|
||||
my $regex = qr/^\Q$arguments\E$/;
|
||||
if($commands{$command}{owner} =~ /$regex/i && exists $commands{$command}{text}) {
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
};
|
||||
return "/msg $nick $arguments: $@" if $@;
|
||||
|
||||
return "I have $i factoids" if($arguments eq ".*");
|
||||
|
||||
if($i > 0) {
|
||||
my $percent = int($i / $total * 100);
|
||||
$percent = 1 if $percent == 0;
|
||||
return "$arguments has submitted $i factoids out of $total ($percent"."%)";
|
||||
} else {
|
||||
return "$arguments hasn't submitted any factoids";
|
||||
}
|
||||
}
|
||||
|
||||
sub find {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my $i = 0;
|
||||
my $text;
|
||||
my $type;
|
||||
|
||||
foreach my $command (sort keys %commands) {
|
||||
if(exists $commands{$command}{text} || exists $commands{$command}{regex}) {
|
||||
$type = 'text' if(exists $commands{$command}{text});
|
||||
$type = 'regex' if(exists $commands{$command}{regex});
|
||||
$logger->log("Checking [$command], type: [$type]\n");
|
||||
eval {
|
||||
my $regex = qr/$arguments/;
|
||||
if($commands{$command}{$type} =~ /$regex/i || $command =~ /$regex/i)
|
||||
{
|
||||
$i++;
|
||||
$text .= "$command ";
|
||||
}
|
||||
};
|
||||
return "/msg $nick $arguments: $@" if $@;
|
||||
}
|
||||
}
|
||||
|
||||
if($i == 1) {
|
||||
chop $text;
|
||||
$type = 'text' if exists $commands{$text}{text};
|
||||
$type = 'regex' if exists $commands{$text}{regex};
|
||||
return "found one match: '$text' is '$commands{$text}{$type}'";
|
||||
} else {
|
||||
return "$i factoids contain '$arguments': $text" unless $i == 0;
|
||||
return "No factoids contain '$arguments'";
|
||||
}
|
||||
}
|
||||
|
||||
sub change_text {
|
||||
$logger->log("Enter change_text\n");
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my ($keyword, $delim, $tochange, $changeto, $modifier);
|
||||
|
||||
if(defined $arguments) {
|
||||
if($arguments =~ /^(.*?)\s+s(.)/) {
|
||||
$keyword = $1;
|
||||
$delim = $2;
|
||||
}
|
||||
|
||||
if($arguments =~ /$delim(.*?)$delim(.*)$delim(.*)?$/) {
|
||||
$tochange = $1;
|
||||
$changeto = $2;
|
||||
$modifier = $3;
|
||||
}
|
||||
}
|
||||
|
||||
if(not defined $changeto) {
|
||||
$logger->log("($from) $nick!$user\@$host: improper use of change\n");
|
||||
return "/msg $nick Usage: change <keyword> s/<to change>/<change to>/";
|
||||
}
|
||||
|
||||
if(not exists $commands{$keyword}) {
|
||||
$logger->log("($from) $nick!$user\@$host: attempted to change nonexistant '$keyword'\n");
|
||||
return "/msg $nick $keyword not found.";
|
||||
}
|
||||
|
||||
my $type;
|
||||
$type = 'text' if exists $commands{$keyword}{text};
|
||||
$type = 'regex' if exists $commands{$keyword}{regex};
|
||||
|
||||
$logger->log("keyword: $keyword, type: $type, tochange: $tochange, changeto: $changeto\n");
|
||||
|
||||
my $ret = eval {
|
||||
my $regex = qr/$tochange/;
|
||||
if(not $commands{$keyword}{$type} =~ s|$regex|$changeto|) {
|
||||
$logger->log("($from) $nick!$user\@$host: failed to change '$keyword' 's$delim$tochange$delim$changeto$delim\n");
|
||||
return "/msg $nick Change $keyword failed.";
|
||||
} else {
|
||||
$logger->log("($from) $nick!$user\@$host: changed '$keyword' 's/$tochange/$changeto/\n");
|
||||
PBot::FactoidStuff::save_commands();
|
||||
return "Changed: $keyword is $commands{$keyword}{$type}";
|
||||
}
|
||||
};
|
||||
return "/msg $nick Change $keyword: $@" if $@;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub remove_text {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $arguments) {
|
||||
$logger->log("remove_text: invalid usage\n");
|
||||
return "/msg $nick Usage: remove <keyword>";
|
||||
}
|
||||
|
||||
$logger->log("Attempting to remove [$arguments]\n");
|
||||
if(not exists $commands{$arguments}) {
|
||||
return "/msg $nick $arguments not found.";
|
||||
}
|
||||
|
||||
if(exists $commands{$arguments}{command} || exists $commands{$arguments}{module}) {
|
||||
$logger->log("$nick!$user\@$host attempted to remove $arguments [not factoid]\n");
|
||||
return "/msg $nick $arguments is not a factoid.";
|
||||
}
|
||||
|
||||
if(($nick ne $commands{$arguments}{owner}) and (not PBot::BotAdminStuff::loggedin($nick, $host))) {
|
||||
$logger->log("$nick!$user\@$host attempted to remove $arguments [not owner]\n");
|
||||
return "/msg $nick You are not the owner of '$arguments'";
|
||||
}
|
||||
|
||||
$logger->log("$nick!$user\@$host removed [$arguments][$commands{$arguments}{text}]\n") if(exists $commands{$arguments}{text});
|
||||
$logger->log("$nick!$user\@$host removed [$arguments][$commands{$arguments}{regex}]\n") if(exists $commands{$arguments}{regex});
|
||||
delete $commands{$arguments};
|
||||
PBot::FactoidStuff::save_commands();
|
||||
return "/msg $nick $arguments removed.";
|
||||
}
|
||||
|
||||
sub load_module {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my ($keyword, $module) = $arguments =~ /^(.*?)\s+(.*)$/ if defined $arguments;
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "/msg $nick Usage: load <command> <module>";
|
||||
}
|
||||
|
||||
if(not exists($commands{$keyword})) {
|
||||
$commands{$keyword}{module} = $module;
|
||||
$commands{$keyword}{enabled} = 1;
|
||||
$commands{$keyword}{owner} = $nick;
|
||||
$commands{$keyword}{timestamp} = time();
|
||||
$logger->log("$nick!$user\@$host loaded $keyword => $module\n");
|
||||
PBot::FactoidStuff::save_commands();
|
||||
return "/msg $nick Loaded $keyword => $module";
|
||||
} else {
|
||||
return "/msg $nick There is already a command named $keyword.";
|
||||
}
|
||||
}
|
||||
|
||||
sub unload_module {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "/msg $nick Usage: unload <module>";
|
||||
} elsif(not exists $commands{$arguments}) {
|
||||
return "/msg $nick $arguments not found.";
|
||||
} elsif(not exists $commands{$arguments}{module}) {
|
||||
return "/msg $nick $arguments is not a module.";
|
||||
} else {
|
||||
delete $commands{$arguments};
|
||||
PBot::FactoidStuff::save_commands();
|
||||
$logger->log("$nick!$user\@$host unloaded module $arguments\n");
|
||||
return "/msg $nick $arguments unloaded.";
|
||||
}
|
||||
}
|
||||
|
||||
sub enable_command {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "/msg $nick Usage: enable <command>";
|
||||
} elsif(not exists $commands{$arguments}) {
|
||||
return "/msg $nick $arguments not found.";
|
||||
} else {
|
||||
$commands{$arguments}{enabled} = 1;
|
||||
PBot::FactoidStuff::save_commands();
|
||||
$logger->log("$nick!$user\@$host enabled $arguments\n");
|
||||
return "/msg $nick $arguments enabled.";
|
||||
}
|
||||
}
|
||||
|
||||
sub disable_command {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "/msg $nick Usage: disable <command>";
|
||||
} elsif(not exists $commands{$arguments}) {
|
||||
return "/msg $nick $arguments not found.";
|
||||
} else {
|
||||
$commands{$arguments}{enabled} = 0;
|
||||
PBot::FactoidStuff::save_commands();
|
||||
$logger->log("$nick!$user\@$host disabled $arguments\n");
|
||||
return "/msg $nick $arguments disabled.";
|
||||
}
|
||||
}
|
||||
|
||||
sub login {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(PBot::BotAdminStuff::loggedin($nick, $host)) {
|
||||
return "/msg $nick You are already logged in.";
|
||||
}
|
||||
|
||||
if(not exists $admins{$nick}) {
|
||||
$logger->log("$nick!$user\@$host attempted to login without account.\n");
|
||||
return "/msg $nick You do not have an account.";
|
||||
}
|
||||
|
||||
if($admins{$nick}{password} eq $arguments && $host =~ /$admins{$nick}{host}/i) {
|
||||
$admins{$nick}{login} = 1;
|
||||
$logger->log("$nick!$user\@$host logged in.\n");
|
||||
return "/msg $nick Welcome $nick, how may I help you?";
|
||||
} else {
|
||||
$logger->log("$nick!$user\@$host received wrong password.\n");
|
||||
return "/msg $nick I don't think so.";
|
||||
}
|
||||
}
|
||||
|
||||
sub logout {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
return "/msg $nick Uh, you aren't logged in." if(not PBot::BotAdminStuff::loggedin($nick, $host));
|
||||
delete $admins{$nick}{login};
|
||||
$logger->log("$nick!$user\@$host logged out.\n");
|
||||
return "/msg $nick Good-bye, $nick.";
|
||||
}
|
||||
|
||||
sub add_admin {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
return "/msg $nick Coming soon.";
|
||||
}
|
||||
|
||||
sub del_admin {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
return "/msg $nick Coming soon.";
|
||||
}
|
||||
|
||||
sub join_channel {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
# FIXME -- update %channels hash?
|
||||
$logger->log("$nick!$user\@$host made me join $arguments\n");
|
||||
$conn->join($arguments);
|
||||
return "/msg $nick Joined $arguments";
|
||||
}
|
||||
|
||||
sub part_channel {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
# FIXME -- update %channels hash?
|
||||
$logger->log("$nick!$user\@$host made me part $arguments\n");
|
||||
$conn->part($arguments);
|
||||
return "/msg $nick Parted $arguments";
|
||||
}
|
||||
|
||||
sub ack_die {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
$logger->log("$nick!$user\@$host made me exit.\n");
|
||||
PBot::FactoidStuff::save_commands();
|
||||
$conn->privmsg($from, "Good-bye.") if defined $from;
|
||||
$conn->quit("Departure requested.");
|
||||
exit 0;
|
||||
}
|
||||
|
||||
sub export {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "/msg $nick Usage: export <modules|factoids|admins>";
|
||||
}
|
||||
|
||||
if($arguments =~ /^modules$/i) {
|
||||
return "/msg $nick Coming soon.";
|
||||
}
|
||||
|
||||
if($arguments =~ /^quotegrabs$/i) {
|
||||
return PBot::Quotegrabs::export_quotegrabs();
|
||||
}
|
||||
|
||||
if($arguments =~ /^factoids$/i) {
|
||||
return PBot::Factoids::export_factoids();
|
||||
}
|
||||
|
||||
if($arguments =~ /^admins$/i) {
|
||||
return "/msg $nick Coming soon.";
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
394
PBot/Interpreter.pm
Normal file
394
PBot/Interpreter.pm
Normal file
@ -0,0 +1,394 @@
|
||||
# File: Interpreter.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: Parses a single line of input and takes appropriate action.
|
||||
|
||||
package PBot::Interpreter;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw($conn $MAX_FLOOD_MESSAGES $FLOOD_CHAT $logger %commands $botnick %admins %internal_commands
|
||||
$max_msg_len $last_timestamp $flood_msg);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
|
||||
*logger = \$PBot::PBot::logger;
|
||||
*conn = \$PBot::PBot::conn;
|
||||
*commands = \%PBot::FactoidStuff::commands;
|
||||
*botnick = \$PBot::PBot::botnick;
|
||||
*admins = \%PBot::BotAdminStuff::admins;
|
||||
*internal_commands = \%PBot::InternalCommands::internal_commands;
|
||||
*max_msg_len = \$PBot::PBot::max_msg_len;
|
||||
*last_timestamp = \$PBot::AntiFlood::last_timestamp;
|
||||
*flood_msg = \$PBot::AntiFlood::flood_msg;
|
||||
*FLOOD_CHAT = \$PBot::AntiFlood::FLOOD_CHAT;
|
||||
*MAX_FLOOD_MESSAGES = \$PBot::PBot::MAX_FLOOD_MESSAGES;
|
||||
|
||||
sub process_line {
|
||||
my ($from, $nick, $user, $host, $text) = @_;
|
||||
|
||||
my ($command, $args, $result);
|
||||
my $has_url = undef;
|
||||
my $mynick = $conn->nick;
|
||||
|
||||
$from = lc $from if defined $from;
|
||||
|
||||
PBot::AntiFlood::check_flood($from, $nick, $user, $host, $text, $MAX_FLOOD_MESSAGES, $FLOOD_CHAT) if defined $from;
|
||||
|
||||
if($text =~ /^.?$mynick.?\s+(.*?)([\?!]*)$/i) {
|
||||
$command = "$1";
|
||||
} elsif($text =~ /^(.*?),?\s+$mynick([\?!]*)$/i) {
|
||||
$command = "$1";
|
||||
} elsif($text =~ /^!(.*?)(\?*)$/) {
|
||||
$command = "$1";
|
||||
} elsif($text =~ /http:\/\/([^\s]+)/i) {
|
||||
$has_url = $1;
|
||||
}
|
||||
|
||||
if(defined $command || defined $has_url) {
|
||||
if((defined $command && $command !~ /^login/i) || defined $has_url) {
|
||||
$logger->log("ignored text: [$nick][$host][$from][$text]\n") and return if(defined $from && PBot::IgnoreList::check_ignore($nick, $user, $host, $from) && not PBot::BotAdminStuff::loggedin($nick, $host)); # ignored host
|
||||
}
|
||||
|
||||
my $now = gettimeofday;
|
||||
|
||||
if(defined $from) { # do not execute following if text is coming from STDIN ($from undef)
|
||||
if($from =~ /^#/) {
|
||||
$flood_msg++;
|
||||
$logger->log("flood_msg: $flood_msg\n");
|
||||
}
|
||||
|
||||
if($flood_msg > 3) {
|
||||
$logger->log("flood_msg exceeded! [$flood_msg]\n");
|
||||
PBot::IgnoreList::ignore_user("", "floodcontrol", "", ".* $from 300");
|
||||
$flood_msg = 0;
|
||||
if($from =~ /^#/) {
|
||||
$conn->me($from, "has been overwhelmed.");
|
||||
$conn->me($from, "lies down and falls asleep.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if($now - $last_timestamp >= 15) {
|
||||
$last_timestamp = $now;
|
||||
if($flood_msg > 0) {
|
||||
$logger->log("flood_msg reset: (was $flood_msg)\n");
|
||||
$flood_msg = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(not defined $has_url) {
|
||||
$result = interpret_command($from, $nick, $user, $host, 1, $command);
|
||||
} else {
|
||||
$result = PBot::Modules::execute_module($from, undef, $nick, $user, $host, "title", "$nick http://$has_url");
|
||||
}
|
||||
|
||||
$result =~ s/\$nick/$nick/g;
|
||||
|
||||
# TODO add paging system?
|
||||
if(defined $result && length $result > 0) {
|
||||
my $len = length $result;
|
||||
if($len > $max_msg_len) {
|
||||
if(($len - $max_msg_len) > 10) {
|
||||
$logger->log("Message truncated.\n");
|
||||
$result = substr($result, 0, $max_msg_len);
|
||||
substr($result, $max_msg_len) = "... (" . ($len - $max_msg_len) . " more characters)";
|
||||
}
|
||||
}
|
||||
|
||||
$logger->log("Final result: $result\n");
|
||||
|
||||
if($result =~ s/^\/me\s+//i) {
|
||||
$conn->me($from, $result) if defined $from && $from !~ /\Q$botnick\E/i;
|
||||
} elsif($result =~ s/^\/msg\s+([^\s]+)\s+//i) {
|
||||
my $to = $1;
|
||||
if($to =~ /.*serv$/i) {
|
||||
$logger->log("[HACK] Possible HACK ATTEMPT /msg *serv: [$nick!$user\@$host] [$command] [$result]\n");
|
||||
}
|
||||
elsif($result =~ s/^\/me\s+//i) {
|
||||
$conn->me($to, $result) if $to !~ /\Q$botnick\E/i;
|
||||
} else {
|
||||
$result =~ s/^\/say\s+//i;
|
||||
$conn->privmsg($to, $result) if $to !~ /\Q$botnick\E/i;
|
||||
}
|
||||
} else {
|
||||
$conn->privmsg($from, $result) if defined $from && $from !~ /\Q$botnick\E/i;
|
||||
}
|
||||
}
|
||||
$logger->log("---------------------------------------------\n");
|
||||
exit if($PBot::Modules::child != 0); # if this process is a child, it must die now
|
||||
}
|
||||
}
|
||||
|
||||
sub interpret_command {
|
||||
my ($from, $nick, $user, $host, $count, $command) = @_;
|
||||
my ($keyword, $arguments, $tonick);
|
||||
my $text;
|
||||
|
||||
$logger->log("=== Enter interpret_command: [" . (defined $from ? $from : "(undef)") . "][$nick!$user\@$host][$count][$command]\n");
|
||||
|
||||
return "Too many levels of recursion, aborted." if(++$count > 5);
|
||||
|
||||
if(not defined $nick || not defined $user || not defined $host ||
|
||||
not defined $command) {
|
||||
$logger->log("Error 1, bad parameters to interpret_command\n");
|
||||
return "";
|
||||
}
|
||||
|
||||
if($command =~ /^tell\s+(.{1,20})\s+about\s+(.*?)\s+(.*)$/i)
|
||||
{
|
||||
($keyword, $arguments, $tonick) = ($2, $3, $1);
|
||||
} elsif($command =~ /^tell\s+(.{1,20})\s+about\s+(.*)$/) {
|
||||
($keyword, $tonick) = ($2, $1);
|
||||
} elsif($command =~ /^([^ ]+)\s+is\s+also\s+(.*)$/) {
|
||||
($keyword, $arguments) = ("change", "$1 s,\$, ; $2,");
|
||||
} elsif($command =~ /^([^ ]+)\s+is\s+(.*)$/) {
|
||||
($keyword, $arguments) = ("add", join(' ', $1, $2)) unless exists $commands{$1};
|
||||
($keyword, $arguments) = ($1, "is $2") if exists $commands{$1};
|
||||
} elsif($command =~ /^(.*?)\s+(.*)$/) {
|
||||
($keyword, $arguments) = ($1, $2);
|
||||
} else {
|
||||
$keyword = $1 if $command =~ /^(.*)$/;
|
||||
}
|
||||
|
||||
$arguments =~ s/\bme\b/\$nick/gi if defined $arguments;
|
||||
$arguments =~ s/\/\$nick/\/me/gi if defined $arguments;
|
||||
|
||||
$logger->log("keyword: [$keyword], arguments: [" . (defined $arguments ? $arguments : "(undef)") . "], tonick: [" . (defined $tonick ? $tonick : "(undef)") . "]\n");
|
||||
|
||||
if(defined $arguments && $arguments =~ m/\b(your|him|her|its|it|them|their)(self|selves)\b/i) {
|
||||
return "Why would I want to do that to myself?";
|
||||
}
|
||||
|
||||
if(not defined $keyword) {
|
||||
$logger->log("Error 2, no keyword\n");
|
||||
return "";
|
||||
}
|
||||
|
||||
# Check if it's an alias
|
||||
if(exists $commands{$keyword} and exists $commands{$keyword}{text}) {
|
||||
if($commands{$keyword}{text} =~ /^\/call\s+(.*)$/) {
|
||||
if(defined $arguments) {
|
||||
$command = "$1 $arguments";
|
||||
} else {
|
||||
$command = $1;
|
||||
}
|
||||
|
||||
$logger->log("Command aliased to: [$command]\n");
|
||||
|
||||
$commands{$keyword}{ref_count}++;
|
||||
$commands{$keyword}{ref_user} = $nick;
|
||||
|
||||
return interpret_command($from, $nick, $user, $host, $count, $command);
|
||||
}
|
||||
}
|
||||
|
||||
#$logger->log("Checking internal commands\n");
|
||||
|
||||
# First, we check internal commands
|
||||
foreach $command (keys %internal_commands) {
|
||||
if($keyword =~ /^$command$/i) {
|
||||
$keyword = lc $keyword;
|
||||
if($internal_commands{$keyword}{level} > 0) {
|
||||
return "/msg $nick You must login to use this command."
|
||||
if not PBot::BotAdminStuff::loggedin($nick, $host);
|
||||
return "/msg $nick Your access level of $admins{$nick}{level} is not sufficent to use this command."
|
||||
if $admins{$nick}{level} < $internal_commands{$keyword}{level};
|
||||
}
|
||||
$logger->log("(" . (defined $from ? $from : "(undef)") . "): $nick!$user\@$host Executing internal command: $keyword " . (defined $arguments ? $arguments : "") . "\n");
|
||||
return $internal_commands{$keyword}{sub}($from, $nick, $user, $host, $arguments);
|
||||
}
|
||||
}
|
||||
|
||||
#$logger->log("Checking bot commands\n");
|
||||
|
||||
# Then, we check bot commands
|
||||
foreach $command (keys %commands) {
|
||||
my $lc_command = lc $command;
|
||||
if(lc $keyword =~ m/^\Q$lc_command\E$/i) {
|
||||
|
||||
$logger->log("=======================\n");
|
||||
$logger->log("[$keyword] == [$command]\n");
|
||||
|
||||
if($commands{$command}{enabled} == 0) {
|
||||
$logger->log("$command disabled.\n");
|
||||
return "$command is currently disabled.";
|
||||
} elsif(exists $commands{$command}{module}) {
|
||||
$logger->log("Found module\n");
|
||||
|
||||
$commands{$keyword}{ref_count}++;
|
||||
$commands{$keyword}{ref_user} = $nick;
|
||||
|
||||
$text = PBot::Modules::execute_module($from, $tonick, $nick, $user, $host, $keyword, $arguments);
|
||||
return $text;
|
||||
}
|
||||
elsif(exists $commands{$command}{text}) {
|
||||
$logger->log("Found factoid\n");
|
||||
|
||||
# Don't allow user-custom /msg factoids, unless factoid triggered by admin
|
||||
if(($commands{$command}{text} =~ m/^\/msg/i) and (not PBot::BotAdminStuff::loggedin($nick, $host))) {
|
||||
$logger->log("[HACK] Bad factoid (contains /msg): $commands{$command}{text}\n");
|
||||
return "You must login to use this command."
|
||||
}
|
||||
|
||||
$commands{$command}{ref_count}++;
|
||||
$commands{$command}{ref_user} = $nick;
|
||||
|
||||
$logger->log("(" . (defined $from ? $from : "(undef)") . "): $nick!$user\@$host): $command: Displaying text \"$commands{$command}{text}\"\n");
|
||||
|
||||
if(defined $tonick) { # !tell foo about bar
|
||||
$logger->log("($from): $nick!$user\@$host) sent to $tonick\n");
|
||||
my $fromnick = PBot::BotAdminStuff::loggedin($nick, $host) ? "" : "$nick wants you to know: ";
|
||||
$text = $commands{$command}{text};
|
||||
|
||||
if($text =~ s/^\/say\s+//i || $text =~ s/^\/me\s+/* $botnick /i
|
||||
|| $text =~ /^\/msg\s+/i) {
|
||||
$text = "/msg $tonick $fromnick$text";
|
||||
} else {
|
||||
$text = "/msg $tonick $fromnick$command is $text";
|
||||
}
|
||||
|
||||
$logger->log("text set to [$text]\n");
|
||||
} else {
|
||||
$text = $commands{$command}{text};
|
||||
}
|
||||
|
||||
if(defined $arguments) {
|
||||
$logger->log("got arguments: [$arguments]\n");
|
||||
|
||||
# TODO - extract and remove $tonick from end of $arguments
|
||||
if(not $text =~ s/\$args/$arguments/gi) {
|
||||
$logger->log("factoid doesn't take argument, checking ...\n");
|
||||
# factoid doesn't take an argument
|
||||
if($arguments =~ /^[^ ]{1,20}$/) {
|
||||
# might be a nick
|
||||
$logger->log("could be nick\n");
|
||||
if($text =~ /^\/.+? /) {
|
||||
$text =~ s/^(\/.+?) /$1 $arguments: /;
|
||||
} else {
|
||||
$text =~ s/^/\/say $arguments: $command is / unless (defined $tonick);
|
||||
}
|
||||
} else {
|
||||
if($text !~ /^\/.+? /) {
|
||||
$text =~ s/^/\/say $command is / unless (defined $tonick);
|
||||
}
|
||||
}
|
||||
$logger->log("updated text: [$text]\n");
|
||||
}
|
||||
$logger->log("replaced \$args: [$text]\n");
|
||||
} else {
|
||||
# no arguments supplied
|
||||
$text =~ s/\$args/$nick/gi;
|
||||
}
|
||||
|
||||
$text =~ s/\$nick/$nick/g;
|
||||
|
||||
while($text =~ /[^\\]\$([^\s!+.$\/\\,;=&]+)/g) {
|
||||
my $var = $1;
|
||||
#$logger->log("adlib: got [$var]\n");
|
||||
#$logger->log("adlib: parsing variable [\$$var]\n");
|
||||
if(exists $commands{$var} && exists $commands{$var}{text}) {
|
||||
my $change = $commands{$var}{text};
|
||||
my @list = split(/\s|(".*?")/, $change);
|
||||
my @mylist;
|
||||
#$logger->log("adlib: list [". join(':', @mylist) ."]\n");
|
||||
for(my $i = 0; $i <= $#list; $i++) {
|
||||
#$logger->log("adlib: pushing $i $list[$i]\n");
|
||||
push @mylist, $list[$i] if $list[$i];
|
||||
}
|
||||
my $line = int(rand($#mylist + 1));
|
||||
$mylist[$line] =~ s/"//g;
|
||||
$text =~ s/\$$var/$mylist[$line]/;
|
||||
#$logger->log("adlib: found: change: $text\n");
|
||||
} else {
|
||||
$text =~ s/\$$var/$var/g;
|
||||
#$logger->log("adlib: not found: change: $text\n");
|
||||
}
|
||||
}
|
||||
|
||||
$text =~ s/\\\$/\$/g;
|
||||
|
||||
# $logger->log("finally... [$text]\n");
|
||||
if($text =~ s/^\/say\s+//i || $text =~ /^\/me\s+/i
|
||||
|| $text =~ /^\/msg\s+/i) {
|
||||
# $logger->log("ret1\n");
|
||||
return $text;
|
||||
} else {
|
||||
# $logger->log("ret2\n");
|
||||
return "$command is $text";
|
||||
}
|
||||
|
||||
$logger->log("unknown3: [$text]\n");
|
||||
} else {
|
||||
$logger->log("($from): $nick!$user\@$host): Unknown command type for '$command'\n");
|
||||
return "/me blinks.";
|
||||
}
|
||||
$logger->log("unknown4: [$text]\n");
|
||||
} # else no match
|
||||
} # end foreach
|
||||
|
||||
#$logger->log("Checking regex factoids\n");
|
||||
|
||||
# Otherwise, the command was not found.
|
||||
# Lets try regexp factoids ...
|
||||
my $string = "$keyword" . (defined $arguments ? " $arguments" : "");
|
||||
|
||||
foreach my $command (sort keys %commands) {
|
||||
if(exists $commands{$command}{regex}) {
|
||||
eval {
|
||||
my $regex = qr/$command/i;
|
||||
# $logger->log("testing $string =~ $regex\n");
|
||||
if($string =~ $regex) {
|
||||
$logger->log("[$string] matches [$command][$regex] - calling [" . $commands{$command}{regex}. "$']\n");
|
||||
my $cmd = "$commands{$command}{regex}$'";
|
||||
my $a = $1;
|
||||
my $b = $2;
|
||||
my $c = $3;
|
||||
my $d = $4;
|
||||
my $e = $5;
|
||||
my $f = $6;
|
||||
my $g = $7;
|
||||
my $h = $8;
|
||||
my $i = $9;
|
||||
my $before = $`;
|
||||
my $after = $';
|
||||
$cmd =~ s/\$1/$a/g;
|
||||
$cmd =~ s/\$2/$b/g;
|
||||
$cmd =~ s/\$3/$c/g;
|
||||
$cmd =~ s/\$4/$d/g;
|
||||
$cmd =~ s/\$5/$e/g;
|
||||
$cmd =~ s/\$6/$f/g;
|
||||
$cmd =~ s/\$7/$g/g;
|
||||
$cmd =~ s/\$8/$h/g;
|
||||
$cmd =~ s/\$9/$i/g;
|
||||
$cmd =~ s/\$`/$before/g;
|
||||
$cmd =~ s/\$'/$after/g;
|
||||
$cmd =~ s/^\s+//;
|
||||
$cmd =~ s/\s+$//;
|
||||
$text = interpret_command($from, $nick, $user, $host, $count, $cmd);
|
||||
return $text;
|
||||
}
|
||||
};
|
||||
if($@) {
|
||||
$logger->log("Regex fail: $@\n");
|
||||
return "/msg $nick Fail.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$logger->log("[$keyword] not found.\n");
|
||||
return "";
|
||||
}
|
||||
|
||||
1;
|
46
PBot/Logger.pm
Normal file
46
PBot/Logger.pm
Normal file
@ -0,0 +1,46 @@
|
||||
package PBot::Logger;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
use vars qw($VERSION);
|
||||
|
||||
$VERSION = '1.0.0';
|
||||
|
||||
use Carp ();
|
||||
|
||||
sub new {
|
||||
if(ref($_[1]) eq 'HASH') {
|
||||
Carp::croak("Options to Logger should be key/value pairs, not hash reference");
|
||||
}
|
||||
|
||||
my ($class, %conf) = @_;
|
||||
|
||||
my $log_file = delete $conf{log_file};
|
||||
|
||||
if(defined $log_file) {
|
||||
open PLOG_FILE, ">>$log_file" or Carp::croak "Couldn't open log file: $!\n" if defined $log_file;
|
||||
PLOG_FILE->autoflush(1);
|
||||
}
|
||||
|
||||
my $self = {
|
||||
log_file => $log_file,
|
||||
};
|
||||
|
||||
bless $self, $class;
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub log {
|
||||
my ($self, $text) = @_;
|
||||
my $time = localtime;
|
||||
|
||||
if(defined $self->{log_file}) {
|
||||
print PLOG_FILE "$time :: $text";
|
||||
}
|
||||
|
||||
print "$time :: $text";
|
||||
}
|
||||
|
||||
1;
|
75
PBot/Modules.pm
Normal file
75
PBot/Modules.pm
Normal file
@ -0,0 +1,75 @@
|
||||
# File: Modules.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: Handles forking and execution of module processes
|
||||
|
||||
package PBot::Modules;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw($child %commands $logger $module_dir);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
*commands = \%PBot::InternalCommands::commands;
|
||||
*logger = \$PBot::PBot::logger;
|
||||
*module_dir = \$PBot::PBot::module_dir;
|
||||
|
||||
use POSIX qw(WNOHANG); # for children process reaping
|
||||
|
||||
# automatically reap children processes in background
|
||||
$SIG{CHLD} = sub { while(waitpid(-1, WNOHANG) > 0) {} };
|
||||
|
||||
$child = 0; # determines whether process is child
|
||||
|
||||
sub execute_module {
|
||||
my ($from, $tonick, $nick, $user, $host, $keyword, $arguments) = @_;
|
||||
my $text;
|
||||
|
||||
$arguments = "" if not defined $arguments;
|
||||
|
||||
$logger->log("(" . (defined $from ? $from : "(undef)") . "): $nick!$user\@$host: Executing module $commands{$keyword}{module} $arguments\n");
|
||||
|
||||
$arguments = quotemeta($arguments);
|
||||
$arguments =~ s/\\\s+/ /;
|
||||
|
||||
my $pid = fork;
|
||||
if(not defined $pid) {
|
||||
$logger->log("Could not fork module: $!\n");
|
||||
return "/me groans loudly.";
|
||||
}
|
||||
|
||||
# FIXME -- add check to ensure $commands{$keyword}{module} exists
|
||||
|
||||
if($pid == 0) { # start child block
|
||||
$child = 1; # set to be killed after returning
|
||||
|
||||
if(defined $tonick) {
|
||||
$logger->log("($from): $nick!$user\@$host) sent to $tonick\n");
|
||||
$text = `$module_dir/$commands{$keyword}{module} $arguments`;
|
||||
my $fromnick = PBot::BotAdminStuff::loggedin($nick, $host) ? "" : " ($nick)";
|
||||
#return "/msg $tonick $text$fromnick"; # send private message to user
|
||||
if(defined $text && length $text > 0) {
|
||||
return "$tonick: $text";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return `$module_dir/$commands{$keyword}{module} $arguments`;
|
||||
}
|
||||
|
||||
return "/me moans loudly."; # er, didn't execute the module?
|
||||
} # end child block
|
||||
|
||||
return ""; # child returns bot command, not parent -- so return blank/no command
|
||||
}
|
||||
|
||||
1;
|
51
PBot/NewModule.pm
Normal file
51
PBot/NewModule.pm
Normal file
@ -0,0 +1,51 @@
|
||||
# File: NewModule.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: New module skeleton
|
||||
|
||||
package PBot::NewModule;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw();
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
use Carp ();
|
||||
|
||||
sub new {
|
||||
if(ref($_[1]) eq 'HASH') {
|
||||
Carp::croak("Options to Logger should be key/value pairs, not hash reference");
|
||||
}
|
||||
|
||||
my ($class, %conf) = @_;
|
||||
|
||||
my $option = delete $conf{option};
|
||||
|
||||
if(defined $option) {
|
||||
# do something (optional)
|
||||
} else {
|
||||
# set default value (optional)
|
||||
$option = undef;
|
||||
}
|
||||
|
||||
my $self = {
|
||||
option => $option,
|
||||
};
|
||||
|
||||
bless $self, $class;
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
# subs here
|
||||
|
||||
1;
|
222
PBot/OperatorStuff.pm
Normal file
222
PBot/OperatorStuff.pm
Normal file
@ -0,0 +1,222 @@
|
||||
# File: NewModule.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: New module skeleton
|
||||
|
||||
package PBot::OperatorStuff;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw($logger $conn $botnick %quieted_nicks %unban_timeout @op_commands %is_opped);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
|
||||
*logger = \$PBot::PBot::logger;
|
||||
*conn = \$PBot::PBot::conn;
|
||||
*botnick = \$PBot::PBot::botnick;
|
||||
|
||||
%quieted_nicks = ();
|
||||
%unban_timeout = ();
|
||||
@op_commands = ();
|
||||
%is_opped = ();
|
||||
|
||||
sub gain_ops {
|
||||
my $channel = shift;
|
||||
|
||||
if(not exists $is_opped{$channel}) {
|
||||
$conn->privmsg("chanserv", "op $channel");
|
||||
} else {
|
||||
perform_op_commands();
|
||||
}
|
||||
}
|
||||
|
||||
sub lose_ops {
|
||||
my $channel = shift;
|
||||
$conn->privmsg("chanserv", "op $channel -$botnick");
|
||||
if(exists $is_opped{$channel}) {
|
||||
$is_opped{$channel}{timeout} = gettimeofday + 60; # try again in 1 minute if failed
|
||||
}
|
||||
}
|
||||
|
||||
sub perform_op_commands {
|
||||
$logger->log("Performing op commands...\n");
|
||||
foreach my $command (@op_commands) {
|
||||
if($command =~ /^mode (.*?) (.*)/i) {
|
||||
$conn->mode($1, $2);
|
||||
$logger->log(" executing mode $1 $2\n");
|
||||
} elsif($command =~ /^kick (.*?) (.*?) (.*)/i) {
|
||||
$conn->kick($1, $2, $3) unless $1 =~ /\Q$botnick\E/i;
|
||||
$logger->log(" executing kick on $1 $2 $3\n");
|
||||
}
|
||||
shift(@op_commands);
|
||||
}
|
||||
$logger->log("Done.\n");
|
||||
}
|
||||
|
||||
# TODO: move internal commands to OperatorCommands.pm?
|
||||
|
||||
sub quiet {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my ($target, $length) = split(/\s+/, $arguments);
|
||||
|
||||
if(not defined $from) {
|
||||
$logger->log("Command missing ~from parameter!\n");
|
||||
return "";
|
||||
}
|
||||
|
||||
if(not $from =~ /^#/) { #not a channel
|
||||
return "/msg $nick This command must be used in the channel.";
|
||||
}
|
||||
|
||||
if(not defined $target) {
|
||||
return "/msg $nick Usage: quiet nick [timeout seconds (default: 3600 or 1 hour)]";
|
||||
}
|
||||
|
||||
if(not defined $length) {
|
||||
$length = 60 * 60; # one hour
|
||||
}
|
||||
|
||||
return "" if $target =~ /\Q$botnick\E/i;
|
||||
|
||||
quiet_nick_timed($target, $from, $length);
|
||||
$conn->privmsg($target, "$nick has quieted you for $length seconds.");
|
||||
}
|
||||
|
||||
sub unquiet {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $from) {
|
||||
$logger->log("Command missing ~from parameter!\n");
|
||||
return "";
|
||||
}
|
||||
|
||||
if(not $from =~ /^#/) { #not a channel
|
||||
return "/msg $nick This command must be used in the channel.";
|
||||
}
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "/msg $nick Usage: unquiet nick";
|
||||
}
|
||||
|
||||
unquiet_nick($arguments, $from);
|
||||
delete $quieted_nicks{$arguments};
|
||||
$conn->privmsg($arguments, "$nick has allowed you to speak again.") unless $arguments =~ /\Q$botnick\E/i;
|
||||
}
|
||||
|
||||
sub quiet_nick {
|
||||
my ($nick, $channel) = @_;
|
||||
unshift @op_commands, "mode $channel +q $nick!*@*";
|
||||
gain_ops($channel);
|
||||
}
|
||||
|
||||
sub unquiet_nick {
|
||||
my ($nick, $channel) = @_;
|
||||
unshift @op_commands, "mode $channel -q $nick!*@*";
|
||||
gain_ops($channel);
|
||||
}
|
||||
|
||||
sub quiet_nick_timed {
|
||||
my ($nick, $channel, $length) = @_;
|
||||
|
||||
quiet_nick($nick, $channel);
|
||||
$quieted_nicks{$nick}{time} = gettimeofday + $length;
|
||||
$quieted_nicks{$nick}{channel} = $channel;
|
||||
}
|
||||
|
||||
# TODO: need to refactor ban_user() and unban_user() - mostly duplicate code
|
||||
sub ban_user {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $from) {
|
||||
$logger->log("Command missing ~from parameter!\n");
|
||||
return "";
|
||||
}
|
||||
|
||||
if(not $from =~ /^#/) { #not a channel
|
||||
if($arguments =~ /^(#.*?) (.*?) (.*)$/) {
|
||||
$conn->privmsg("ChanServ", "AUTOREM $1 ADD $2 $3");
|
||||
unshift @op_commands, "kick $1 $2 Banned";
|
||||
gain_ops($1);
|
||||
$logger->log("$nick!$user\@$host AUTOREM $2 ($3)\n");
|
||||
return "/msg $nick $2 added to auto-remove";
|
||||
} else {
|
||||
$logger->log("$nick!$user\@$host: bad format for ban in msg\n");
|
||||
return "/msg $nick Usage (in msg mode): !ban <channel> <hostmask> <reason>";
|
||||
}
|
||||
} else { #in a channel
|
||||
if($arguments =~ /^(.*?) (.*)$/) {
|
||||
$conn->privmsg("ChanServ", "AUTOREM $from ADD $1 $2");
|
||||
$logger->log("AUTOREM [$from] ADD [$1] [$2]\n");
|
||||
$logger->log("kick [$from] [$1] Banned\n");
|
||||
unshift @op_commands, "kick $from $1 Banned";
|
||||
gain_ops($from);
|
||||
$logger->log("$nick ($from) AUTOREM $1 ($2)\n");
|
||||
return "/msg $nick $1 added to auto-remove";
|
||||
} else {
|
||||
$logger->log("$nick!$user\@$host: bad format for ban in channel\n");
|
||||
return "/msg $nick Usage (in channel mode): !ban <hostmask> <reason>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub unban_user {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $from) {
|
||||
$logger->log("Command missing ~from parameter!\n");
|
||||
return "";
|
||||
}
|
||||
|
||||
if(not $from =~ /^#/) { #not a channel
|
||||
if($arguments =~ /^(#.*?) (.*)$/) {
|
||||
$conn->privmsg("ChanServ", "AUTOREM $1 DEL $2");
|
||||
unshift @op_commands, "mode $1 -b $2";
|
||||
gain_ops($1);
|
||||
delete $unban_timeout{$2};
|
||||
$logger->log("$nick!$user\@$host AUTOREM DEL $2 ($3)\n");
|
||||
return "/msg $nick $2 removed from auto-remove";
|
||||
} else {
|
||||
$logger->log("$nick!$user\@$host: bad format for unban in msg\n");
|
||||
return "/msg $nick Usage (in msg mode): !unban <channel> <hostmask>";
|
||||
}
|
||||
} else { #in a channel
|
||||
$conn->privmsg("ChanServ", "AUTOREM $from DEL $arguments");
|
||||
unshift @op_commands, "mode $from -b $arguments";
|
||||
gain_ops($from);
|
||||
delete $unban_timeout{$arguments};
|
||||
$logger->log("$nick!$user\@$host AUTOREM DEL $arguments\n");
|
||||
return "/msg $nick $arguments removed from auto-remove";
|
||||
}
|
||||
}
|
||||
|
||||
sub kick_nick {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $from) {
|
||||
$logger->log("Command missing ~from parameter!\n");
|
||||
return "";
|
||||
}
|
||||
|
||||
if(not $from =~ /^#/) {
|
||||
$logger->log("$nick!$user\@$host attempted to /msg kick\n");
|
||||
return "/msg $nick Kick must be used in the channel.";
|
||||
}
|
||||
if(not $arguments =~ /(.*?) (.*)/) {
|
||||
$logger->log("$nick!$user\@$host: invalid arguments to kick\n");
|
||||
return "/msg $nick Usage: !kick <nick> <reason>";
|
||||
}
|
||||
unshift @op_commands, "kick $from $1 $2";
|
||||
gain_ops($from);
|
||||
}
|
||||
|
||||
1;
|
212
PBot/PBot.pm
Normal file
212
PBot/PBot.pm
Normal file
@ -0,0 +1,212 @@
|
||||
# File: PBot.pm
|
||||
# Author: pragma_
|
||||
#
|
||||
# Purpose: IRC Bot (3rd generation)
|
||||
|
||||
package PBot::PBot;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = "0.5.0-beta";
|
||||
@ISA = qw(Exporter);
|
||||
# TODO: move all of these into the pbot object and pass that around instead
|
||||
@EXPORT_OK = qw($VERSION %flood_watch $logger %commands $conn %admins $botnick %internal_commands
|
||||
%is_opped @op_commands %quieted_nicks %ignore_list %unban_timeout @quotegrabs
|
||||
$channels_file $MAX_NICK_MESSAGES %flood_watch $quotegrabs_file $export_quotegrabs_path $export_quotegrabs_timeout
|
||||
$commands_file $module_dir $admins_file $export_factoids_timeout $export_factoids_path $max_msg_len
|
||||
$export_factoids_time $export_quotegrabs_time $MAX_FLOOD_MESSAGES $identify_password);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
# unbuffer stdout
|
||||
STDOUT->autoflush(1);
|
||||
|
||||
use Net::IRC; # for the main IRC engine
|
||||
use HTML::Entities; # for exporting
|
||||
use Time::HiRes qw(gettimeofday alarm); # for timers
|
||||
use Carp ();
|
||||
use Data::Dumper;
|
||||
|
||||
use PBot::Logger;
|
||||
use PBot::IRCHandlers;
|
||||
use PBot::InternalCommands;
|
||||
use PBot::ChannelStuff;
|
||||
use PBot::StdinReader;
|
||||
use PBot::Quotegrabs;
|
||||
use PBot::FactoidStuff;
|
||||
use PBot::Interpreter;
|
||||
use PBot::IgnoreList;
|
||||
use PBot::BotAdminStuff;
|
||||
use PBot::Modules;
|
||||
use PBot::AntiFlood;
|
||||
use PBot::OperatorStuff;
|
||||
use PBot::TimerStuff;
|
||||
|
||||
*admins = \%PBot::BotAdminStuff::admins;
|
||||
*commands = \%PBot::FactoidStuff::commands;
|
||||
*quotegrabs = \@PBot::Quotegrabs::quotegrabs;
|
||||
|
||||
# TODO: Move these into pbot object
|
||||
my $ircserver;
|
||||
|
||||
sub new {
|
||||
if(ref($_[1]) eq 'HASH') {
|
||||
Carp::croak("Options to Logger should be key/value pairs, not hash reference");
|
||||
}
|
||||
|
||||
my ($class, %conf) = @_;
|
||||
|
||||
my $log_file = delete $conf{log_file};
|
||||
|
||||
# TODO: Move all of these into pbot object
|
||||
$channels_file = delete $conf{channels_file};
|
||||
$commands_file = delete $conf{commands_file};
|
||||
$quotegrabs_file = delete $conf{quotegrabs_file};
|
||||
$admins_file = delete $conf{admins_file};
|
||||
$module_dir = delete $conf{module_dir};
|
||||
$ircserver = delete $conf{ircserver};
|
||||
$botnick = delete $conf{botnick};
|
||||
$identify_password = delete $conf{identify_password};
|
||||
$max_msg_len = delete $conf{max_msg_len};
|
||||
|
||||
$export_factoids_timeout = delete $conf{export_factoids_timeout};
|
||||
$export_factoids_path = delete $conf{export_factoids_path};
|
||||
|
||||
$export_quotegrabs_timeout = delete $conf{export_quotegrabs_timeout};
|
||||
$export_quotegrabs_path = delete $conf{export_quotegrabs_path};
|
||||
|
||||
$MAX_FLOOD_MESSAGES = delete $conf{MAX_FLOOD_MESSAGES};
|
||||
$MAX_NICK_MESSAGES = delete $conf{MAX_NICK_MESSAGES};
|
||||
|
||||
my $home = $ENV{HOME};
|
||||
$channels_file = "$home/pbot/channels" unless defined $channels_file;
|
||||
$commands_file = "$home/pbot/commands" unless defined $commands_file;
|
||||
$quotegrabs_file = "$home/pbot/quotegrabs" unless defined $quotegrabs_file;
|
||||
$admins_file = "$home/pbot/admins" unless defined $admins_file;
|
||||
$module_dir = "$home/pbot/modules" unless defined $module_dir;
|
||||
$ircserver = "irc.freenode.net" unless defined $ircserver;
|
||||
$botnick = "pbot2" unless defined $botnick;
|
||||
$identify_password = "" unless defined $identify_password;
|
||||
|
||||
$export_factoids_timeout = -1 unless defined $export_factoids_timeout;
|
||||
$export_factoids_time = gettimeofday + $export_factoids_timeout;
|
||||
|
||||
$export_quotegrabs_timeout = -1 unless defined $export_quotegrabs_timeout;
|
||||
$export_quotegrabs_time = gettimeofday + $export_quotegrabs_timeout;
|
||||
|
||||
$max_msg_len = 460 unless defined $max_msg_len;
|
||||
$MAX_FLOOD_MESSAGES = 4 unless defined $MAX_FLOOD_MESSAGES;
|
||||
$MAX_NICK_MESSAGES = 8 unless defined $MAX_NICK_MESSAGES;
|
||||
|
||||
$commands{version} = {
|
||||
enabled => 1,
|
||||
owner => $botnick,
|
||||
text => "/say pbot2 version $VERSION",
|
||||
timestamp => 0,
|
||||
ref_count => 0,
|
||||
ref_user => "nobody" };
|
||||
|
||||
# TODO: wrap these in Setters/Getters
|
||||
unshift @quotegrabs, ({
|
||||
nick => $botnick,
|
||||
text => "Who's a bot?",
|
||||
channel => "#pbot2",
|
||||
grabbed_by => "pragma_",
|
||||
id => 1,
|
||||
timestamp => 0 });
|
||||
|
||||
$admins{$botnick} = {
|
||||
password => '*',
|
||||
level => 50,
|
||||
login => 1,
|
||||
host => "localhost" };
|
||||
|
||||
my $self = {
|
||||
# TODO: add conf variables here
|
||||
};
|
||||
|
||||
$logger = new PBot::Logger(log_file => $log_file);
|
||||
|
||||
bless $self, $class;
|
||||
return $self;
|
||||
}
|
||||
|
||||
my $irc = new Net::IRC;
|
||||
|
||||
sub connect {
|
||||
my ($self, $server) = @_;
|
||||
|
||||
$server = $ircserver if not defined $server;
|
||||
|
||||
$logger->log("Connecting to $server ...\n");
|
||||
$conn = $irc->newconn(
|
||||
Nick => $botnick,
|
||||
Username => 'pbot3', # FIXME: make this config
|
||||
Ircname => 'http://www.iso-9899.info/wiki/Candide', # FIXME: make this config
|
||||
Server => $server,
|
||||
Port => 6667) # FIXME: make this config
|
||||
or die "$0: Can't connect to IRC server.\n";
|
||||
|
||||
#set up handlers for the IRC engine
|
||||
$conn->add_handler([ 251,252,253,254,302,255 ], \&PBot::IRCHandlers::on_init );
|
||||
$conn->add_handler(376 , \&PBot::IRCHandlers::on_connect );
|
||||
$conn->add_handler('disconnect' , \&PBot::IRCHandlers::on_disconnect );
|
||||
$conn->add_handler('notice' , \&PBot::IRCHandlers::on_notice );
|
||||
$conn->add_handler('caction' , \&PBot::IRCHandlers::on_action );
|
||||
$conn->add_handler('public' , \&PBot::IRCHandlers::on_public );
|
||||
$conn->add_handler('msg' , \&PBot::IRCHandlers::on_msg );
|
||||
$conn->add_handler('mode' , \&PBot::IRCHandlers::on_mode );
|
||||
$conn->add_handler('part' , \&PBot::IRCHandlers::on_departure );
|
||||
$conn->add_handler('join' , \&PBot::IRCHandlers::on_join );
|
||||
$conn->add_handler('quit' , \&PBot::IRCHandlers::on_departure );
|
||||
}
|
||||
|
||||
#main loop
|
||||
sub do_one_loop {
|
||||
# process IRC events
|
||||
$irc->do_one_loop();
|
||||
|
||||
# process STDIN events
|
||||
check_stdin();
|
||||
}
|
||||
|
||||
sub check_stdin {
|
||||
my $input = PBot::StdinReader::check_stdin();
|
||||
|
||||
return if not defined $input;
|
||||
|
||||
$logger->log("---------------------------------------------\n");
|
||||
$logger->log("Read '$input' from STDIN\n");
|
||||
|
||||
my ($from, $text);
|
||||
|
||||
if($input =~ m/^~([^ ]+)\s+(.*)/) {
|
||||
$from = $1;
|
||||
$text = "!$2";
|
||||
} else {
|
||||
$from = undef;
|
||||
$text = "!$input";
|
||||
}
|
||||
|
||||
return PBot::Interpreter::process_line($from, $botnick, "stdin", "localhost", $text);
|
||||
}
|
||||
|
||||
sub load_channels {
|
||||
return PBot::ChannelStuff::load_channels();
|
||||
}
|
||||
|
||||
sub load_quotegrabs {
|
||||
return PBot::Quotegrabs::load_quotegrabs();
|
||||
}
|
||||
|
||||
sub load_commands {
|
||||
return PBot::FactoidStuff::load_commands();
|
||||
}
|
||||
|
||||
1;
|
245
PBot/Quotegrabs.pm
Normal file
245
PBot/Quotegrabs.pm
Normal file
@ -0,0 +1,245 @@
|
||||
# File: NewModule.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: New module skeleton
|
||||
|
||||
package PBot::Quotegrabs;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw(@quotegrabs $logger $MAX_NICK_MESSAGES %flood_watch $quotegrabs_file $export_quotegrabs_path $export_quotegrabs_timeout);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
*logger = \$PBot::PBot::logger;
|
||||
*quotegrabs_file = \$PBot::PBot::quotegrabs_file;
|
||||
*export_quotegrabs_path = \$PBot::PBot::export_quotegrabs_path;
|
||||
*export_quotegrabs_timeout = \$PBot::PBot::export_quotegrabs_timeout;
|
||||
|
||||
@quotegrabs = ();
|
||||
|
||||
sub quotegrab {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if(not defined $from) {
|
||||
$logger->log("Command missing ~from parameter!\n");
|
||||
return "";
|
||||
}
|
||||
|
||||
if(not defined $arguments) {
|
||||
return "Usage: !grab <nick> [history] [channel] -- where [history] is an optional argument that is an integer number of recent messages; e.g., to grab the 3rd most recent message for nick, use !grab nick 3";
|
||||
}
|
||||
|
||||
my ($grab_nick, $grab_history, $channel) = split(/\s+/, $arguments, 3);
|
||||
|
||||
$grab_history = 1 if not defined $grab_history;
|
||||
$channel = $from if not defined $channel;
|
||||
|
||||
if($grab_history < 1 || $grab_history > $MAX_NICK_MESSAGES) {
|
||||
return "/msg $nick Please choose a history between 1 and $MAX_NICK_MESSAGES";
|
||||
}
|
||||
|
||||
if(not exists $flood_watch{$grab_nick}) {
|
||||
return "No message history for $grab_nick.";
|
||||
}
|
||||
|
||||
if(not exists $flood_watch{$grab_nick}{$channel}) {
|
||||
return "No message history for $grab_nick in $channel.";
|
||||
}
|
||||
|
||||
my @messages = @{ $flood_watch{$grab_nick}{$channel}{messages} };
|
||||
|
||||
$grab_history--;
|
||||
|
||||
if($grab_history > $#messages) {
|
||||
return "$grab_nick has only " . ($#messages + 1) . " messages in the history.";
|
||||
}
|
||||
|
||||
$grab_history = $#messages - $grab_history;
|
||||
|
||||
$logger->log("$nick ($from) grabbed <$grab_nick/$channel> $messages[$grab_history]->{msg}\n");
|
||||
|
||||
my $quotegrab = {};
|
||||
$quotegrab->{nick} = $grab_nick;
|
||||
$quotegrab->{channel} = $channel;
|
||||
$quotegrab->{timestamp} = $messages[$grab_history]->{timestamp};
|
||||
$quotegrab->{grabbed_by} = $nick;
|
||||
$quotegrab->{text} = $messages[$grab_history]->{msg};
|
||||
$quotegrab->{id} = $#quotegrabs + 2;
|
||||
|
||||
push @quotegrabs, $quotegrab;
|
||||
|
||||
save_quotegrabs();
|
||||
|
||||
my $msg = $messages[$grab_history]->{msg};
|
||||
$msg =~ s/(.{8}).*/$1.../;
|
||||
|
||||
return "Quote grabbed: " . ($#quotegrabs + 1) . ": <$grab_nick> $msg";
|
||||
}
|
||||
|
||||
sub delete_quotegrab {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if($arguments < 1 || $arguments > $#quotegrabs + 1) {
|
||||
return "/msg $nick Valid range for !getq is 1 - " . ($#quotegrabs + 1);
|
||||
}
|
||||
|
||||
my $quotegrab = $quotegrabs[$arguments - 1];
|
||||
splice @quotegrabs, $arguments - 1, 1;
|
||||
save_quotegrabs();
|
||||
return "Deleted $arguments: <$quotegrab->{nick}> $quotegrab->{text}";
|
||||
}
|
||||
|
||||
sub show_quotegrab {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
|
||||
if($arguments < 1 || $arguments > $#quotegrabs + 1) {
|
||||
return "/msg $nick Valid range for !getq is 1 - " . ($#quotegrabs + 1);
|
||||
}
|
||||
|
||||
my $quotegrab = $quotegrabs[$arguments - 1];
|
||||
return "$arguments: <$quotegrab->{nick}> $quotegrab->{text}";
|
||||
}
|
||||
|
||||
sub show_random_quotegrab {
|
||||
my ($from, $nick, $user, $host, $arguments) = @_;
|
||||
my @quotes = ();
|
||||
my $nick_search = ".*";
|
||||
my $channel_search = $from;
|
||||
|
||||
if(not defined $from) {
|
||||
$logger->log("Command missing ~from parameter!\n");
|
||||
return "";
|
||||
}
|
||||
|
||||
if(defined $arguments) {
|
||||
($nick_search, $channel_search) = split(/\s+/, $arguments, 2);
|
||||
# $logger->log("[ns: $nick_search][cs: $channel_search]\n");
|
||||
if(not defined $channel_search) {
|
||||
$channel_search = $from;
|
||||
}
|
||||
}
|
||||
|
||||
my $channel_search_quoted = quotemeta($channel_search);
|
||||
$logger->log("[ns: $nick_search][cs: $channel_search][csq: $channel_search_quoted]\n");
|
||||
|
||||
eval {
|
||||
for(my $i = 0; $i <= $#quotegrabs; $i++) {
|
||||
my $hash = $quotegrabs[$i];
|
||||
if($hash->{channel} =~ /$channel_search_quoted/i && $hash->{nick} =~ /$nick_search/i) {
|
||||
$hash->{id} = $i + 1;
|
||||
push @quotes, $hash;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if($@) {
|
||||
$logger->log("Error in show_random_quotegrab parameters: $@\n");
|
||||
return "/msg $nick Error: $@"
|
||||
}
|
||||
|
||||
if($#quotes < 0) {
|
||||
if($nick_search eq ".*") {
|
||||
return "No quotes grabbed for $channel_search yet. Use !grab to grab a quote.";
|
||||
} else {
|
||||
return "No quotes grabbed for $nick_search in $channel_search yet. Use !grab to grab a quote.";
|
||||
}
|
||||
}
|
||||
|
||||
my $quotegrab = $quotes[int rand($#quotes + 1)];
|
||||
return "$quotegrab->{id}: <$quotegrab->{nick}> $quotegrab->{text}";
|
||||
}
|
||||
|
||||
sub load_quotegrabs {
|
||||
$logger->log("Loading quotegrabs from $quotegrabs_file ...\n");
|
||||
|
||||
open(FILE, "< $quotegrabs_file") or die "Couldn't open $quotegrabs_file: $!\n";
|
||||
my @contents = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
my $i = 0;
|
||||
foreach my $line (@contents) {
|
||||
chomp $line;
|
||||
$i++;
|
||||
my ($nick, $channel, $timestamp, $grabbed_by, $text) = split(/\s+/, $line, 5);
|
||||
if(not defined $nick || not defined $channel || not defined $timestamp
|
||||
|| not defined $grabbed_by || not defined $text) {
|
||||
die "Syntax error around line $i of $quotegrabs_file\n";
|
||||
}
|
||||
|
||||
my $quotegrab = {};
|
||||
$quotegrab->{nick} = $nick;
|
||||
$quotegrab->{channel} = $channel;
|
||||
$quotegrab->{timestamp} = $timestamp;
|
||||
$quotegrab->{grabbed_by} = $grabbed_by;
|
||||
$quotegrab->{text} = $text;
|
||||
$quotegrab->{id} = $i + 1;
|
||||
push @quotegrabs, $quotegrab;
|
||||
}
|
||||
$logger->log(" $i quotegrabs loaded.\n");
|
||||
$logger->log("Done.\n");
|
||||
}
|
||||
|
||||
sub save_quotegrabs {
|
||||
open(FILE, "> $quotegrabs_file") or die "Couldn't open $quotegrabs_file: $!\n";
|
||||
|
||||
for(my $i = 0; $i <= $#quotegrabs; $i++) {
|
||||
my $quotegrab = $quotegrabs[$i];
|
||||
next if $quotegrab->{timestamp} == 0;
|
||||
print FILE "$quotegrab->{nick} $quotegrab->{channel} $quotegrab->{timestamp} $quotegrab->{grabbed_by} $quotegrab->{text}\n";
|
||||
}
|
||||
|
||||
close(FILE);
|
||||
system("cp $quotegrabs_file $quotegrabs_file.bak");
|
||||
}
|
||||
|
||||
sub export_quotegrabs() {
|
||||
return "Not enabled" if not defined $export_quotegrabs_path;
|
||||
my $text;
|
||||
my $last_channel = "";
|
||||
my $had_table = 0;
|
||||
open FILE, "> $export_quotegrabs_path" or return "Could not open export path.";
|
||||
my $time = localtime;
|
||||
print FILE "<html><body><i>Generated at $time</i><hr><h1>Candide's Quotegrabs</h1>\n";
|
||||
my $i = 0;
|
||||
foreach my $quotegrab (sort { $$a{channel} cmp $$b{channel} or $$a{nick} cmp $$b{nick} } @quotegrabs) {
|
||||
if(not $quotegrab->{channel} =~ /^$last_channel$/i) {
|
||||
print FILE "</table>\n" if $had_table;
|
||||
print FILE "<hr><h2>$quotegrab->{channel}</h2><hr>\n";
|
||||
print FILE "<table border=\"0\">\n";
|
||||
$had_table = 1;
|
||||
}
|
||||
|
||||
$last_channel = $quotegrab->{channel};
|
||||
$i++;
|
||||
|
||||
if($i % 2) {
|
||||
print FILE "<tr bgcolor=\"#dddddd\">\n";
|
||||
} else {
|
||||
print FILE "<tr>\n";
|
||||
}
|
||||
print FILE "<td>" . ($quotegrab->{id}) . "</td>";
|
||||
$text = "<td><b><$quotegrab->{nick}></b> " . encode_entities($quotegrab->{text}) . "</td>\n";
|
||||
print FILE $text;
|
||||
my ($seconds, $minutes, $hours, $day_of_month, $month, $year, $wday, $yday, $isdst) = localtime($quotegrab->{timestamp});
|
||||
my $t = sprintf("%02d:%02d:%02d-%04d/%02d/%02d\n",
|
||||
$hours, $minutes, $seconds, $year+1900, $month+1, $day_of_month);
|
||||
print FILE "<td align=\"right\">- grabbed by<br> $quotegrab->{grabbed_by}<br><i>$t</i>\n";
|
||||
print FILE "</td></tr>\n";
|
||||
}
|
||||
|
||||
print FILE "</table>\n";
|
||||
print FILE "<hr>$i quotegrabs grabbed.<br>This page is automatically generated every $export_quotegrabs_timeout seconds.</body></html>";
|
||||
close(FILE);
|
||||
return "$i quotegrabs exported to http://blackshell.com/~msmud/candide/quotegrabs.html";
|
||||
}
|
||||
|
||||
1;
|
33
PBot/StdinReader.pm
Normal file
33
PBot/StdinReader.pm
Normal file
@ -0,0 +1,33 @@
|
||||
package PBot::StdinReader;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
use vars qw($VERSION);
|
||||
|
||||
$VERSION = '1.0.0';
|
||||
|
||||
use IO::Select;
|
||||
use POSIX qw(tcgetpgrp getpgrp); # to check whether process is in background or foreground
|
||||
|
||||
# used to listen for STDIN in non-blocking mode
|
||||
my $stdin = IO::Select->new();
|
||||
$stdin->add(\*STDIN);
|
||||
|
||||
# used to check whether process is in background or foreground, for stdin reading
|
||||
open TTY, "</dev/tty" or die $!;
|
||||
my $tty_fd = fileno(TTY);
|
||||
my $foreground = (tcgetpgrp($tty_fd) == getpgrp()) ? 1 : 0;
|
||||
|
||||
sub check_stdin {
|
||||
# make sure we're in the foreground first
|
||||
$foreground = (tcgetpgrp($tty_fd) == getpgrp()) ? 1 : 0;
|
||||
return if not $foreground;
|
||||
|
||||
if ($stdin->can_read(.5)) {
|
||||
chomp(my $input = <STDIN>);
|
||||
return $input;
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
170
PBot/TimerStuff.pm
Normal file
170
PBot/TimerStuff.pm
Normal file
@ -0,0 +1,170 @@
|
||||
# File: NewModule.pm
|
||||
# Authoer: pragma_
|
||||
#
|
||||
# Purpose: New module skeleton
|
||||
|
||||
package PBot::TimerStuff;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
BEGIN {
|
||||
use Exporter ();
|
||||
use vars qw($VERSION @ISA @EXPORT_OK);
|
||||
|
||||
$VERSION = $PBot::PBot::VERSION;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT_OK = qw(%quieted_nicks $logger $conn %ignore_list %is_opped %unban_timeout $export_quotegrabs_path
|
||||
$export_quotegrabs_time $export_quotegrabs_timeout $export_factoids_path $export_factoids_time
|
||||
$export_factoids_timeout %flood_watch @op_commands);
|
||||
}
|
||||
|
||||
use vars @EXPORT_OK;
|
||||
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
|
||||
*logger = \$PBot::PBot::logger;
|
||||
*conn = \$PBot::PBot::conn;
|
||||
*ignore_list = \%PBot::IgnoreList::ignore_list;
|
||||
*is_opped = \%PBot::OperatorStuff::is_opped;
|
||||
*op_commands = \@PBot::OperatorStuff::op_commands;
|
||||
*quieted_nicks = \%PBot::OperatorStuff::quieted_nicks;
|
||||
*flood_watch = \%PBot::AntiFlood::flood_watch;
|
||||
*unban_timeout = \%PBot::OperatorStuff::unban_timeout;
|
||||
*export_quotegrabs_path = \$PBot::PBot::export_quotegrabs_path;
|
||||
*export_quotegrabs_timeout = \$PBot::PBot::export_quotegrabs_timeout;
|
||||
*export_quotegrabs_time = \$PBot::PBot::export_quotegrabs_time;
|
||||
*export_factoids_path = \$PBot::PBot::export_factoids_path;
|
||||
*export_factoids_timeout = \$PBot::PBot::export_factoids_timeout;
|
||||
*export_factoids_time = \$PBot::PBot::export_factoids_time;
|
||||
|
||||
# alarm signal handler (poor-man's timer)
|
||||
$SIG{ALRM} = \&sig_alarm_handler;
|
||||
|
||||
#start alarm timeout
|
||||
alarm 10;
|
||||
|
||||
sub sig_alarm_handler {
|
||||
# check timeouts
|
||||
# TODO: Make this module a class with registerable handlers/call-backs
|
||||
check_quieted_timeouts();
|
||||
check_ignore_timeouts();
|
||||
check_opped_timeout();
|
||||
check_unban_timeouts();
|
||||
check_export_timeout();
|
||||
check_message_history_timeout();
|
||||
alarm 10;
|
||||
}
|
||||
|
||||
# TODO: Move these to their respective modules, and add handler support
|
||||
|
||||
sub check_quieted_timeouts {
|
||||
my $now = gettimeofday();
|
||||
|
||||
foreach my $nick (keys %quieted_nicks) {
|
||||
if($quieted_nicks{$nick}{time} < $now) {
|
||||
$logger->log("Unquieting $nick\n");
|
||||
PBot::OperatorStuff::unquiet_nick($nick, $quieted_nicks{$nick}{channel});
|
||||
delete $quieted_nicks{$nick};
|
||||
$conn->privmsg($nick, "You may speak again.");
|
||||
} else {
|
||||
#my $timediff = $quieted_nicks{$nick}{time} - $now;
|
||||
#$logger->log "quiet: $nick has $timediff seconds remaining\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub check_ignore_timeouts {
|
||||
my $now = gettimeofday();
|
||||
|
||||
foreach my $hostmask (keys %ignore_list) {
|
||||
foreach my $channel (keys %{ $ignore_list{$hostmask} }) {
|
||||
next if($ignore_list{$hostmask}{$channel} == -1); #permanent ignore
|
||||
|
||||
if($ignore_list{$hostmask}{$channel} < $now) {
|
||||
PBot::IgnoreList::unignore_user("", "floodcontrol", "", "$hostmask $channel");
|
||||
if($hostmask eq ".*") {
|
||||
$conn->me($channel, "awakens.");
|
||||
}
|
||||
} else {
|
||||
#my $timediff = $ignore_list{$host}{$channel} - $now;
|
||||
#$logger->log "ignore: $host has $timediff seconds remaining\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub check_opped_timeout {
|
||||
my $now = gettimeofday();
|
||||
|
||||
foreach my $channel (keys %is_opped) {
|
||||
if($is_opped{$channel}{timeout} < $now) {
|
||||
PBot::OperatorStuff::lose_ops($channel);
|
||||
} else {
|
||||
# my $timediff = $is_opped{$channel}{timeout} - $now;
|
||||
# $logger->log("deop $channel in $timediff seconds\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub check_unban_timeouts {
|
||||
my $now = gettimeofday();
|
||||
|
||||
foreach my $ban (keys %unban_timeout) {
|
||||
if($unban_timeout{$ban}{timeout} < $now) {
|
||||
unshift @op_commands, "mode $unban_timeout{$ban}{channel} -b $ban";
|
||||
PBot::OperatorStuff::gain_ops($unban_timeout{$ban}{channel});
|
||||
delete $unban_timeout{$ban};
|
||||
} else {
|
||||
#my $timediff = $unban_timeout{$ban}{timeout} - $now;
|
||||
#$logger->log("$unban_timeout{$ban}{channel}: unban $ban in $timediff seconds\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub check_export_timeout {
|
||||
my $now = gettimeofday();
|
||||
|
||||
if($now > $export_quotegrabs_time && defined $export_quotegrabs_path) {
|
||||
PBot::Quotegrabs::export_quotegrabs();
|
||||
$export_quotegrabs_time = $now + $export_quotegrabs_timeout;
|
||||
}
|
||||
|
||||
if($now > $export_factoids_time && defined $export_factoids_path) {
|
||||
PBot::FactoidStuff::export_factoids();
|
||||
$export_factoids_time = $now + $export_factoids_timeout;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BEGIN {
|
||||
my $last_run = gettimeofday();
|
||||
|
||||
sub check_message_history_timeout {
|
||||
my $now = gettimeofday();
|
||||
|
||||
if($now - $last_run < 60 * 60) {
|
||||
return;
|
||||
} else {
|
||||
$logger->log("One hour has elapsed -- running check_message_history_timeout\n");
|
||||
}
|
||||
|
||||
$last_run = $now;
|
||||
|
||||
foreach my $nick (keys %flood_watch) {
|
||||
foreach my $channel (keys %{ $flood_watch{$nick} })
|
||||
{
|
||||
#$logger->log("Checking [$nick][$channel]\n");
|
||||
my $length = $#{ $flood_watch{$nick}{$channel}{messages} } + 1;
|
||||
my %last = %{ @{ $flood_watch{$nick}{$channel}{messages} }[$length - 1] };
|
||||
|
||||
if($now - $last{timestamp} >= 60 * 60 * 24) {
|
||||
$logger->log("$nick in $channel hasn't spoken in 24 hours, removing message history.\n");
|
||||
delete $flood_watch{$nick}{$channel};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
475
commands
475
commands
@ -1,4 +1,5 @@
|
||||
! text 1 Major-Willard 1104600621 81 Kogs the unary boolean not operator
|
||||
! text 1 Major-Willard 1104600621 88 mr_ank the unary boolean not operator
|
||||
!! text 1 Random832 1262200005 3 cgc /say !! is a common idiom for normalizing booleans - it will turn any nonzero value into 1, and leave zero at 0. For example, !!50 is 1.
|
||||
!= text 1 Major-Willard 1104871606 4 Skapare the comparison for inequality operator
|
||||
!IB text 1 Wulf_ 1253031223 0 nobody implementation defined behaviour
|
||||
!foo-nix text 1 foo-nix 1199181810 0 nobody told to be the worst *nix distribution ever.
|
||||
@ -15,29 +16,30 @@ $ text 1 Major-Willard 1106526551 4 pragma_ a character that has no special mean
|
||||
%:%: text 1 twkm 1104401865 0 nobody digraph alternative for ##
|
||||
%> text 1 twkm 1104616316 0 nobody digraph alternative for }
|
||||
%d text 1 prec 1104400903 1 pragma_ a *printf format specifier which converts its signed int argument to decimal representation; a *scanf format specifier which parses a decimal representation to its int* argument
|
||||
%f text 1 Random832 1262199608 3 Random832 /call double
|
||||
%p text 1 pragma_ 1106868530 3 Sepero the printf/scanf format specifier used to print/read void pointers
|
||||
& text 1 Major-Willard 1104602453 10 Kernoops the bitwise AND binary operator. It is also the unary address operator.
|
||||
&& text 1 Major-Willard 1106515352 2 Wulf_ the McCarthy logical-and binary operator
|
||||
&& text 1 Major-Willard 1106515352 3 Wulf_ the McCarthy logical-and binary operator
|
||||
&= text 1 prec 1107898482 0 nobody the bitwise inclusive-AND assignment operator. The expression (x &= y) is equivalent to (x = x & y) except that the expression x is evaluated only once.
|
||||
&x->y text 1 pragma_ 1107406471 2 prec The address of the y member of the structure pointed to by x.
|
||||
&x[y] text 1 prec 1107730768 5 cousteau equivalent to (x+y). Neither the & operator nor the implied * operator (see x[y]) are evaluated.
|
||||
&x[y] text 1 prec 1107730768 6 Random832 equivalent to (x+y). Neither the & operator nor the implied * operator (see x[y]) are evaluated.
|
||||
' text 1 Major-Willard 1106526412 0 nobody the character that begins and terminates a character constant
|
||||
'' text 1 Major-Willard 1104887580 0 nobody the delimiter of the start and end of a char
|
||||
( text 1 Major-Willard 1106527263 1 debCarlos used to commence a grouped expression
|
||||
) text 1 Major-Willard 1106527206 1 PoppaVic used to terminate a grouped expression
|
||||
* text 1 Major-Willard 1104600319 17 ColonelJ the multiplication binary operator. It is also the unary pointer dereference operator. It is also used in declarations to declare a variable which is a pointer to a type: <type> *p;
|
||||
* text 1 Major-Willard 1104600319 18 vinpa-work the multiplication binary operator. It is also the unary pointer dereference operator. It is also used in declarations to declare a variable which is a pointer to a type: <type> *p;
|
||||
*(char*)NULL text 1 joeyadams 1251796928 2 joeyadams /say Segmentation fault
|
||||
*= text 1 Major-Willard 1107662838 0 nobody the operator that multiplies the lvalue [to the left of the *] by the expression [to the right of the =]
|
||||
*s text 1 banisterfiend 1224143901 0 nobody cute
|
||||
+ text 1 Major-Willard 1104595760 8 mordy_ the addition binary operator
|
||||
++ text 1 Major-Willard 1105219173 2 jengelh a unary operator that increments basic types by 1; if it is placed before a variable the value of the expression is: <var> + 1; if it is placed after a variable the value of the expression is: <var>
|
||||
+= text 1 Major-Willard 1107661684 0 nobody the operator that adds the expression [to the right of the =] to the lvalue [to the left of the +]
|
||||
, text 1 prec 1107316491 5 reppypeppy the sequence operator. It is also used to separate syntactic elements of: function arguments in a function call, declarators (in declarations of the same type), formal parameters in function declarations, enumeration elements, and initializers.
|
||||
, text 1 prec 1107316491 6 Wulf_ the sequence operator. It is also used to separate syntactic elements of: function arguments in a function call, declarators (in declarations of the same type), formal parameters in function declarations, enumeration elements, and initializers.
|
||||
- text 1 Major-Willard 1104595811 10 pZombie the unary negation operator; the binary subtraction operator
|
||||
-- text 1 Major-Willard 1105219433 1 jengelh a unary operator that decrements basic types by 1; if it is placed before a variable the value of the expression is: <var> - 1; if it is placed after a variable the value of the expression is: <var>
|
||||
-= text 1 Major-Willard 1107661964 0 nobody the operator that subtracts the expression [to the right of the =] to the lvalue [to the left of the -]
|
||||
-> text 1 Major-Willard 1104601334 7 ColonelJ the operator that dereferences a pointer to permit access to a structure/union member. The expressions (x->y) and ((*x).y) are equivalent.
|
||||
-lm text 1 prec 1106448497 2 LordXe-gnu the standard UNIX linker command line option to link the functions in the math library.
|
||||
-lm text 1 prec 1106448497 5 Random832 the standard UNIX linker command line option to link the functions in the math library.
|
||||
-pedantic text 1 pragma_ 1107929320 6 cousteau a GCC flag that issues all warnings demanded by strict ISO C; rejects most programs that use forbidden extensions; should not be used to check for strict ISO conformance as it only warns for coding practices that _require_ a diagnostic, not everything; loosely supported
|
||||
-std text 1 pragma_ 1107929785 15 pragma_ a GCC flag that is used to specify which C standard to follow when compiling; some valid standards are: c89 (-ansi), c99, gnu89 (default), gnu99
|
||||
. text 1 Major-Willard 1104600864 19 [Pwner]John the decimal point; the operator that permits access to a structure/union member; is used in structure member designators in C99.
|
||||
@ -48,17 +50,21 @@ $ text 1 Major-Willard 1106526551 4 pragma_ a character that has no special mean
|
||||
// text 1 Major-Willard 1108293482 2 Major-Willard used to introduce a comment that continues to the end of the line [C99]
|
||||
/= text 1 prec 1107662173 0 nobody the division assignment operator. The expression (x /= y) is equivalent to (x = x / y) except that the expression x is evaluated only once.
|
||||
/say text 1 pragma_ 1251694751 6 PARLIAMENT /call say
|
||||
0 text 1 Maxdamantus 1268450206 0 nobody !1
|
||||
0L text 1 dav7 1231291850 4 dav7 not something I know about :(
|
||||
1 text 1 Maxdamantus 1268450213 1 Maxdamantus !0
|
||||
10words text 1 pragma_ 1262461605 0 nobody http://theoatmeal.com/comics/misspelling
|
||||
1234 text 1 Maxdamantus 1259540426 5 Wulf_ foo
|
||||
20? text 1 pragma_ 1200772242 0 nobody /say If you have a question, please be specific and concise. Don't ask questions like 'Does anyone know how to ...' or 'What is the best way to ...'. We do not have the time or patience to play a game of 20 questions with people that are not capable of articulating properly. See also: http://www.catb.org/~esr/faqs/smart-questions.html
|
||||
20q text 1 Jafet 1215709795 1 lemonade` /say If you have a question, please be specific and concise. Don't ask questions like 'Does anyone know how to ...' or 'What is the best way to ...'. We do not have the time or patience to play a game of 20 questions with people that are not capable of articulating properly. See also: http://catb.org/~esr/faqs/smart-questions.html
|
||||
21days text 1 kate` 1177064329 14 Nately http://norvig.com/21-days.html
|
||||
21days text 1 kate` 1177064329 16 pragma_ http://norvig.com/21-days.html
|
||||
2html.vim text 1 pragma_ 1183513530 5 pragma_ #!/bin/sh vim -n -c ':so \$VIMRUNTIME/syntax/2html.vim' -c ':wqa' \$1 > /dev/null 2> /dev/null
|
||||
3star text 1 pragma_ 1111867182 6 lemonade` http://c2.com/cgi/wiki?ThreeStarProgrammer
|
||||
5ex text 1 pragma_ 1243974339 2 pragma_ /call sex
|
||||
8ball text 1 pragma_ 1193948417 552 lawful_evil /say $nick, $answers
|
||||
:( text 1 pragma_ 1180052710 10 mordy_ /call :)
|
||||
:) text 1 pragma_ 1109365121 100 pragma_ /say $faces
|
||||
6thsense text 1 pragma_ 1262501664 1 pragma_ http://www.movie-moron.com/wp-content/gallery/various/I-See-Stupid-People.jpg
|
||||
8ball text 1 pragma_ 1193948417 602 zen /say $nick, $answers
|
||||
:( text 1 pragma_ 1180052710 11 gionnico /call :)
|
||||
:) text 1 pragma_ 1109365121 104 gionnico /say $faces
|
||||
:-( text 1 pragma_ 1180052743 0 nobody /call :)
|
||||
:-) text 1 pragma_ 1180052725 3 lemonade` /call :)
|
||||
:-D text 1 pragma_ 1180052738 0 nobody /call :)
|
||||
@ -75,9 +81,9 @@ $ text 1 Major-Willard 1106526551 4 pragma_ a character that has no special mean
|
||||
<: text 1 twkm 1104401882 1 pragma_ digraph replacement for [
|
||||
<< text 1 prec 1107979350 1 mordy_ the binary left shift operator
|
||||
<= text 1 Major-Willard 1104599493 0 nobody the less than or equal to comparison operator
|
||||
= text 1 Major-Willard 1104595880 36 pragma_ the assignment operator
|
||||
= text 1 Major-Willard 1104595880 42 mauke the assignment operator
|
||||
== text 1 Major-Willard 1104595949 3 Skapare the comparison for equivalence operator
|
||||
> text 1 Jafet 1239017335 2 pragma_ /say /> is the greater than comparison operator
|
||||
> text 1 Jafet 1239017335 5 pragma_ /say > is the greater than comparison operator
|
||||
>= text 1 Major-Willard 1104599538 0 nobody the greater than or equal to comparison operator
|
||||
>> text 1 Major-Willard 1108253247 1 mordy_ the binary right shift operator
|
||||
? text 1 Quetzalcoatl_ 1237066516 2 crosvera a question mark.
|
||||
@ -94,12 +100,10 @@ $ text 1 Major-Willard 1106526551 4 pragma_ a character that has no special mean
|
||||
APPALLING text 1 Major-Willard 1108954548 3 lemonade` Acronym Production Particularly At Lavish Level Is No Good
|
||||
B text 1 Major-Willard 1111209918 5 pragma_ the programming language which was the precursor of C ; http://en.wikipedia.org/wiki/B_programming_language
|
||||
BFS text 1 Wulf_ 1242883241 1 zacs7 Breadth First Search -- http://en.wikipedia.org/wiki/Breadth-first_search
|
||||
C text 1 pragma_ 1190248086 17 n00p /call c
|
||||
C++ text 1 kate` 1203360712 6 anttil /call c++
|
||||
C/C++ text 1 pragma_ 1108258486 14 lemonade` a misnomer. These two languages are completely different languages with each having its own standard. C++ is not a "superset" of C anymore. For C++ questions, please join #C++
|
||||
CARM text 1 pragma_ 1199659530 0 nobody /call H&S
|
||||
CE text 1 PoppaVic 1202752439 1 snhmib http://www.cs.cf.ac.uk/Dave/C/CE.html
|
||||
CHAR_BIT text 1 defrost 1104389685 5 neil127 #include <limits.h> - maximum value for the number of bits used to represent an object of type char. - >= 8
|
||||
CHAR_BIT text 1 defrost 1104389685 6 n00p #include <limits.h> - maximum value for the number of bits used to represent an object of type char. - >= 8
|
||||
CHAR_MAX text 1 defrost 1104389685 0 nobody #include <limits.h> - maximum value for type char. Its value is: SCHAR_MAX if char represents negative values, UCHAR_MAX otherwise. - >= 127
|
||||
CHAR_MIN text 1 defrost 1104389685 0 nobody #include <limits.h> - minimum value for type char. Its value is: SCHAR_MIN if char represents negative values, zero otherwise. - <= 0
|
||||
CnotC++ text 1 LordOllie 1176998419 2 cousteau C is not a subset of C++
|
||||
@ -110,7 +114,7 @@ EADDRINUSE text 1 Wulf4 1239973057 0 nobody Address already in use
|
||||
EADDRNOTAVAIL text 1 Wulf4 1239973059 0 nobody Cannot assign requested address
|
||||
EADV text 1 Wulf4 1239972985 0 nobody Advertise error
|
||||
EAFNOSUPPORT text 1 Wulf4 1239973054 0 nobody Address family not supported by protocol
|
||||
EAGAIN text 1 Wulf4 1239972852 0 nobody Resource temporarily unavailable
|
||||
EAGAIN text 1 Wulf4 1239972852 1 Wulf_ Resource temporarily unavailable
|
||||
EALREADY text 1 Wulf4 1239973097 0 nobody Operation already in progress
|
||||
EBADE text 1 Wulf4 1239972945 0 nobody Invalid exchange
|
||||
EBADF text 1 Wulf4 1239972829 1 Wulf_ Bad file descriptor
|
||||
@ -203,7 +207,7 @@ ENOTSOCK text 1 Wulf4 1239973032 0 nobody Socket operation on non-socket
|
||||
ENOTTY text 1 Wulf4 1239972876 0 nobody Inappropriate ioctl for device
|
||||
ENOTUNIQ text 1 Wulf4 1239973002 0 nobody Name not unique on network
|
||||
ENXIO text 1 Wulf4 1239972821 0 nobody No such device or address
|
||||
EOF text 1 infobahn 1104596552 28 Wulf_ an integer constant expression, with type int and a negative value, that is returned by several functions to indicate end-of-file (ISO/IEC 9899:1999 7.19.1(3)). It is NOT a char. It is NOT a byte that is stored at the end of every file.
|
||||
EOF text 1 infobahn 1104596552 31 Wulf_ an integer constant expression, with type int and a negative value, that is returned by several functions to indicate end-of-file (ISO/IEC 9899:1999 7.19.1(3)). It is NOT a char. It is NOT a byte that is stored at the end of every file.
|
||||
EOPNOTSUPP text 1 Wulf4 1239973049 0 nobody Operation not supported
|
||||
EOVERFLOW text 1 Wulf4 1239972999 0 nobody Value too large for defined data type
|
||||
EOWNERDEAD text 1 Wulf4 1239973137 0 nobody Owner died
|
||||
@ -238,15 +242,17 @@ EXDEV text 1 Wulf4 1239972859 0 nobody Invalid cross-device link
|
||||
EXFULL text 1 Wulf4 1239972950 0 nobody Exchange full
|
||||
EXIT_FAILURE text 1 mauke 1105443776 0 nobody a macro defined in <stdlib.h> whose value can be passed to exit() or returned from main() to indicate unsuccessful termination
|
||||
EXIT_SUCCESS text 1 mauke 1105443603 0 nobody a macro defined in <stdlib.h> whose value can be passed to exit() or returned from main() to indicate successful termination
|
||||
Everything text 1 Nately 1264580355 0 nobody for the best. Right
|
||||
GIGO text 1 prec 1174497896 0 nobody garbage in, garbage out
|
||||
GP text 1 PoppaVic 1107533027 0 nobody General Purpose
|
||||
Gorgoroth text 1 Gorgoroth 1260304343 2 Gorgoroth a french software engineer who is very cool.
|
||||
H&S text 1 heina 1109636091 101 Dianora "C - A Reference Manual" by Harbison & Steele; a reference for C on par with K&R - http://www.amazon.com/Reference-Manual-Samuel-P-Harbison/dp/013089592X
|
||||
H&S text 1 heina 1109636091 111 Chris "C - A Reference Manual" by Harbison & Steele; a reference for C on par with K&R - http://www.amazon.com/Reference-Manual-Samuel-P-Harbison/dp/013089592X
|
||||
IMP text 1 Major-Willard 1108947650 0 nobody Interface Message Processor
|
||||
INT_MAX text 1 twkm 1104369616 2 pragma_ #include <limits.h> - INT_MAX - maximum value of an int object, at least +32767
|
||||
INT_MIN text 1 twkm 1104369627 0 nobody #include <limits.h> - INT_MIN - minimum value of an int object, at least -32767
|
||||
It text 1 ntis11 1258439566 0 nobody hard to tell the difference between newlines and new posts.
|
||||
K&R text 1 pragma_ 1194246691 55 Raiford /call k&r
|
||||
K&R text 1 pragma_ 1194246691 59 pragma_ /call k&r
|
||||
LE text 1 PoppaVic 1266717828 0 nobody Learning Experience. Any LE is a good one, as long as you survive it.
|
||||
LFS text 1 vorpal 1183700942 1 vorpal http://en.wikipedia.org/wiki/Large_file_support
|
||||
LONG_MAX text 1 twkm 1104369746 0 nobody #include <limits.h> - LONG_MAX - maximum value of a long int object, at least +2147483647
|
||||
LONG_MIN text 1 twkm 1104369732 0 nobody #include <limits.h> - LONG_MIN - minimum value of a long int object, at least -2147483647
|
||||
@ -255,7 +261,7 @@ MB_CUR_MAX text 1 twkm 1104394983 0 nobody #include <limits.h> - maximum number
|
||||
MB_LEN_MAX text 1 defrost 1104389706 0 nobody #include <limits.h> - maximum number of characters that constitute a multibyte character in any supported locale. Its value is >= MB_CUR_MAX.
|
||||
Major-Willard text 1 defrost 1104594621 9 kate` a $sizes $colors gun totin non-jesus freak
|
||||
NET text 1 durnew 1106069886 0 nobody like the java platform, but by microsoft
|
||||
NULL text 1 Major-Willard 1104596262 35 Wulf_ the (implementation defined) pointer value used to indicate a pointer that refers to no object; a macro expanding to a compile-time integer zero, possibly cast to (void *), e.g. ((void *)0) or 0L
|
||||
NULL text 1 Major-Willard 1104596262 36 SimManiac the (implementation defined) pointer value used to indicate a pointer that refers to no object; a macro expanding to a compile-time integer zero, possibly cast to (void *), e.g. ((void *)0) or 0L
|
||||
NeverDream text 1 NeverDream 1109794818 1 NeverDream the master of all things, living and dead. And those things which exist as a wave function that describes the state of both living and dead. But especially _YOU_!
|
||||
OMG text 1 vorpal 1174943035 3 Random832 Orbitz Meat Gravy
|
||||
Oort text 1 kp 1194144874 9 reportingsjr my sworn enemy!
|
||||
@ -273,28 +279,30 @@ SIGUSR1 text 1 Major-Willard 1104612781 0 nobody a signal reserved for unspecifi
|
||||
SIGUSR2 text 1 Major-Willard 1104613039 0 nobody a signal reserved for unspecified user process use
|
||||
SNAFU text 1 Major-Willard 1109292157 2 Major-Willard Situation Normal All Fucked Up
|
||||
SOP text 1 PoppaVic 1107543001 0 nobody "Standard Operating Procedure"
|
||||
Sailormoon text 1 pragma_ 1259190786 9 Gorgoroth an ignorant Nazi-supporter who makes up imaginary stories about his education in order to disguise the fact that he flunked out of elementary school and didn't make it to high school; now he can only be accepted by Canadian TV Internet colleges, where he spends $1200 every 3 months on Internet classes with a robot teacher. Also, rarely emerges from his parents' house. Converse with this person only if you wish to be insulted and belittled.
|
||||
Sailormoon text 1 pragma_ 1259190786 15 bvalek2 an ignorant Nazi-supporter who makes up imaginary stories about his education in order to disguise the fact that he flunked out of elementary school and didn't make it to high school; now he can only be accepted by Canadian TV Internet colleges, where he spends $1200 every 3 months on Internet classes with a robot teacher. Also, rarely emerges from his parents' house. Converse with this person only if you wish to be insulted and belittled.
|
||||
Skapare text 1 pragma_ 1105957112 1 Skapare Swedish for Creator, and he doesn't want you to bug him about it, anymore
|
||||
Squall` text 1 Squall` 1106979571 3 Squall` the sexiest hacker on the planet
|
||||
TARFU text 1 Major-Willard 1109292407 0 nobody Things Are Really Fucked Up
|
||||
TIL text 1 PoppaVic 1107798020 2 PoppaVic "Threaded Interpretive Language"
|
||||
TLI text 1 PoppaVic 1107535494 1 PoppaVic "Too Little Info"
|
||||
TMI text 1 PoppaVic 1107535524 1 PoppaVic "Too Much Info"
|
||||
TheLandlord text 1 pragma_ 1263205882 2 bvalek2 a majorly stupid retard.
|
||||
TheStar text 1 TheStar 1107406902 0 nobody that huge glowing orb in the sky.
|
||||
This text 1 KernelJ 1259540531 0 nobody SPARTA!!!!!
|
||||
UB text 1 LordOllie 1177692387 10 pragma_ undefined behavior. See, http://en.wikipedia.org/wiki/Undefined_behavior
|
||||
UB text 1 LordOllie 1177692387 11 PeakerWork undefined behavior. See, http://en.wikipedia.org/wiki/Undefined_behavior
|
||||
UCHAR_MAX text 1 defrost 1104389724 0 nobody #include <limits.h> - maximum value for type unsigned char. - >= 255
|
||||
UINT_MAX text 1 twkm 1104369656 0 nobody #include <limits.h> - UINT_MAX - maximum value of an unsigned int object, at least 65535
|
||||
ULONG_MAX text 1 twkm 1104369766 0 nobody #include <limits.h> - ULONG_MAX - maximum value of an unsigned long int object, at least 4294967295
|
||||
USHRT_MAX text 1 defrost 1104389735 0 nobody #include <limits.h> - maximum value for type unsigned short. - >= 65,535
|
||||
UTSL text 1 Wulf_ 1229211575 10 Wulf4 /say Use the source, Luke!
|
||||
Utopiah text 1 pragma_ 1260585861 2 pragma_ a Google-and-Wikipedia whore who likes to quote random links, but doesn't really understand the contents of most of them; never goes outside to interact with reality, and is a sheltered fool who cannot differentiate sarcasm and metaphors from literal speech.
|
||||
Vinny text 1 Vinny_P 1110948024 1 Vinny_P Cool
|
||||
What text 1 Diagoras 1259089664 0 nobody your name
|
||||
XY text 1 Baughn 1203448262 11 kate` /call xy
|
||||
XY text 1 Baughn 1203448262 12 zen /call xy
|
||||
Xy text 1 Baughn 1203448274 1 Draconx /call xy
|
||||
Zhivago text 1 pragma_ 1217055595 7 ColonelJ http://bigeyedeer.files.wordpress.com/2008/07/graf.gif?w=500&h=402
|
||||
Zhivago text 1 pragma_ 1217055595 8 pragma_ http://bigeyedeer.files.wordpress.com/2008/07/graf.gif?w=500&h=402
|
||||
[] text 1 pragma_ 1194260776 7 n00p the array subscript operator. It is also part of declarator syntax. The expressions (x[y]) and (*(x + y)) are equivalent. See also &x[y].
|
||||
\ text 1 Major-Willard 1104603271 7 mordy_ the line continuation character; used in strings to specify special characters; used in character constants to specify special characters; when followed by u or U in C99, is used to specify a universal character name for use in string constants, character constants, or identifiers.
|
||||
\ text 1 Major-Willard 1104603271 8 Random832 the line continuation character; used in strings to specify special characters; used in character constants to specify special characters; when followed by u or U in C99, is used to specify a universal character name for use in string constants, character constants, or identifiers.
|
||||
\Wbot(.*) regex 1 pragma_ 1195528230 0 nobody say $bot_reply
|
||||
\Wcake(.*) regex 1 pragma_ 1195100298 0 nobody say $the_cake
|
||||
\n text 1 Wulf_ 1244570270 1 Wulf_ (new line) Moves the active position to the initial position of the next line.
|
||||
@ -318,21 +326,24 @@ Zhivago text 1 pragma_ 1217055595 7 ColonelJ http://bigeyedeer.files.wordpress.c
|
||||
^won'?t\s(.*) regex 1 pragma_ 1195010690 0 nobody 8ball
|
||||
^wouldn?'?t?\s(.*) regex 1 pragma_ 1195010814 0 nobody 8ball
|
||||
^you\s([^.,!?;]+).*$ regex 1 pragma_ 1194384930 0 nobody say I $1? $reaction
|
||||
_ text 1 mauke 1105863511 9 pragma_ /say All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use. All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces. (ISO 9899:1999, 7.1.3) Don't use such identifiers.
|
||||
_ text 1 mauke 1105863511 10 pragma_ /say All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use. All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces. (ISO 9899:1999, 7.1.3) Don't use such identifiers.
|
||||
__ text 1 kate` 1249744636 1 kate` /say seriously, will everbody please just shut up about the *__*!*@* ban already. it's there to stop idle reconnecting clients postfixing underscores
|
||||
_dwu_ text 1 kp 1199141999 0 nobody a clown
|
||||
a_good_c_tutorial text 1 snhmib 1231877173 2 snhmib /call google "the tutorial, by being brief, may also be misleading"
|
||||
abcdefg text 1 tolkad 1264735448 4 tolkad test
|
||||
acoshl text 1 twkm 1104369471 0 nobody #include <math.h> - long double acoshl(long double);
|
||||
acosl text 1 twkm 1104369374 0 nobody #include <math.h> - long double acosl(long double);
|
||||
acronym module 1 pragma_ 1105953751 350 pragma_ acronym.pl
|
||||
acronym module 1 pragma_ 1105953751 381 pragma_ acronym.pl
|
||||
adjective text 1 syntropy 1254003465 0 nobody fail stupid ignorant annoying awesome unique able adorable adventurous active afraid aggressive amusing awful bad bitter brief careless careful dark dangerous cheap chilly clean
|
||||
adkhaslsa text 1 kate` 1179672824 2 kate` x
|
||||
admins text 1 pragma_ 1192736884 1 pragma_ /call list admins
|
||||
advice text 1 PARLIAMENT 1258762773 17 pragma_ /say $advicepredicate $advicehelper.
|
||||
advice text 1 PARLIAMENT 1258762773 18 arubin /say $advicepredicate $advicehelper.
|
||||
advicehelper text 1 PARLIAMENT 1258762756 0 nobody "do it" "not do it"
|
||||
advicehelper2 text 1 pragma_ 1258763100 0 nobody "would" "would not" might "could possibly" may "may not" "couldn't possibly"
|
||||
advicehelper3 text 1 pragma_ 1258763112 0 nobody wise dumb smart stupid
|
||||
advicepredicate text 1 pragma_ 1258763084 0 nobody "I recommend to" "My advice is to" "I think it $advicehelper2 be $advicehelper3 to" "I think it $advicehelper2 be $advicehelper3 to" "I think it $advicehelper2 be $advicehelper3 to" "I think it $advicehelper2 be $advicehelper3 to" "I think it $advicehelper2 be $advicehelper3 to"
|
||||
aids text 1 PARLIAMENT 1264285407 2 SailorReality "There's no easy way to say this. You got aids. Yuck! :x" $noaids $noaids $noaids "You contracted aids from $who_answers!" "You were attacked by a $animals! You now have aids." $noaids $noaids
|
||||
aidsroulette text 1 PARLIAMENT 1264285308 89 notk0 /say $aids
|
||||
alias text 1 Draconx|Laptop 1194414293 0 nobody am
|
||||
aliases text 1 pragma_ 1179677200 24 PoppaVic /call find ^/call
|
||||
animal_nouns text 1 pragma_ 1108981750 6 pragma_ wet overweight bloated skinny shaved dirty rabid drooling aroused fat filthy golden timid aggressive rabid shy demure seductive
|
||||
@ -343,17 +354,18 @@ ansispec text 1 Cin 1190684046 1 pragma_ www.nirvani.net/docs/ansi_c.pdf
|
||||
ansispecpdf text 1 pragma_ 1192736407 3 pragma_ /call standard
|
||||
answers text 1 pragma_ 1195010969 2 pragma_ Yes. "Most likely." No. "I think not." Brilliant! "Are you a $sizes $idiot?" "Definitely not." "Most assuredly." Absolutely! "Not likely!" "Do I look like I care?" "Ask again later." "Outlook good." "Outlook not so good." "Reply hazy, try again." "Forget it!" "Yeah, right." "As if!" "Can has happy fun time!" "Signs point to yes." "You may rely on it." "That gives me an idea!"
|
||||
any2c text 1 Baughn 1219872462 1 pragma_ recode ascii..ascii/x
|
||||
apue text 1 PoppaVic 1251466408 19 Dianora Advanced Programming in the UNIX Environment, by Stevens, see http://www.kohala.com/start/apue.html
|
||||
apple text 1 kleinbottle 1262537874 1 kleinbottle a fruit
|
||||
apue text 1 PoppaVic 1268625692 0 nobody Advanced Programming in the UNIX Environment, by Stevens and Rago, see http://www.apuebook.com/
|
||||
apue2 text 1 kp 1197696012 5 Draconx http://www.apuebook.com/
|
||||
archivist text 1 Squall` 1110594100 3 archivist someone who wishes he had an identity
|
||||
argc text 1 prec 1104396991 3 Draconx the traditional name of the first parameter to main(); argc is non-negative and gives the number of command line arugments (including the program name).
|
||||
argv text 1 prec 1104397065 6 Draconx the traditional name of the second parameter to main(); argv[argc] == NULL; if argc>0 argv[0] is the program name. if argc>1, argv[1] through argv[argc-1] are the command line arguments.
|
||||
argv text 1 prec 1104397065 7 Anon472 the traditional name of the second parameter to main(); argv[argc] == NULL; if argc>0 argv[0] is the program name. if argc>1, argv[1] through argv[argc-1] are the command line arguments.
|
||||
array text 1 Wulf_ 1247726531 3 tdmackey An array type describes a contiguously allocated nonempty set of objects with a particular member object type, called the element type.
|
||||
arrays text 1 pragma_ 1106022495 36 pragma_ /say Arrays and pointers: http://www.eskimo.com/~scs/C-faq/s6.html
|
||||
aryptr text 1 Wulf_ 1257021622 3 Wulf_ http://c-faq.com/aryptr/index.html
|
||||
aryptr text 1 Wulf_ 1257021622 4 Wulf_ http://c-faq.com/aryptr/index.html
|
||||
asinhl text 1 twkm 1104371830 0 nobody #include <math.h> - long double asinhl(long double);
|
||||
asinl text 1 twkm 1104371771 0 nobody #include <math.h> - double asinl(long double);
|
||||
ask text 1 pragma_ 1106341082 174 Wulf_ /say If you have a question, just ask. If somebody knows, they'll answer :) For best results, be specific, informative, complete, concise and on-topic! Don't ask if you can ask a question. Don't ask if anyone uses/knows about foo. Please don't be demanding or insulting. Remember, we're all volunteers. Also see: http://www.catb.org/~esr/faqs/smart-questions.html
|
||||
ask text 1 pragma_ 1106341082 186 Wulf /say If you have a question, just ask. If somebody knows, they'll answer :) For best results, be specific, informative, complete, concise and on-topic! Don't ask if you can ask a question. Don't ask if anyone uses/knows about foo. Please don't be demanding or insulting. Remember, we're all volunteers. Also see: http://www.catb.org/~esr/faqs/smart-questions.html
|
||||
assume text 1 PoppaVic 1204315475 2 PoppaVic "Assumption is the mother of all fuck-ups"
|
||||
atan2l text 1 twkm 1104371981 0 nobody #include <math.h> - long double atan2l(long double,long double);
|
||||
atanl text 1 twkm 1104371894 0 nobody #include <math.h> - long double atanl(long double);
|
||||
@ -361,7 +373,7 @@ attacks text 1 pragma_ 1108933612 4 Irishmanluke thwaps smacks whacks whaps whip
|
||||
atype text 1 snhmib 1236413496 0 nobody "char a[3]" "char a[2]"
|
||||
autoshit text 1 PoppaVic 1104954897 8 Saparok the portability whore that is GNU autoconf/automake/configure/aclocal/libtool/sh/m4 messes that are NOT portable
|
||||
autotools text 1 pragma_ 1107806042 3 veronica_ http://sources.redhat.com/autobook/
|
||||
awaken text 1 pragma_ 1258799692 2 pragma_ /call unignore .*
|
||||
awaken text 1 pragma_ 1258799692 4 pragma_ /call unignore .* $args
|
||||
away text 1 Shadewalker 1177950209 0 nobody http://sackheads.org/~bnaylor/spew/away_msgs.html
|
||||
b1 text 1 notadev 1183722776 8 lemonade` bashphorism 1: the questioner's first description of the problem/question will be misleading.
|
||||
b2 text 1 notadev 1183722799 2 kate` bashphorism 2: The questioner will keep changing the original question until it drives the helpers in the channel insane.
|
||||
@ -370,77 +382,84 @@ bcopy text 1 Major-Willard 1107484574 0 nobody way cool, but it's more portable
|
||||
beej text 1 twkm 1186757356 65 dbtid http://beej.us/guide/bgnet/
|
||||
beej2 text 1 snhmib 1206996386 0 nobody http://beej.us/guide/bgc/
|
||||
beer text 1 dooky 1110681030 6 shaktazuki The breakfast of champions
|
||||
binky text 1 prec 1106444999 131 bone the Binky Pointer Fun Video at http://cslibrary.stanford.edu/104/
|
||||
binky text 1 prec 1106444999 134 bone the Binky Pointer Fun Video at http://cslibrary.stanford.edu/104/
|
||||
bite text 1 Wulf_ 1244945112 2 lemonade` /me bites $args. Yummy!
|
||||
bithacks text 1 Chris 1256619383 4 Wulf_ http://www.cs.utk.edu/~vose/c-stuff/bithacks.html or http://graphics.stanford.edu/~seander/bithacks.html
|
||||
bitwise text 1 Random832 1255220538 1 apples` http://www.codersger.de/mags/cscene/CS9/CS9-02.html
|
||||
bithacks text 1 Chris 1256619383 11 jwillia3 http://www.cs.utk.edu/~vose/c-stuff/bithacks.html or http://graphics.stanford.edu/~seander/bithacks.html
|
||||
bitwise text 1 Random832 1255220538 3 kuala http://www.codersger.de/mags/cscene/CS9/CS9-02.html
|
||||
blamethecompiler text 1 prec 1106336163 3 Jafet a common disease mostly contracted by beginning programmers. There is no known cure except that over time, outbreaks will occur with less and less frequency.
|
||||
bodily_action text 1 pragma_ 1108935242 0 nobody vomits sneezes coughs snores yawns
|
||||
body_action text 1 pragma_ 1109657461 0 nobody snorts coughs sneezes snores chokes spasms "cracks his neck" "scratches his butt"
|
||||
body_part text 1 pragma_ 1109021527 3 pragma_ arm hand head foot leg face ass ear nose neck "left buttock" nuts
|
||||
book text 1 pragma_ 1179504776 718 quantumEd /me points accusingly at $args, "Where is your book?!"
|
||||
book text 1 pragma_ 1179504776 738 zcram /me points accusingly at $args, "Where is your book?!"
|
||||
book2 text 1 PoppaVic 1179569523 5 lemonade` "What book are you [not] reading?"
|
||||
books text 1 twkm 1104378101 401 spv http://www.iso-9899.info/wiki/Books
|
||||
books text 1 twkm 1104378101 429 PoppaVic http://www.iso-9899.info/wiki/Books
|
||||
booty(.*) regex 1 pragma_ 1195532640 0 nobody me wiggles her butt.
|
||||
bossbear text 1 pragma_ 1259019160 2 pragma_ an unoriginal plagarist whose babble closely resembles http://timecube.com -- Do not click any of his links.
|
||||
bossbear text 1 pragma_ 1259019160 5 pragma_ an unoriginal plagarist and UFO nut whose babble closely resembles http://timecube.com -- Do not click any of his links.
|
||||
bot_reply text 1 pragma_ 1195528131 0 nobody "Bot? Where?" "We can't stop here, this is bot country!" "Who's a bot?"
|
||||
botsnack text 1 pragma_ 1174693123 214 pragma_ /me $eat_adverbs $eat_actions her snack.
|
||||
botsnack text 1 pragma_ 1174693123 217 kate` /me $eat_adverbs $eat_actions her snack.
|
||||
bottom_up text 1 PoppaVic 1187190800 0 nobody http://www.paulgraham.com/progbot.html
|
||||
bounce text 1 pragma_ 1108872842 12 anttil /me bounces around.
|
||||
break text 1 Major-Willard 1104888615 3 ktietz the statement used terminate the currently executing block
|
||||
british text 1 pragma_ 1208327851 0 nobody http://www.effingpot.com/index.shtml
|
||||
british text 1 pragma_ 1208327851 1 jwillia3 http://www.effingpot.com/index.shtml
|
||||
but text 1 M1TE5H 1261152016 1 darkscriptc not +1
|
||||
bvalek2 text 1 bvalek2 1263206502 4 bvalek2 a next-generation AI bot
|
||||
bye text 1 pragma_ 1109365229 24 pragma_ /say $bye_words, $nick
|
||||
bye! text 1 NeverDream 1109793039 1 NeverDream /say Excellently observed, $nick, but let us cultivate our garden.
|
||||
bye_words text 1 pragma_ 1109013658 3 pragma_ Bye Later Adios Good-bye Sayonara Bye-bye "See you later"
|
||||
byte text 1 prec 1104873342 13 sjm13 defined by the C standard as an addressable unit of storage large enough to hold a character value. The char type is byte-sized and is at least 8 bits wide. CHAR_BIT in <limits.h> defines the byte size for any given implementation. The term "byte" is most often used to mean 8 bits; however, the term octet is preferred.
|
||||
c text 1 pragma_ 1108006206 138 n00p a low level language designed to make assembly "easier", useful for device drivers or operating systems. Thusly, one has to maintain buffers, memory, and various low level information. C is not meant to be used for everyday applications, a common misconception.
|
||||
c++ text 1 NeverDream 1108585029 37 mizai not C, try ##c++
|
||||
c text 1 pragma 1108006206 131 pragma_ /say C is a low level language designed to make assembly "easier", useful for device drivers or operating systems. Thusly, one has to maintain buffers, memory, and various low level information. C is not meant to be used for everyday applications, a common misconception.
|
||||
c++ text 1 NeverDream 1108585029 42 pragma_ /say C++ is not C, try ##c++
|
||||
c++diffs text 1 PoppaVic 1204224553 4 lemonade` http://david.tribble.com/text/cdiffs.htm
|
||||
c/c++ text 1 PoppaVic 1252250954 1 Chris http://david.tribble.com/text/cdiffs.htm
|
||||
c10k text 1 twkm 1104635961 9 Jafet the c10k problem, see http://www.kegel.com/c10k.html
|
||||
c89 text 1 Wulf4 1236861685 5 apples` C89 draft: http://flash-gordon.me.uk/ansi.c.txt
|
||||
c10k text 1 twkm 1104635961 10 pragma_ the c10k problem, see http://www.kegel.com/c10k.html
|
||||
c89 text 1 Wulf4 1236861685 9 pragma_ C89 draft: http://flash-gordon.me.uk/ansi.c.txt
|
||||
c9888 text 1 Cin 1190426882 2 pragma_ www.nirvani.net/docs/ansi_c.pdf
|
||||
c9899 text 1 Cin 1190426934 3 pragma_ www.nirvani.net/docs/ansi_c.pdf
|
||||
c99 text 1 peapicker 1204312010 20 pragma_ /call std
|
||||
c99 text 1 peapicker 1204312010 28 n00p /call std
|
||||
c99status text 1 pragma_ 1108082627 5 lemonade` GCC's C99 implementation status: http://gcc.gnu.org/c99status.html
|
||||
c9xdiffs text 1 twkm 1104460717 4 lemonade` http://home.datacomm.ch/t_wolf/tw/c/c9x_changes.html
|
||||
caio text 1 pragma_ 1193167316 1 pragma_ /call bye
|
||||
calc text 1 pragma_ 1193082106 3 Chris /call math
|
||||
callgraph text 1 kate` 1247207074 2 kate` /say Generating a potential call graph from an RTL dump: http://www.gson.org/egypt/
|
||||
candide text 1 pragma_ 1107122441 49 bvalek2 a bot. See http://www.iso-9899.info/wiki/Candide for more information.
|
||||
cast text 1 pragma_ 1191042665 47 Arimoto /call cdecl cast
|
||||
casting text 1 pragma_ 1105954332 16 Lemurian /say Cast properly: http://www.cognitiveprocess.com/~rjh/prg/writings/casting.html
|
||||
candide text 1 pragma_ 1107122441 51 hypnosis a bot. See http://www.iso-9899.info/wiki/Candide for more information.
|
||||
cast text 1 pragma_ 1191042665 48 Helpsys /call cdecl cast
|
||||
casting text 1 pragma_ 1105954332 18 Sacho /say Cast properly: http://www.cognitiveprocess.com/~rjh/prg/writings/casting.html
|
||||
cat text 1 kate` 1195413751 4 immibis http://www.iso-9899.info/wiki/Cat
|
||||
cbad text 1 Baughn_ 1199480037 2 pragma_ /call size
|
||||
cdecl module 1 pragma_ 1191041914 1680 gl cdecl.pl
|
||||
cdecl module 1 pragma_ 1191041914 2014 Wulf cdecl.pl
|
||||
cfa text 1 kate` 1245945081 1 kate` /say http://benpfaff.org/writings/clc/
|
||||
cfaq text 1 pragma_ 1106283720 4 scorp007 comp.lang.c FAQ: http://www.eskimo.com/~scs/C-faq/top.html
|
||||
cgisock text 1 pragma_ 1106002098 0 nobody See http://www.cyberspace.org/~pfv/libcgisock.html for a nifty little module for the Apache Web Server that allows a browser to connect to programs already loading and running on remote systems via the ubiquitous Unix-Socket.
|
||||
channel text 1 pragma_ 1253185803 1 pragma_ the iwn
|
||||
channelstats text 1 pragma_ 1106000070 4 pragma_ /say See http://ortdotlove.net/c.html for #C channel statistics for irc.freenode.net!
|
||||
char*a,b text 1 Random832 1262676676 2 Chris /say The declaration "char* a, b" declares a as a pointer to char and b as a char - it does not declare b as a pointer to char.
|
||||
charset text 1 prec 1107982156 1 richardus a character set is a set of characters. http://www.cs.tut.fi/~jkorpela/chars.html
|
||||
chill text 1 notadev 1182354783 8 lclimber /say OK, it's getting a little hairy, and really we're all here because we love C. So relax, take a walk, have a cuppa, whatever. Er.. please? ;)
|
||||
class text 1 runtime 1177799535 2 jengelh not c, try ##c++
|
||||
cluebat text 1 pragma_ 1208762427 2 andy /me whacks $args with a $sizes $colors cluebat.
|
||||
codeblocks text 1 Jafet 1185606931 2 whoppix /say Code::Blocks is a fairly popular IDE for C and C++ development. Some folks beef that it has been distributing nightly builds and not releasing stable ones for quite some time now, others like it for this very fact. http://codeblocks.org
|
||||
colors text 1 pragma_ 1108931265 5 Irishmanluke red green yellow blue purple pink brown black white octarine cyan magenta orange
|
||||
commands text 1 pragma_ 1179674227 18 Nately /call list commands
|
||||
combo-breaker text 1 pragma_ 1262777913 1 pragma_ /say ........('(...´...´.... ¯~/'...')
|
||||
commands text 1 pragma_ 1179674227 20 tolkad /call list commands
|
||||
common text 1 pragma_ 1230993541 2 cousteau http://www.myconfinedspace.com/wp-content/uploads/2008/04/common-sense-superpower.jpg
|
||||
comparch text 1 pragma_ 1180158061 1 pragma_ http://dept-info.labri.fr/~strandh/Teaching/AMP/Common/Strandh-Tutorial/Dir.html
|
||||
compilerline text 1 PoppaVic 1251231275 3 Airwalk CC <overall options> [-std=whatever] <debugging> <optimizing> <warnings> [-pedantic] <Other Include Paths> <Other Lib Paths> <Magic Defines> <Magic Undefines> [-f<language/platform options] [-m<machine options>] [-o outfile] files..... (this is all documented, and files can be .c or .o, .a or .so, or -l<to be linked> commands.) <paraphrased from man gcc>
|
||||
compliment module 1 pragma_ 1255395343 14 pragma_ compliment
|
||||
const text 1 prec 1107648578 18 sswam http://publications.gbdirect.co.uk/c_book/chapter8/const_and_volatile.html - see section 8.4.1, http://c-faq.com/ansi/constmismatch.html
|
||||
continue text 1 Major-Willard 1104888657 2 mordy_ the statement used recommence the currently executing block
|
||||
compilerline text 1 PoppaVic 1266709397 2 PoppaVic Order Matters: CC <overall options> [-std=whatever] <debugging> <optimizing> <warnings> [-pedantic] <Other Include Paths> <Other Lib Paths> <Magic Defines> <Magic Undefines> [-f<language/platform options] [-m<machine options>] [-o outfile] files..... (this is all documented, and files can be .c or .o, .a or .so, or -l<to be linked> commands.) <paraphrased from man gcc>
|
||||
compliance text 1 n00p 1263936847 0 nobody !portability
|
||||
compliment module 1 pragma_ 1255395343 37 notk0 compliment
|
||||
const text 1 prec 1107648578 19 kuala http://publications.gbdirect.co.uk/c_book/chapter8/const_and_volatile.html - see section 8.4.1, http://c-faq.com/ansi/constmismatch.html
|
||||
continue text 1 Major-Willard 1104888657 4 pragma_ the statement used recommence the currently executing block
|
||||
controlstack text 1 PoppaVic 1174907617 2 lemonade`_ http://www.answers.com/topic/call-stack
|
||||
converting text 1 prec 1106351170 4 orbitz http://www.iso-9899.info/wiki/Converting
|
||||
cookie text 1 pragma_ 1195333486 22 pragma_ /call botsnack
|
||||
coupon text 1 pragma_ 1203409804 0 nobody http://scorpaen.com/yo/dishstfu.jpg
|
||||
cparse text 1 PoppaVic 1183204560 2 PoppaVic ctags, etags
|
||||
cpp text 1 PoppaVic 1107543769 17 v86 The C Preprocessor ; integrated with gcc
|
||||
cpp-com text 1 n00p 1263936430 2 n00p /say cplusplus-dot-com is a C++-related website that happens to reference C89 functions. Many of the examples given are actually C++ because they use 'headers' such as <cstdio> instead of <stdio.h>. A better reference would be the !c99 standard.
|
||||
cpp_output text 1 PoppaVic 1188757324 1 PoppaVic http://gcc.gnu.org/onlinedocs/gcc-3.2.3/cpp/Preprocessor-Output.html
|
||||
cpu text 1 PoppaVic 1181742365 1 leomonadedrink http://webster.cs.ucr.edu/AoA/Windows/HTML/CPUArchitecturea3.html
|
||||
cpuzzles text 1 pragma_ 1263170451 0 nobody http://www.gowrikumar.com/c/index.html
|
||||
crazyplanet text 1 pragma_ 1180161295 0 nobody http://www.ourcrazyplanet.com/
|
||||
cstd text 1 pragma_ 1192736325 31 lemonade` /call standard
|
||||
cstd text 1 pragma_ 1192736325 32 pragma_ /call standard
|
||||
csv text 1 lemonade` 1234298513 2 lemonade` http://en.wikipedia.org/wiki/CSV_application_support
|
||||
cya text 1 pragma_ 1193167291 0 nobody /call bye
|
||||
cyborg text 1 pragma_ 1198047525 1 whats_in_a_name /say $nick, you suck!
|
||||
@ -449,35 +468,37 @@ dads text 1 twkm 1104460751 1 PoppaVic http://www.nist.gov/dads
|
||||
daemon text 1 prec 1112139369 1 Ryan52 http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
|
||||
dahitokiri text 1 dahitokiri 1199481407 0 nobody awesometastic
|
||||
ddd text 1 pragma_ 1175114372 0 nobody a graphical front end to gdb and other debuggers (http://www.gnu.org/software/ddd/)
|
||||
decl text 1 kate` 1195724740 3 apples` http://www.cs.usfca.edu/~parrt/course/652/lectures/cdecls.html
|
||||
declare text 1 pragma_ 1191042438 158 Wulf_ /call cdecl declare
|
||||
death text 1 pragma_ 1262505629 0 nobody http://www.newscientist.com/article/mg19626252.800
|
||||
decl text 1 kate` 1195724740 4 jwillia3 http://www.cs.usfca.edu/~parrt/course/652/lectures/cdecls.html
|
||||
declare text 1 pragma_ 1191042438 181 Pryon /call cdecl declare
|
||||
declaredefine text 1 kate` 1179653420 5 PoppaVic A declaration specifies the interpretation and attributes of a set of identifiers. A definition of an identifier is a declaration for that identifier that: for an object, causes storage to be reserved for that object; for a function, includes the function body; for an enumeration constant or typedef name, is the (only) declaration of the identifier.
|
||||
def2 module 1 pragma_ 1194748965 41 pragma_ define2.pl
|
||||
define module 1 pragma_ 1105953728 534 pragma_ define.pl
|
||||
default text 1 snhmib 1262537581 1 snhmib Hi there! Take a look at !k&r or !standard! Good luck!
|
||||
define module 1 pragma_ 1105953728 862 pbot3 define.pl
|
||||
defrost text 1 Major-Willard 1106696388 3 Ramier the one who does the jokes ;p
|
||||
describe text 1 pragma_ 1193083745 34 moqq /call explain
|
||||
describe text 1 pragma_ 1193083745 66 s00p /call explain
|
||||
destroyer text 1 destroyer 1110396483 2 destroyer a script kiddy wannabe hacker.
|
||||
dickwad text 1 pragma_ 1199691115 6 pragma_ http://www.imagepoop.com/image/1427/Greater-Internet-Dickwad-Theory.html
|
||||
dict text 1 pragma_ 1179679066 84 pragma_ /call define
|
||||
dictionary text 1 pragma_ 1257557077 14 pragma_ /say !dict == dictionary.org; !gdict == Google's "define:<term>" search; !udict == Urban Dictionary; !wdict == Wikipedia
|
||||
dict text 1 pragma_ 1179679066 313 pbot3 /call define
|
||||
dictionary text 1 pragma_ 1257557077 16 pragma_ /say !dict == dictionary.org; !gdict == Google's "define:<term>" search; !udict == Urban Dictionary; !wdict == Wikipedia
|
||||
die text 1 syntropy 1249675373 0 nobody YOU MUST DIE. http://omploader.org/vMjQ4MQ
|
||||
digraph text 1 twkm 1104552499 2 pragma_ a two character alternative punctuator, intended to make using c possible on systems where the primary punctuator is missing, typically from keyboards. they are normal tokens, so are processed in the same way as other source characters (apart from trigraphs).
|
||||
do text 1 pragma_ 1194467444 54 ktietz /call 8ball
|
||||
do text 1 pragma_ 1194467444 62 cxo /call 8ball
|
||||
dock text 1 pragma_ 1255049382 3 pragma_ /me docks penises with $args
|
||||
doesn'?t\swork regex 1 pragma_ 1231207773 0 nobody doesntwork
|
||||
doesntcare text 1 pragma_ 1105954303 11 seand /say Standard C does not know nor care about colors, mice, windows, keyboards, networks or any other system specific things. If you want help with something like that, you would want to tell us what OS, compiler, tools or libraries you are or intend to use/abuse.
|
||||
doesntwork text 1 pragma_ 1175456821 108 pragma_ /say "It doesn't work!" is not very informative for the people trying to help you. Please describe what you think may be wrong, what results you expected to get and what instead actually happens. Pasting code and/or error messages to http://codepad.org/ may be helpful.
|
||||
doesntcare text 1 pragma_ 1105954303 12 jwillia3 /say Standard C does not know nor care about colors, mice, windows, keyboards, networks or any other system specific things. If you want help with something like that, you would want to tell us what OS, compiler, tools or libraries you are or intend to use/abuse.
|
||||
doesntwork text 1 pragma_ 1175456821 117 PoppaVic /say "It doesn't work!" is not very informative for the people trying to help you. Please describe what you think may be wrong, what results you expected to get and what instead actually happens. Pasting code and/or error messages to http://codepad.org/ may be helpful.
|
||||
don'?t\scast\smalloc,? regex 1 pragma_ 1194258211 0 nobody dontcastmalloc
|
||||
dontcastmalloc text 1 infobahn 1104594725 407 pragma_ /say There is no need to cast the result of library functions that return void *; it makes your code hard to read, adds no value, and can hide a bug if you don't have a valid prototype in scope. See http://www.cpax.org.uk/prg/writings/casting.php and http://c-faq.com/malloc/mallocnocast.html
|
||||
dontcastmalloc text 1 infobahn 1104594725 439 kate` /say There is no need to cast the result of library functions that return void *; it makes your code hard to read, adds no value, and can hide a bug if you don't have a valid prototype in scope. See http://www.cpax.org.uk/prg/writings/casting.php and http://c-faq.com/malloc/mallocnocast.html
|
||||
dooky text 1 dooky 1109726391 6 Major-Willard the destroyer of worlds, an ardent sandwich eater.
|
||||
double text 1 pragma_ 1195072541 13 halberd /say When taking input for type double you need to use lf format specifier in the scanf statement. But when you are outputting a double you use f format specifier in the printf statements.
|
||||
draft text 1 pragma_ 1252608384 0 nobody /call standard
|
||||
drafts text 1 pragma_ 1252608917 1 pragma_ /call standard
|
||||
double text 1 pragma_ 1195072541 18 Chris /say When taking input for type double you need to use lf format specifier in the scanf statement. But when you are outputting a double you use f format specifier in the printf statements.
|
||||
draft text 1 pragma_ 1252608384 1 lemonade` /call standard
|
||||
drafts text 1 pragma_ 1252608917 2 lemonade` /call standard
|
||||
dragonbook text 1 Saparok 1199314983 6 lemonade` http://en.wikipedia.org/wiki/Dragon_Book
|
||||
driven-development text 1 pragma_ 1253816749 0 nobody http://www.scottberkun.com/blog/2007/asshole-driven-development/
|
||||
dsaa text 1 twkm 1104460769 1 Auris- http://ciips.ee.uwa.edu.au/~morris/Year2/PLDS210/ds_ToC.html
|
||||
duffgrams text 1 kate` 1180325598 0 nobody http://www.iq0.com/duffgram/index.html
|
||||
duffing text 1 kate` 1176900462 65 kate` writing code from top to bottom, as opposed to horizontally. See http://iq0.com/notes/deep.nesting.html
|
||||
duffing text 1 kate` 1176900462 69 kate` writing code from top to bottom, as opposed to horizontally. See http://iq0.com/notes/deep.nesting.html
|
||||
duffs-device text 1 defrost 1104395556 0 nobody magical old school technique to directly express general loop unrolling in C. see http://www.lysator.liu.se/c/duffs-device.html
|
||||
east text 1 pragma_ 1231873978 5 d3mn0id /say $rpg_ans
|
||||
eat_actions text 1 pragma_ 1174693106 0 nobody gobbles snarfs munches inhales "wolfs down"
|
||||
@ -487,84 +508,88 @@ errno text 1 defrost 1104386234 0 nobody library error macro, #include <errno.h>
|
||||
errors text 1 pragma_ 1108853504 17 lemonade` /say If you have an error message please paste the actual error message. Do not say "I have an error in my code." Please paste the relevant code at http://rafb.net/paste/ with comments indicating the line numbers and a description of what you're trying to accomplish. Do not ask to "find the error in my code, plzz".
|
||||
escapes text 1 PoppaVic 1186590660 0 nobody http://www-ccs.ucsd.edu/c/charset.html
|
||||
espdiff text 1 prec 1106956904 0 nobody a program which applies the appropriate transformation to a patch or set of patches, depending on what you intend to accomplish.
|
||||
everything text 1 Nately 1264580456 0 nobody for the best, right
|
||||
evilandomnipotence text 1 pragma_ 1260213447 0 nobody http://www.ditext.com/mackie/evil.html
|
||||
excuse module 1 pragma_ 1236819394 204 grot excuse.sh
|
||||
existence text 1 pragma_ 1258974955 5 pragma_ /say The most basic property is the property that there are no properties; which is a property in itself. The most basic object is the void; which by the same vein of the first sentence means that there cannot be a void. Everything and nothing is filled with something. Existence is simply a paradox of contradictions and opposite reactions. Ones and zeroes, truth and fiction. Everything that shall be will be. A collective imagination of sentience.
|
||||
explain text 1 pragma_ 1191042468 1407 gl /call cdecl explain
|
||||
f text 1 pragma_ 1195072614 9 halberd /call double
|
||||
excuse module 1 pragma_ 1236819394 237 pragma_ excuse.sh
|
||||
existence text 1 pragma_ 1258974955 8 pragma_ /say The most basic property is the property that there are no properties; which is a property in itself. The most basic object is the void; which by the same vein of the first sentence means that there cannot be a void. Everything and nothing is filled with something. Existence is simply a paradox of contradictions and opposite reactions. Ones and zeroes, truth and fiction. Everything that shall be will be. A collective imagination of sentience.
|
||||
explain text 1 pragma_ 1191042468 1681 Wulf /call cdecl explain
|
||||
eye text 1 n00p 1264246320 1 n00p /say open your eyes, $1
|
||||
f text 1 pragma_ 1195072614 11 Chris /call double
|
||||
faces text 1 kate` 1209250455 0 nobody :) ;) :o >:) :p :P~ :D ;-D :^) =^.^= >:O
|
||||
factoid text 1 pragma_ 1108616481 i PoppaVic of information
|
||||
factoids text 1 pragma_ 1192737117 5 appletizer /call list factoids
|
||||
false text 1 snhmib 1197769474 2 c_nick !true
|
||||
fap text 1 PARLIAMENT 1258697281 81 PARLIAMENT /say $nick, fap to something on the first page of $fapsites
|
||||
fap text 1 PARLIAMENT 1258697281 88 notk0 /say $nick, fap to something on the first page of $fapsites
|
||||
fapgay text 1 PARLIAMENT 1258698593 1 PARLIAMENT straight straight straight straight straight straight straight striaght straight "gay - You're screwed."
|
||||
faps text 1 pragma_ 1258697089 15 pragma_ /me performs $faps3 masturbation with a $sizes $colors $faps4 while thinking of $who_answers.
|
||||
faps text 1 pragma_ 1258697089 18 pragma_ /me performs $faps3 masturbation with a $sizes $colors $faps4 while thinking of $who_answers.
|
||||
faps1 text 1 PARLIAMENT 1258696772 1 PARLIAMENT pussy anal blowjob handjob
|
||||
faps2 text 1 PARLIAMENT 1258698496 0 nobody chick girl beauty hot tits breasts playful pleasure asian black milf fat dwarf
|
||||
faps3 text 1 pragma_ 1258697019 0 nobody anal vaginal penile
|
||||
faps4 text 1 pragma_ 1258697044 0 nobody buttplug "baseball bat" "coca-cola bottle" "string of anal beads" toaster "strawberry pop-tart"
|
||||
faps5 text 1 pragma_ 1258697058 0 nobody lesbian homosexual straight
|
||||
fapsites text 1 PARLIAMENT 1258697164 4 pragma_ http://redtube.com/?search=$faps1+$faps2 http://youporn.com/search?query=$faps1+$faps2&type=$fapgay
|
||||
faq module 1 twkm 1104460444 496 pragma_ cfaq.pl
|
||||
feof text 1 Major-Willard 1104888995 4 orbitz a function, taking one FILE * as an argument, indicating a file has been completely read by getc/getchar/fread (not a recommended construct)
|
||||
faq module 1 twkm 1104460444 499 pragma_ cfaq.pl
|
||||
feof text 1 Major-Willard 1104888995 5 kuala a function, taking one FILE * as an argument, indicating a file has been completely read by getc/getchar/fread (not a recommended construct)
|
||||
ffi text 1 PoppaVic 1192819360 2 PoppaVic Foreign Function Interface
|
||||
fflush(stdin) text 1 pragma_ 1193892350 12 iascorga /call stdinflush
|
||||
fflush(stdin) text 1 pragma_ 1193892350 14 pragma_ /call stdinflush
|
||||
fgets.idiom text 1 prec 1106767895 9 pragma_ while (fgets(line, sizeof line, stdin)) { /* process line */ }
|
||||
fhs text 1 twkm 1104460859 5 lemonade` http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/ref-guide/s1-filesystem-fhs.html
|
||||
floating text 1 pragma_ 1200954186 8 Jester01 http://docs.sun.com/source/806-3568/ncg_goldberg.html
|
||||
floating text 1 pragma_ 1200954186 18 Random832 http://docs.sun.com/source/806-3568/ncg_goldberg.html
|
||||
flushstdin text 1 pragma_ 1251612101 0 nobody /call stdinflush
|
||||
foo-nix text 1 foo-nix 1199181837 1 foo-nix said to be the worst *nix distribution ever.
|
||||
fool text 1 pragma_ 1194366107 5 Killer-X /say He who asks a question may be a fool for five minutes; he who does not ask a question remains a fool forever.
|
||||
fpt text 1 OrngeTide 1189558928 2 Wulf_ /say Function Pointer Tutorial: http://www.newty.de/fpt/fpt.html
|
||||
fquote module 1 pragma_ 1258701318 23 PARLIAMENT funnyish_quote.pl
|
||||
fu text 1 pragma_ 1257669280 2 pragma_ /say Screw you, Dr|Jekle.
|
||||
funcpointers text 1 twkm 1104460679 9 lemonade` http://www.function-pointer.org/
|
||||
funcpointers text 1 twkm 1104460679 12 kuala http://www.function-pointer.org/
|
||||
functionpointer text 1 orbitz 1104968677 4 lemonade` www.function-pointer.org
|
||||
g text 1 pragma_ 1240680519 66 autoclesis_ /call google
|
||||
g text 1 pragma_ 1240680519 88 autoclesius /call google
|
||||
gamers text 1 pragma_ 1228387329 0 nobody http://infovore.org/talks/if-gamers-ran-the-world/
|
||||
gas-notes text 1 pragma_ 1199243990 0 nobody http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15213-s00/doc/gas-notes.txt
|
||||
gcc text 1 twkm 1104389164 9 PoppaVic GNU Compiler Collection, also the command name of the c compilation controller
|
||||
gdb text 1 twkm 1104460628 6 c_nick tutorial: http://www.cs.princeton.edu/~benjasik/gdb/gdbtut.html; http://www.delorie.com/gnu/docs/gdb/gdb_toc.html
|
||||
gdefine module 1 pragma_ 1236819675 338 Kogs gdefine.pl
|
||||
gdict text 1 pragma_ 1255125488 246 Kogs /call gdefine
|
||||
gcc text 1 twkm 1104389164 11 PoppaVic GNU Compiler Collection, also the command name of the c compilation controller
|
||||
gcchacks text 1 pragma_ 1261374181 0 nobody http://www.ibm.com/developerworks/linux/library/l-gcc-hacks/
|
||||
gdb text 1 twkm 1104460628 8 pragma_ /say GDB website: http://www.gnu.org/software/gdb/ - GDB Manual: http://sourceware.org/gdb/current/onlinedocs/gdb/
|
||||
gdefine module 1 pragma_ 1236819675 415 pragma_ gdefine.pl
|
||||
gdict text 1 pragma_ 1255125488 321 pragma_ /call gdefine
|
||||
geekporn text 1 pragma_ 1202802223 0 nobody http://www.ellf.ru/2008/02/05/kompy-kompy-kompy-86-foto.html
|
||||
get text 1 Irishmanluke 1257711390 14 _auto_clesis_ /me $attacks $args with a $sizes $colors $animal_nouns $animals
|
||||
get text 1 Irishmanluke 1257711390 16 IXin /me $attacks $args with a $sizes $colors $animal_nouns $animals
|
||||
getabook text 1 Cin 1194842863 3 cousteau http://img145.imageshack.us/img145/6982/1193921620752dw2.jpg
|
||||
getcdecl text 1 pragma_ 1191041433 3 PoppaVic http://hpux.cs.utah.edu/hppd/hpux/Misc/cdecl-2.5/
|
||||
getopt text 1 Quetzalcoatl_ 1237062000 1 cousteau a C library function for parsing command-line arguments. It is found on Linux, BSD, and other Unix systems.
|
||||
gets text 1 pragma_ 1108103139 40 kesselhaus very bad. It cannot be told the size of the buffer to read in, therefore it has no way of preventing buffer overflows. Use fgets() with 'stdin' as the FILE* instead. http://www.eskimo.com/~scs/C-faq/q12.23.html
|
||||
gets text 1 pragma_ 1108103139 45 rogue very bad. It cannot be told the size of the buffer to read in, therefore it has no way of preventing buffer overflows. Use fgets() with 'stdin' as the FILE* instead. http://www.eskimo.com/~scs/C-faq/q12.23.html
|
||||
gettimeofday text 1 Major-Willard 1104639290 0 nobody a function that returns the time in seconds and milliseconds since the epoch (Thursday, January 1 1970) and the local timezone
|
||||
gigo text 1 prec 1177948351 5 zu22 Garbage In, Garbage Out -- http://c-faq.com/malloc/malloc1.html
|
||||
gnumake text 1 pragma_ 1194222910 1 pragma_ http://www.gnu.org/software/make/manual/make.pdf
|
||||
godprogrammer text 1 pragma_ 1260214264 6 sgnte /say It's not unreasonable that if computer programmers developed an autonomous self-learning/self-correcting AI world and allowed it to run for several billion iterations; then came back to it, that they may not be able to alter it without destroying it. If such a programmer were to have orginally created debug routines and backdoors, such code would ultimately point to obsolete code regions.
|
||||
google module 1 pragma_ 1105953714 484 Gorgoroth google.pl
|
||||
gotchas text 1 kate` 1244833982 72 Dianora /say http://www.iso-9899.info/wiki/C_gotchas
|
||||
godprogrammer text 1 pragma_ 1260214264 9 lemonade` /say It's not unreasonable that if computer programmers developed an autonomous self-learning/self-correcting AI world and allowed it to run for several billion iterations; then came back to it, that they may not be able to alter it without destroying it. If such a programmer were to have orginally created debug routines and backdoors, such code would ultimately point to obsolete code regions.
|
||||
google module 1 pragma_ 1105953714 572 PoppaVic google.pl
|
||||
gotchas text 1 kate` 1244833982 102 Dianora /say http://www.iso-9899.info/wiki/C_gotchas
|
||||
goto text 1 Baughn 1186325626 6 cousteau http://imgs.xkcd.com/comics/goto.png
|
||||
greenspun text 1 mauke 1108933892 2 pragma_ /say Greenspun's Tenth Rule of Programming: "Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
|
||||
grot text 1 pragma_ 1260048234 4 grot /say <grot> I remember the relief of waking up one morning (sane) in a hospital bed, after a night of terror after smoking cannbis, having freaked out completely and developed symptoms that went beyond ordinary panic attacks
|
||||
gspy module 1 pragma_ 1105953720 44 Gorgoroth gspy.pl
|
||||
greenspun text 1 mauke 1108933892 3 leth /say Greenspun's Tenth Rule of Programming: "Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
|
||||
grot text 1 pragma_ 1260048234 6 grot /say <grot> I remember the relief of waking up one morning (sane) in a hospital bed, after a night of terror after smoking cannbis, having freaked out completely and developed symptoms that went beyond ordinary panic attacks
|
||||
gspy module 1 pragma_ 1105953720 48 Sailormoon gspy.pl
|
||||
gtk text 1 PoppaVic 1189183386 3 PoppaVic #gtk at irc.gnome.org and http://gtk.org/api/ has online and tarball docs for glib, pango, gtk and other gtk+ libraries.
|
||||
gtop10 module 1 pragma_ 1175420853 11 pragma_ gtop10.pl
|
||||
gtop15 module 1 pragma_ 1175428910 41 hairport gtop15.pl
|
||||
gtop10 module 1 pragma_ 1175420853 12 pragma_ gtop10.pl
|
||||
gtop15 module 1 pragma_ 1175428910 47 pragma_ gtop15.pl
|
||||
guesscoding text 1 Tefaj 1215947047 4 Jafet the act of trying to write code without learning the language, or to use a library without reading the documentation. How guesscoders even get anything done is anyone's guess.
|
||||
gut text 1 pragma_ 1257712588 1 pragma_ /call get
|
||||
gw text 1 dbtid 1254241388 11 LeoNerd "Given..Want": What do you have to work with? What's the desired goal? Between them is the resulting Process. Now ask yourself: WHY am I doing this? Why THIS way?
|
||||
h&s text 1 pragma_ 1203129114 80 Dianora /call H&S
|
||||
gw text 1 dbtid 1254241388 21 PoppaVic /say "Given..Want": What do you have to work with? What's the desired goal? Between them is the resulting Process. Now ask yourself: WHY am I doing this? Why THIS way?
|
||||
h&s text 1 pragma_ 1203129114 89 Chris /call H&S
|
||||
h/o text 1 snhmib 1262628840 1 kuala hold-on
|
||||
happy\snew\syear regex 1 pragma_ 1199174945 0 nobody say Happy New Year, $nick!
|
||||
hash text 1 pragma_ 1199914203 0 nobody http://en.wikipedia.org/wiki/Hashtable
|
||||
havel text 1 pragma_ 1230293490 0 nobody http://www.gse.buffalo.edu/FAS/Bromley/classes/theory/Havel.htm
|
||||
hello text 1 pragma_ 1179679787 52 pragma_ /call hi
|
||||
hello text 1 pragma_ 1179679787 54 pragma_ /call hi
|
||||
helloworld text 1 pragma_ 1237684920 0 nobody http://www.lisha.ufsc.br/~guto/teaching/os/exercise/hello.html
|
||||
help text 1 NeverDream 1109792986 341 Gorgoroth /say To learn all about me, see http://www.iso-9899.info/wiki/Candide
|
||||
help text 1 NeverDream 1109792986 398 Chris /say To learn all about me, see http://www.iso-9899.info/wiki/Candide
|
||||
herring text 1 Baughn 1173805492 1 rhc a vicious species, loyal only to Baughn. Attempts to wrest control of the Herring Hordes can result in consequences similar to http://fukung.net/v/2833/15cod.jpg .
|
||||
hi text 1 pragma_ 1109044278 606 pragma_ /say $hi_phrases, $nick
|
||||
hi text 1 pragma_ 1109044278 709 pragma_ /say $hi_phrases, $nick
|
||||
hi_phrases text 1 pragma_ 1109044257 1 dav7 "Well, hello there" "Hi there" "Hey, whats up" Hola Hi Hello "Que pasa"
|
||||
hint text 1 pragma_ 1205575974 1 pragma_ http://www.yesfunny.com/Sports/sports8.jpeg -- in other words, are you sure C is for you?
|
||||
hit text 1 pragma_ 1258701405 1 PARLIAMENT /call slap
|
||||
hit text 1 pragma_ 1258701405 3 pragma_ /call slap
|
||||
hmmm text 1 Dianora 1230314812 0 nobody it in
|
||||
hola text 1 pragma_ 1193167207 2 anttil /call hi
|
||||
homework text 1 kate` 1231165509 18 LeoNerd /say We can help with homework, as long as it's within the spirit of the assignment. We won't do it for you, though.
|
||||
horoscope module 1 pragma_ 1255107146 3 pragma_ horoscope
|
||||
homework text 1 kate` 1231165509 20 PoppaVic /say We can help with homework, as long as it's within the spirit of the assignment. We won't do it for you, though.
|
||||
horoscope module 1 pragma_ 1255107146 19 gunninK horoscope
|
||||
hostile text 1 prec 1105037725 1 pragma_ http://www.iscblog.info/blog/display/32
|
||||
house text 1 pragma_ 1194058489 3 mauke /say What you're attempting is akin to an apprentence carpenter attempting to construct an entire house without having learned how to measure. In other words, there will be a lot of holes -- if the entire contraption doesn't fall apart completely.
|
||||
how_answers text 1 pragma_ 1193949354 2 pragma_ "I don't know." "If you investigate a $sizes amount further, you can figure it out." "Are you thinking clearly?" "Are you sure you're not a $sizes $idiot?" "By reading the documentation, of course."
|
||||
@ -575,33 +600,34 @@ hush text 1 pragma_ 1258843946 1 pragma_ /me blushes and goes quiet for now.
|
||||
i2a text 1 Baughn_ 1198330021 3 Baughn Introduction to Algorithms - http://highered.mcgraw-hill.com/sites/0070131511/
|
||||
ia text 1 pragma_ 1174590993 87 pragma_ /say Your inner animal is a $sizes $animal_nouns $animals, $args.
|
||||
idb text 1 Auris- 1211031479 5 kate` implementation dependent behaviour. This must be documented by the implementation.
|
||||
ide text 1 kate` 1243937849 2 mayrllr /say See http://iso-9899.info/wiki/IDE
|
||||
ide text 1 pragma_ 1268466837 0 nobody http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments
|
||||
idiot text 1 pragma_ 1194139898 6 mordy_ moron knucklehead dolt half-wit retard idiot chowderhead
|
||||
if text 1 Major-Willard 1105258377 9 tommorris the keyword that tests a bracketed expression and if true, executes the following statement or block; if the expression evaluates to false an optional ''else'' clause is executed
|
||||
if text 1 Major-Willard 1105258377 10 M1TE5H the keyword that tests a bracketed expression and if true, executes the following statement or block; if the expression evaluates to false an optional ''else'' clause is executed
|
||||
ignore text 1 snhmib 1204687457 0 nobody nubsauce
|
||||
implementation text 1 pragma_ 1106459085 1 pragma_ a particular set of software, running in a particular translation environment under particular control options, that performs translation of programs for, and supports execution of functions in, a particular execution environment (ISO/IEC 9899:1999 3.12)
|
||||
insult module 1 pragma_ 1236819209 279 veda insult.pl
|
||||
int text 1 infobahn 1104595147 15 tdmackey a signed integer data type, at least 16 bits wide, which must be able to represent (at least) all the numbers in the range -32767 to +32767. Its lowest value, INT_MIN, and highest value, INT_MAX, are defined in <limits.h>
|
||||
insult module 1 pragma_ 1236819209 349 pragma_ insult.pl
|
||||
int text 1 infobahn 1104595147 17 n00p a signed integer data type, at least 16 bits wide, which must be able to represent (at least) all the numbers in the range -32767 to +32767. Its lowest value, INT_MIN, and highest value, INT_MAX, are defined in <limits.h>
|
||||
integer text 1 prec 1189048945 2 cousteau http://wikipedia.org/wiki/Integer
|
||||
intelmanuals text 1 ColonelJ 1260039944 0 nobody http://developer.intel.com/products/processor/manuals/index.htm
|
||||
intmath text 1 PoppaVic 1185805964 2 PoppaVic http://www2.hursley.ibm.com/decimal/decifaq1.html
|
||||
iodine text 1 snhmib 1177134210 2 snhmib /me is abused by iodine
|
||||
ipc text 1 twkm 1104609621 6 cousteau /say IPC is Inter-Process Communication. A nice tutorial for UNIX is at http://www.ecst.csuchico.edu/~beej/guide/ipc/
|
||||
isospec text 1 pragma_ 1192736447 2 lemonadedrink /call standard
|
||||
it text 1 RuralHack 1254141732 4 RuralHack beyond true
|
||||
it text 1 RuralHack 1254141732 6 xvit beyond true
|
||||
it\sworks regex 1 pragma_ 1231373738 0 nobody works
|
||||
itworks text 1 pragma_ 1231373861 3 deathanatos /call works
|
||||
j text 1 pragma_ 1231207092 2 paxcoder /call doesntwork
|
||||
j text 1 pragma_ 1231207092 3 tolkad /call doesntwork
|
||||
javabad text 1 Baughn_ 1199480034 0 nobody /call size
|
||||
jekle text 1 pragma_ 1257669023 3 pragma_ /say Warning: Dr|Jekle is full of moronic nonsensical illogical gibberish babble.
|
||||
joeyadams text 1 joeyadams 1249675948 5 joeyadams a noob who doesn't know what he's talking about. He thinks an array and a pointer are the same thing.
|
||||
jj text 1 tolkad 1264735824 2 tolkad jj
|
||||
joeyadams text 1 joeyadams 1249675948 6 pragma_ a noob who doesn't know what he's talking about. He thinks an array and a pointer are the same thing.
|
||||
jonbryan text 1 jonbryan 1106453242 0 nobody a 1337 h4x0r
|
||||
jseamus text 1 pragma_ 1259024447 1 PARLIAMENT obsessed with finding his identity.
|
||||
jump text 1 kp 1194414478 1 kp /me jumps out the window
|
||||
k&r text 1 Chris 1243951633 279 Arimoto /say K&R is The C Programming Language, 2nd edition, by Kernighan and Ritchie, http://cm.bell-labs.com/cm/cs/cbook/ - be sure to see the errata as well, at http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html
|
||||
k&r2 text 1 pragma_ 1198032355 28 bone /call k&r
|
||||
k&r text 1 Chris 1243951633 405 Dianora /say K&R is The C Programming Language, 2nd edition, by Kernighan and Ritchie, http://cm.bell-labs.com/cm/cs/cbook/ - be sure to see the errata as well, at http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html
|
||||
k&r2 text 1 pragma_ 1198032355 33 pragma_ /call k&r
|
||||
kate text 1 kate` 1177134347 9 kate` fond of enums
|
||||
kate` text 1 Baughn 1177655583 4 kate` Lasagnasian
|
||||
kate` text 1 Baughn 1177655583 6 pragma_ Lasagnasian
|
||||
kernelnewbies text 1 noselasd 1107807003 0 nobody #kernelnewbies at irc.kernelnewbies.org (or irc.oftc.net).
|
||||
kickass text 1 andy 1208762874 3 andy /me kicks $args's ass with a $weapon
|
||||
kill text 1 PARLIAMENT 1258609384 4 pZombie /me kills $args
|
||||
@ -611,50 +637,58 @@ lart text 1 vorpal 1208660815 28 snhmib /me makes an attitude adjustment upside
|
||||
lart_tool text 1 vorpal 1208660856 0 nobody 2x4 knobkerry AK-47 flamethrower "tactical nuclear weapon"
|
||||
later text 1 pragma_ 1193167299 1 cloudowind /call bye
|
||||
latest text 1 pragma_ 1194642834 16 maikol /call top20 recent
|
||||
learn21days text 1 pragma_ 1268317654 0 nobody http://abstrusegoose.com/249
|
||||
learning text 1 pragma_ 1108007774 8 appletizer /say Most beginners are just trying to learn C. Try not to question their "silly" methods and please try to provide the answer to the question they are asking. They will learn better tricks as they gain more experience. One cannot expect someone to instantly know the _best_ way to write 'foo'. You were a beginner once; only by persistence did you learn more efficient methods. Try not redicule the beginners.
|
||||
lf text 1 pragma_ 1195072615 0 nobody /call double
|
||||
libpack text 1 PoppaVic 1200500816 56 LeoNerd http://www.leonerd.org.uk/code/libpack
|
||||
libpack text 1 PoppaVic 1200500816 63 PoppaVic http://www.leonerd.org.uk/code/libpack
|
||||
lidapin text 1 kate` 1268386194 1 kate` /say Vill du bli fin, får du lida pin.
|
||||
limits text 1 PoppaVic 1193015678 1 PoppaVic http://www.landercasper.com/sounds.html#stayhere search for "limits"
|
||||
line text 1 prec 1106779283 0 nobody a sequence of characters terminated by a newline sequence ('\n' in C, CRLF in various Internet protocols).
|
||||
linkage text 1 kate` 1221600538 5 Wulf_ /call linkageandstorage
|
||||
linkageandstorage text 1 kate` 1221600612 3 Wulf_ /say http://www.iso-9899.info/wiki/LinkageAndStorage
|
||||
literal text 1 pragma_ 1179678945 6 cin /call show
|
||||
literal text 1 pragma_ 1179678945 7 kuala /call show
|
||||
little text 1 Pip 1250423849 0 nobody horny
|
||||
lol text 1 syntropy_ 1254011046 7 pragma_ /say hello
|
||||
long text 1 infobahn 1104595499 4 appletizer a signed integer data type, at least 32 bits wide, which must be able to represent (at least) all the integers in the range -2147483647 to +2147483647. Its lowest value, LONG_MIN, and highest value, LONG_MAX, are defined in <limits.h>
|
||||
livelife text 1 PARLIAMENT 1264393732 2 PARLIAMENT /say $sfq
|
||||
lol text 1 syntropy_ 1254011046 12 tuxedomask /say hello
|
||||
long text 1 infobahn 1104595499 7 bros a signed integer data type, at least 32 bits wide, which must be able to represent (at least) all the integers in the range -2147483647 to +2147483647. Its lowest value, LONG_MIN, and highest value, LONG_MAX, are defined in <limits.h>
|
||||
look\sup\s([^\s]+) regex 1 pragma_ 1194261643 0 nobody man $1
|
||||
lsb text 1 PoppaVic 1182000690 4 lemonade` http://refspecs.freestandards.org/LSB_2.1.0/LSB-generic/LSB-generic/book1.html
|
||||
luke text 1 PoppaVic 1180621290 6 PoppaVic http://www.destgulch.com/movies/luke/luke18.wav
|
||||
lvalue text 1 Wulf_ 1251745741 2 Wulf_ expression with an object type or an incomplete type other than void
|
||||
lysator text 1 twkm 1104460803 0 nobody http://www.lysator.liu.se/c/
|
||||
magic text 1 pragma_ 1196992954 9 Saparok /me dances, magic, dance!
|
||||
main text 1 twkm 1104231974 68 snhmib int main(int argc, char *argv[]); or int main(int argc, char **argv); or int main(void); See also ''argc'' and ''argv''; the standard entry point to C programs
|
||||
main text 1 twkm 1104231974 73 Wulf int main(int argc, char *argv[]); or int main(int argc, char **argv); or int main(void); See also ''argc'' and ''argv''; the standard entry point to C programs
|
||||
mainloop_io text 1 PoppaVic 1181404512 7 PoppaVic http://www.linuxjournal.com/article/8545
|
||||
make text 1 pragma_ 1194222985 12 jseamus /say make: *** Don't know how to make `$args'. Stop.
|
||||
makemyday text 1 PoppaVic 1193015778 1 PoppaVic http://www.landercasper.com/sounds.html#stayhere search for "go ahead"
|
||||
malloc\s+usage(.*) regex 1 pragma_ 1195076472 0 nobody mallocusage
|
||||
mallocusage text 1 Cin 1194839770 17 pragma_ http://img441.imageshack.us/img441/6170/1194822657592cv0.jpg
|
||||
man module 1 pragma_ 1107137901 903 ColonelJ man.pl
|
||||
man module 1 pragma_ 1107137901 926 pragma_ man.pl
|
||||
manpage text 1 themathkid 1204078264 6 lemonade` /say Read the manual.
|
||||
manual text 1 pragma_ 1199758660 2 cousteau /me $attacks $args $rtfm_smack the $body_part with a $sizes $colors manual.
|
||||
map module 1 pragma_ 1106888208 12 cousteau map.pl
|
||||
map module 1 pragma_ 1106888208 14 gunninK map.pl
|
||||
marco text 1 Wulf_ 1261090941 3 pragma_ /say polo!
|
||||
massive text 1 bit` 1194858785 0 nobody kinder than saying fat ;)
|
||||
math module 1 pragma_ 1105953711 256 pragma_ math.pl
|
||||
me text 1 pragma_ 1109820558 16 PARLIAMENT /me $args
|
||||
math module 1 pragma_ 1105953711 276 pragma_ math.pl
|
||||
me text 1 pragma_ 1109820558 17 xuser /me $args
|
||||
meat text 1 pragma_ 1260485203 0 nobody http://baetzler.de/humor/meat_beings.html -- What aliens would say if they discovered Earth
|
||||
mem text 1 prec 1104399754 6 Saparok a reserved function identifier prefix when followed by a lowercase letter
|
||||
meme text 1 syntropy 1254003170 20 pragma_ /say $adjective troll is $adjective.
|
||||
mind text 1 pepper^ 1108585995 a terrible thing to waste
|
||||
mitletter text 1 pragma_ 1251212390 1 pragma_ http://www.c4vct.com/kym/humor/mitlettr.htm
|
||||
mmg0 text 1 kp 1194414402 1 pragma_ a doody head
|
||||
modules text 1 pragma_ 1192736662 4 pragma_ /call list modules
|
||||
msg text 1 pragma_ 1109820572 25 pragma_ /msg $args
|
||||
mother text 1 PARLIAMENT 1267843728 3 PARLIAMENT /say MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER MOTHER
|
||||
msg text 1 pragma_ 1109820572 30 pbot3 /msg $args
|
||||
murphy text 1 pragma_ 1191356935 2 pragma_ /say If there's more than one possible outcome of a job or task, and one of those outcomes will result in disaster or an undesirable consequence, then somebody will do it that way.
|
||||
nak text 1 joeyadams 1256592064 1 joeyadams someone who doesn't know candide commands. Ha ha!
|
||||
necrophile text 1 kp 1194246813 3 kp /me plays dead
|
||||
nelemof text 1 prec 1108151345 2 pragma_ a standard idiom for computing the number of elements in an array variable: #define nelemof(array) (sizeof array/sizeof *array)
|
||||
never text 1 syntropy 1249676626 1 syntropy /say http://bit.ly/2KsmMm
|
||||
nickreg text 1 pragma_ 1267639456 1 pragma_ /say In order to speak in this channel, you must register your IRC nick-name through NickServ. See `/msg nickserv help register` or follow the guide at http://www.wikihow.com/Register-a-User-Name-on-Freenode
|
||||
ninjaescapde text 1 pragma_ 1197786816 1 pragma_ pragma_
|
||||
nobook text 1 Baughn 1186245248 6 bone /say If you don't have a book then you are wasting your time and ours. The only good way to learn C or C++ is throuhg a book. If you are too cheap to buy a book then just give up and learn something else that doesn't require a book. In eithercase, go away until you have a book.
|
||||
noaids text 1 PARLIAMENT 1264284537 1 PARLIAMENT "Whew, you lucked out" "The needle was clean!" "The fresh corpse was clean!" "The prosititute didn't have aids!" "The teddy bear was aids free." "The homeless bum didn't have aids!" "Your hands were aids-free that time." "$who_answers didn't have aids . . . yet!" "$who_answers is aids-free at this time."
|
||||
nobook text 1 Baughn 1186245248 8 PoppaVic /say If you don't have a book then you are wasting your time and ours. The only good way to learn C or C++ is throuhg a book. If you are too cheap to buy a book then just give up and learn something else that doesn't require a book. In eithercase, go away until you have a book.
|
||||
nopizza text 1 PoppaVic 1203283186 6 pragma_ /say If you spend less time with pitchers of beer, pizza, p0rn, sex and video games you will discover the manpages, docs, google, and testprograms.
|
||||
north text 1 pragma_ 1231873805 16 pragma_ /say $rpg_ans
|
||||
northeast text 1 pragma_ 1231873992 6 Wulf_ /say $rpg_ans
|
||||
@ -662,50 +696,57 @@ northwest text 1 pragma_ 1231873986 5 pragma_ /say $rpg_ans
|
||||
notfound text 1 pragma_ 1194262141 2 pragma_ "What are you $talking about?" "Say what?" "Come again?" "Make sense much?"
|
||||
noun text 1 syntropy 1254003143 0 nobody troll
|
||||
nowandthen text 1 pragma_ 1254519322 0 nobody http://www.cheaphumor.com/nowandthen.html
|
||||
object text 1 Wulf_ 1240461189 9 Wulf_ region of data storage in the execution environment, the contents of which can represent values
|
||||
object text 1 Wulf_ 1240461189 10 Wulf_ region of data storage in the execution environment, the contents of which can represent values
|
||||
objectcgi text 1 pragma_ 1106001595 0 nobody See http://www.messners.com/objectcgi/objectcgi.html for a library to handle web CGI with C.
|
||||
objectsfirst text 1 PoppaVic 1182596754 1 appletizer http://www.oopweb.com/CPP/Documents/ObjectsFirst/Volume/CLP_ToC.html
|
||||
offtopic text 1 kp 1199181686 10 Gorgoroth my pants are going on a rapmage through a long island bowling alley
|
||||
ohshit text 1 PoppaVic 1203450520 4 cousteau http://www.drpaulcarter.com/cs/common-c-errors.html
|
||||
oi text 1 pragma_ 1268386560 0 nobody wtf
|
||||
one-true-solution text 1 Cin 1194548341 3 pragma_ /me commits seppuku
|
||||
onedim text 1 pragma_ 1258771422 0 nobody http://www.marcuse.org/herbert/pubs/64onedim/odmcontents.html
|
||||
onlinek&r2 text 1 LordOllie 1175854606 20 lemonade` If you cannot will not buy k&r2 go here at least, then quit pissing and moaning. http://publications.gbdirect.co.uk/c_book/
|
||||
onlinek&r2 text 1 LordOllie 1175854606 25 kuala If you cannot will not buy k&r2 go here at least, then quit pissing and moaning. http://publications.gbdirect.co.uk/c_book/
|
||||
oopbad text 1 Baughn 1190225745 2 PoppaVic http://www.geocities.com/tablizer/oopbad.htm
|
||||
options text 1 PoppaVic 1185471587 1 PoppaVic /me points accusingly at $args, "What are your CLI options?!"
|
||||
orbitz text 1 Cin 1194840323 7 spv http://img69.imageshack.us/img69/6370/orbitzkeyboardtx3.jpg
|
||||
orbitz text 1 Cin 1194840323 10 pragma_ http://img69.imageshack.us/img69/6370/orbitzkeyboardtx3.jpg
|
||||
order text 1 gamag 1198331081 0 nobody SICP -> I2A -> TAOCP -> APUE
|
||||
ordermatters text 1 PoppaVic 1266709336 2 PoppaVic /call compilerline
|
||||
oreo text 1 pragma_ 1108081475 10 pragma_ /say Considering your ineptitude and lack of formulating pointed questions, these people have actually wasted more time attempting to assist you than you deserve. I suggest you copy the answers they are giving you and take a break to review them later when you are of a more calm disposition. Obviously you are too upset or frustrated to think straight. Go have an oreo.
|
||||
pZombie text 1 pragma_ 1258884496 8 TheDankKnight a moron incapable of logic who hasn't taken any computer science or electrical engineering classes and therefore holds mystical beliefs about what is possible with robots and simulations, constantly fabricating ridiculous laughable experiments.
|
||||
owner text 1 umopepisdn` 1260340966 1 umopepisdn` /say upsidedown is my owner.
|
||||
pZombie text 1 pragma_ 1258884496 9 pragma_ a moron incapable of logic who hasn't taken any computer science or electrical engineering classes and therefore holds mystical beliefs about what is possible with robots and simulations, constantly fabricating ridiculous laughable experiments.
|
||||
pant_status text 1 pragma_ 1173823726 0 nobody off on crotchless "around ankles" "showing butt-crack"
|
||||
pants text 1 pragma_ 1189873025 10 pragma_ /say Pants status: $pant_status
|
||||
parsing text 1 PoppaVic 1208718021 1 PoppaVic http://www.ddj.com/cpp/196603535
|
||||
pass-by-reference text 1 pragma_ 1210056353 3 PoppaVic http://www.techlists.org/archives/programming/pythonlist/2007-07/msg01786.shtml
|
||||
pass-by-value text 1 pragma_ 1210056370 1 pragma_ /call pass-by-reference
|
||||
paste text 1 PoppaVic 1247850332 29 Wulf_ /say Paste code/errors to http://codepad.org
|
||||
pastebin text 1 pragma_ 1193081655 39 pshr /call paste
|
||||
paste text 1 PoppaVic 1247850332 40 zen_ /say Paste code/errors to http://codepad.org
|
||||
pastebin text 1 pragma_ 1193081655 48 zen_ /call paste
|
||||
pastebin.com text 1 Jafet 1216238716 1 pragma_ /say pastebin.com and similar pastebins have ugly colour contrast, hard-to-read fonts, and insert pesky line numbers into the clipboard. Please use a better pastebin, like http://rafb.net/paste.
|
||||
patterns text 1 Baughn_ 1199480016 2 pragma_ /call size
|
||||
pcl text 1 PoppaVic 1180881036 0 nobody http://xmailserver.org/libpcl.html
|
||||
peril text 1 twkm 1104460665 0 nobody http://www.pldaniels.com/c-of-peril/
|
||||
pftgu text 1 pragma_ 1209194984 0 nobody http://programminggroundup.blogspot.com/2007/01/programming-from-ground-up.html
|
||||
phil31 text 1 pragma_ 1258966138 0 nobody http://philosophy.ucsd.edu/faculty/dbrink/courses/31-05/
|
||||
php text 1 pragma_ 1189574536 3 SlashLife /say Seen in ##PHP: "Man, I forgot how to use strtok. The last time I used it was years ago in mIRC."
|
||||
php text 1 pragma_ 1189574536 4 pragma_ /say Seen in ##PHP: "Man, I forgot how to use strtok. The last time I used it was years ago in mIRC."
|
||||
pi text 1 kate` 1245253689 1 kate` 3
|
||||
ping text 1 pragma_ 1109821018 16 Wulf_ /say pong
|
||||
pizza text 1 PoppaVic 1203282137 3 vorpal a tasty food substance, which is usually best when accompanied by beer. see also: !beer
|
||||
pie text 1 tolkad 1264735589 4 tolkad Oort: candide | pie
|
||||
ping text 1 pragma_ 1109821018 28 bgmerrell /say pong
|
||||
pizza text 1 PoppaVic 1203282137 4 tolkad a tasty food substance, which is usually best when accompanied by beer. see also: !beer
|
||||
pizza_milkshake text 1 pizza_milkshake 1106981227 0 nobody half man, half pizza. www.parseerror.com/pizza.jpg
|
||||
plz text 1 Draconx 1187652483 18 Draconx|Laptop /say Please do not abbreviate 'please', 'thanks' or 'sorry'. It makes you look as though you don't really care. See http://lumpio.no-ip.com/dont-use-thx-sry-plz.txt
|
||||
pizzatest text 1 tolkad 1261813809 1 tolkad delicious
|
||||
plz text 1 Draconx 1187652483 19 pragma_ /say Please do not abbreviate 'please', 'thanks' or 'sorry'. It makes you look as though you don't really care. See http://lumpio.no-ip.com/dont-use-thx-sry-plz.txt
|
||||
pointerfun text 1 Baughn 1206989366 9 lemonade`_ /call binky
|
||||
pointerops text 1 pragma_ 1195411991 5 kate` /say The * operator makes an object from a pointer value. The & operator makes a pointer value from an object.
|
||||
pointers text 1 pragma_ 1107379418 94 jimi_ http://pw2.netcom.com/~tjensen/ptr/cpoint.htm and http://c-faq.com/ptrs/index.html
|
||||
pointers text 1 pragma_ 1107379418 106 n00p http://pw2.netcom.com/~tjensen/ptr/cpoint.htm and http://c-faq.com/ptrs/index.html
|
||||
portability text 1 n00p 1263936716 1 n00p very important: http://clc-wiki.net/wiki/C_community:comp.lang.c:Portability_attitude
|
||||
portable text 1 KernelJ 1260142236 0 nobody C
|
||||
portal text 1 pragma_ 1194469348 0 nobody http://portal.wecreatestuff.com/
|
||||
posix text 1 pragma_ 1179496311 13 HughJass /say The Open Group Base Specifications Issue 6: http://www.opengroup.org/onlinepubs/009695399/
|
||||
pounding-a-nail text 1 prec 1189284983 1 Saparok http://weblogs.asp.net/alex_papadimoulis/archive/2005/05/25/408925.aspx
|
||||
pragma_ text 1 pragma_ 1260929953 12 pragma_ too smart and too fast for you.
|
||||
prec text 1 pragma_ 1107502825 4 typename very FRUITY
|
||||
predef text 1 Auris- 1191766349 5 lemonade` http://predef.sourceforge.net/ -- the Pre-defined C/C++ Compiler Macros project
|
||||
predef text 1 Auris- 1191766349 7 PoppaVic http://predef.sourceforge.net/ -- the Pre-defined C/C++ Compiler Macros project
|
||||
prefix text 1 PoppaVic 1187194689 2 lemonade` searching for prefix-substrings suggest: http://en.wikipedia.org/wiki/Trie and http://en.wikipedia.org/wiki/Judy_array
|
||||
prepared text 1 pragma_ 1175464588 12 lemonade` /say If you're working on this, you really shouldn't be asking C questions. All your C questions should have been answered years ago or you probably aren't ready/prepared for this project.
|
||||
prepared text 1 pragma_ 1175464588 13 pragma_ /say If you're working on this, you really shouldn't be asking C questions. All your C questions should have been answered years ago or you probably aren't ready/prepared for this project.
|
||||
preprocessor text 1 NeverDream 1109792251 1 kollo15 an application that processes code before compilation/execution.
|
||||
process text 1 pragma_ 1180197626 3 pragma_ /call projectprocess
|
||||
projectprocess text 1 pragma_ 1180197615 3 pragma_ http://www.projectcartoon.com/cartoon/644
|
||||
@ -716,14 +757,16 @@ qsort text 1 twkm 1104399031 2 Sepero sort an array of data, #include <stdlib.h>
|
||||
question text 1 joeyadams 1250110634 1 Dianora /say Don't ask to ask, just ask.
|
||||
question_type text 1 pragma_ 1195012266 1 kate` pointless interesting fascinating profound clueless uninteresting boring childish clever tricky
|
||||
questions text 1 pragma_ 1258590235 0 nobody http://www.roangelo.net/logwitt/logwit12.html
|
||||
quote text 1 pragma_ 1258699991 1283 Nick_Patterson /call topic
|
||||
quotehelp text 1 pragma_ 1258776165 7 pragma_ /say If you use !quote without arguments, it returns a random quote; if you use it with an argument, it searches for quotes containing that text; if you add --author <name> at the end, it searches for a quote by that author; if you specify text and --author, it searches for quotes by that author, containing that text.
|
||||
quote text 1 pragma_ 1258699991 1763 SailorReality /call topic
|
||||
quotegrabs text 1 pragma_ 1260876948 15 pragma_ /say For quotegrab commands: http://www.iso-9899.info/wiki/Candide#Quotegrabs -- For a table of grabbed quotes: http://blackshell.com/~msmud/candide/quotegrabs.html
|
||||
quotehelp text 1 pragma_ 1258776165 11 pragma_ /say If you use !quote without arguments, it returns a random quote; if you use it with an argument, it searches for quotes containing that text; if you add --author <name> at the end, it searches for a quote by that author; if you specify text and --author, it searches for quotes by that author, containing that text.
|
||||
rafb text 1 pragma_ 1194140597 72 pragma_ /call paste
|
||||
rand text 1 twkm 1104397431 4 beta2k pseudo-random number generator, #include <stdlib.h>, int rand(void); returns the next number in the sequence in the range [0,RAND_MAX], see http://www.iso-9899.info/man?rand; a *printf format specifier which converts its signed int argument to decimal representation; a *scanf format specifier which parses a decimal representation to its int* argument; test
|
||||
rationale text 1 umopepisdn` 1266015713 1 umopepisdn` /say Draft ANSI C Rationale: http://www.scribd.com/doc/16306895/Draft-ANSI-C-Rationale
|
||||
raw_ping text 1 pragma_ 1203042361 1 pragma_ http://courses.cs.vt.edu/~cs4254/fall04/slides/raw_1.pdf
|
||||
reaction text 1 pragma_ 1194383902 0 nobody "If you say so." "Why, thanks." "Are you sure about that?" "YES!" "Mission accomplished."
|
||||
reading text 1 fax 1188437684 12 kate` /say READING HURTS
|
||||
realloc text 1 Chris 1254955396 6 c_sphere http://www.iso-9899.info/wiki/Why_not_realloc
|
||||
realloc text 1 Chris 1254955396 10 apples` http://www.iso-9899.info/wiki/Why_not_realloc
|
||||
reason text 1 pragma_ 1242245702 1 pragma_ /call excuse
|
||||
reason\sfor regex 1 pragma_ 1236819909 0 nobody excuse
|
||||
rebirth text 1 pragma_ 1258831285 0 nobody http://www.theravada.gr/rebirth.html
|
||||
@ -735,14 +778,15 @@ reference text 1 twkm 1104460727 29 lemonade` http://www.acm.uiuc.edu/webmonkeys
|
||||
referencedtype text 1 pragma_ 1107989463 2 lemonade` "a pointer type may be derived from a function type, an object type, or an incomplete type, called the referenced type. A pointer type describes an object whose value provides a reference to an entity of the referenced type. A pointer type derived from the referenced type T is sometimes called ``pointer to T''. The construction of a pointer type from a referenced type is called ``pointer type derivation''."
|
||||
references text 1 pragma_ 1108087719 3 pragma_ C does not have pass-by-reference or "heavy" references like C++ or some other languages do. C does have a definition of references that is probably not what you want or need to know about, see: !referencedtype
|
||||
regexp text 1 pragma_ 1205423735 3 PoppaVic http://swtch.com/~rsc/regexp/regexp1.html
|
||||
register text 1 pragma_ 1107636580 3 syntropy_ a storage-class specifier for an object that suggests that access for the object be as fast as possible. The extent to which the suggestion is effective is implementation defined. Whether or not addressable storage is actually used, the address of any part of an object declared with storage-class specifier register cannot be computed.
|
||||
register text 1 pragma_ 1107636580 6 pragma_ a storage-class specifier for an object that suggests that access for the object be as fast as possible. The extent to which the suggestion is effective is implementation defined. Whether or not addressable storage is actually used, the address of any part of an object declared with storage-class specifier register cannot be computed.
|
||||
religion text 1 Baughn 1202935690 0 nobody http://www.iso-9899.info/wiki/Religion
|
||||
resistance text 1 kp 1195527445 0 nobody futile.
|
||||
resources text 1 pragma_ 1106813548 17 KucukMubasir http://www.cognitiveprocess.com/~rjh/prg/portable/c/resources.html - http://www.iso-9899.info/wiki/Web_resources - http://www.iso-9899.info/wiki/Books - See also: reference
|
||||
restrict text 1 twkm 1105427254 6 syntropy_ a type qualifier, which may only be used with a pointer type, and which requires that objects referenced through such a pointer must be made through a single pointer value, i.e., no aliases / pointers into other parts of the object are allowed
|
||||
retort text 1 snhmib 1237170413 2 snhmib /call excuse
|
||||
roulette text 1 pragma_ 1254874530 23 Sailormoon /say $roulette_outcome
|
||||
roulette_outcome text 1 pragma_ 1254874748 0 nobody *click* *click* *BANG!*
|
||||
ring text 1 PoppaVic 1261459739 1 Chris Ring Buffer: http://elonen.iki.fi/code/misc-notes/ringbuffer/index.html .. http://www.koders.com/c/fidE43A8C8CBC09B7DEB0FDDC0C0A28767D98534A02.aspx?s=mp3
|
||||
roulette text 1 pragma_ 1254874530 140 notk0 /say $roulette_outcome
|
||||
roulette_outcome text 1 pragma_ 1254874748 0 nobody *click* *click* *click* *click* *BANG!*
|
||||
rpg_ans text 1 pragma_ 1231873892 0 nobody "You are standing $rpg_location. You see a $sizes $rpg_location2 to the $rpg_direction." "You have been killed by a $sizes $animals! R.I.P."
|
||||
rpg_direction text 1 pragma_ 1231873524 0 nobody north east south west southwest northwest northeast southeast
|
||||
rpg_distance text 1 pragma_ 1231873429 0 nobody "near" "close to" "next to" "in"
|
||||
@ -750,143 +794,151 @@ rpg_location text 1 pragma_ 1231873398 3 snhmib "$rpg_distance a $sizes $rpg_loc
|
||||
rpg_location2 text 1 pragma_ 1231873954 1 snhmib city castle headshop village "bath house"
|
||||
rq text 1 orbitz 1234617864 10 bone random quote in ##c++
|
||||
rtfb text 1 PoppaVic 1192833517 9 lemonade` /say Read the @#&ing Book - Your primary guide for learning C should be a good book (see http://www.iso-9899.info/wiki/Books). You must not expect to become a proficient C programmer just from reading crappy online `tuts', staring at other people's code, and/or boring us to death by asking dozens of exceedingly trivial questions.
|
||||
rtfm text 1 pragma_ 1199758774 29 Gorgoroth /say Please find and read the documentation for that.
|
||||
rtfm text 1 pragma_ 1199758774 31 Wulf_ /say Please find and read the documentation for that.
|
||||
rtfm_smack text 1 pragma_ 1109185551 0 nobody upside across about over
|
||||
ruby text 1 RuralHack 1254141633 0 nobody better
|
||||
rule1 text 1 PoppaVic 1106163701 1 Koper "First, make it run"
|
||||
rule2 text 1 PoppaVic 1106163779 1 Koper "Then, make it run right"
|
||||
rule3 text 1 PoppaVic 1106163837 3 Koper "Finally, make it run fast or small (pick one)" [This is where you'd profile]
|
||||
rules text 1 gunninK 1264177779 2 gunninK $nick rules
|
||||
rvalue text 1 Wulf_ 1251745571 1 Wulf_ the "value of an expression"
|
||||
s&w text 1 ment 1251220163 1 ment when k&r fails, try http://www.smith-wesson.com/
|
||||
say text 1 pragma_ 1251663502 198 TheDankKnight /say $args
|
||||
scanf text 1 Major-Willard 1106970012 232 Wulf_ a function that's stupid - "It's nearly impossible to do decent error recovery with scanf; usually it's far easier to read entire lines (with fgets or the like), then interpret them, either using sscanf or some other techniques." - See http://www.eskimo.com/~scs/C-faq/q12.20.html
|
||||
schildt text 1 twkm 1105514020 12 Wulf_ please avoid herbert schildt's books, see http://www.iso-9899.info/wiki/Main_Page#Stuff_that_should_be_avoided
|
||||
say text 1 pragma_ 1251663502 299 candide /say $args
|
||||
scanf text 1 Major-Willard 1106970012 271 Dianora a function that's stupid - "It's nearly impossible to do decent error recovery with scanf; usually it's far easier to read entire lines (with fgets or the like), then interpret them, either using sscanf or some other techniques." - See http://www.eskimo.com/~scs/C-faq/q12.20.html
|
||||
scanf_is_stupid text 1 n00p 1264982172 1 pragma_ /say It looks like the !scanf factoid was unsuccessful at convincing you not to use scanf(). scanf() isn't really that stupid, providing you know how to use it correctly. Chris Torek explains some problems with the way scanf() is commonly used and provides methods of solving those problems here: http://bytes.com/topic/c/answers/215517-warning-against-scanf#post840862
|
||||
schildt text 1 twkm 1105514020 13 pragma_ please avoid herbert schildt's books, see http://www.iso-9899.info/wiki/Main_Page#Stuff_that_should_be_avoided
|
||||
sd text 1 pragma_ 1199480765 2 seand /call doesntcare
|
||||
seed text 1 kate` 1201872769 0 nobody http://www.stanford.edu/~blp/writings/clc/random-seed.html
|
||||
seen text 1 Jafag 1215709237 19 syntropy|desktop /say $nick: /msg nickserv info $args
|
||||
seen text 1 Jafag 1215709237 27 jwillia3 /say $nick: /msg nickserv info $args
|
||||
segfault text 1 prec 1106351158 1 vasco http://www.iso-9899.info/wiki/Segfault
|
||||
seqpoint text 1 igli 1212874512 0 nobody http://c-faq.com/expr/seqpoints.html
|
||||
serialize text 1 PoppaVic 1253615105 1 PoppaVic to convert data, arrays, structures, and lists from host-format into a portable, network-format and reconverting from that agnostic form into the same or another host-format. See: http://en.wikipedia.org/wiki/Serialization , http://tpl.sourceforge.net and http://www.leonerd.org.uk/code/libpack
|
||||
sequencepoint text 1 Wulf_ 1263575275 0 nobody Evaluation of an expression may produce side effects. At certain specified points in the execution sequence called sequence points, all side effects of previous evaluations shall be complete and no side effects of subsequent evaluations shall have taken place.
|
||||
serialize text 1 PoppaVic 1266811304 1 xuser packing structures, usually portably for later extraction: see man 3 xdr as well as http://tpl.sourceforge.net/ and http://www.leonerd.org.uk/code/libpack/
|
||||
severity text 1 pragma_ 1195012218 0 nobody very slighty moderately profoundly blatantly absolutely
|
||||
sex text 1 pragma_ 1243974321 4 lemonade` /say Sex is allowed in ##C++ only on weekdays starting with 'T'.
|
||||
shoot text 1 pragma_ 1109021460 139 pragma_ /me $weapon_action her $weapon and $shoot_action $args's $body_part.
|
||||
sfq text 1 PARLIAMENT 1264393741 0 nobody success fail
|
||||
shoot text 1 pragma_ 1109021460 141 notk0 /me $weapon_action her $weapon and $shoot_action $args's $body_part.
|
||||
shoot_action text 1 pragma_ 1109021600 2 pragma_ "blows away" "shoots off" "shoots holes in" "takes off" "blows off" blasts "blasts off" "blasts through" "shoots through"
|
||||
short text 1 infobahn 1104595429 2 pshr_ a signed integer data type, at least 16 bits wide, which must be able to represent (at least) all the numbers in the range -32767 to +32767. Its lowest value, SHRT_MIN, and highest value, SHRT_MAX, are defined in <limits.h>
|
||||
should text 1 pragma_ 1258762922 11 pragma_ /call advice
|
||||
short text 1 infobahn 1104595429 3 n00p a signed integer data type, at least 16 bits wide, which must be able to represent (at least) all the numbers in the range -32767 to +32767. Its lowest value, SHRT_MIN, and highest value, SHRT_MAX, are defined in <limits.h>
|
||||
should text 1 pragma_ 1258762922 12 arubin /call advice
|
||||
shouldn?'?t?\s(.*) regex 1 pragma_ 1195010837 0 nobody 8ball
|
||||
sicp text 1 pizza_ 1191901455 41 snhmib "Structure and Interpretation of Computer Programs", http://mitpress.mit.edu/sicp/
|
||||
show text 1 tolkad 1264736132 0 nobody oort
|
||||
sicp text 1 pizza_ 1191901455 42 kate` "Structure and Interpretation of Computer Programs", http://mitpress.mit.edu/sicp/
|
||||
sicp+ text 1 snhmib 1198816281 5 spv http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/
|
||||
sitestats text 1 twkm 1104462371 1 pragma_ http://www.iso-9899.info/webstats/
|
||||
size text 1 Baughn_ 1199479944 5 pragma_ http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html
|
||||
size_t text 1 prec 1107760223 8 Wulf4 an unsigned integer type which is the result type of the sizeof operator. A size_t variable can store the size of any object. C90: printf("%lu\n", (unsigned long)sizeof a); C99: printf("%zu\n", sizeof a);
|
||||
sizeof text 1 prec 1108181591 11 Wulf_ an operator which yields the size, in bytes, of the expression or the parenthesized type given as its operand. The result type of the sizeof operator is size_t. See also size_t and byte.
|
||||
size_t text 1 prec 1107760223 11 s00p an unsigned integer type which is the result type of the sizeof operator. A size_t variable can store the size of any object. C90: printf("%lu\n", (unsigned long)sizeof a); C99: printf("%zu\n", sizeof a);
|
||||
sizeof text 1 prec 1108181591 13 Wulf_ an operator which yields the size, in bytes, of the expression or the parenthesized type given as its operand. The result type of the sizeof operator is size_t. See also size_t and byte.
|
||||
sizes text 1 pragma_ 1108931310 7 R0b0t1 large small tiny massive huge gigantic titanic teeny miniscule
|
||||
skapare text 1 pragma_ 1105953849 0 nobody Swedish for Creator, and he doesn't want you to bug him about it, anymore
|
||||
sky text 1 upd 1186181196 15 Irishmanluke /say The sky is $colors.
|
||||
slap text 1 pragma_ 1108932778 95 DavidC99 /me $attacks $args with a $sizes $animal_nouns $animals!
|
||||
slap text 1 pragma_ 1108932778 99 pragma_ /me $attacks $args with a $sizes $animal_nouns $animals!
|
||||
sleep text 1 pepper^ 1108585791 1 pepper^ waste of time
|
||||
smart text 1 pragma_ 1106519094 18 lemonade` /say See http://www.catb.org/~esr/faqs/smart-questions.html
|
||||
smart text 1 pragma_ 1106519094 19 kamol /say See http://www.catb.org/~esr/faqs/smart-questions.html
|
||||
smarties text 1 twkm 1104460794 0 nobody http://www.torek.net/torek/c/index.html
|
||||
snippets text 1 PoppaVic 1203783826 7 PoppaVic http://www.iso-9899.info/wiki/Snippets
|
||||
so text 1 lwells 1248293521 2 araujo not -1
|
||||
so text 1 lwells 1248293521 7 terabit not -1
|
||||
sometypes text 1 snhmib 1236414189 0 nobody "char a[1]" "char a[2]" "int a" "void a" "void* a[6]"
|
||||
song\sof\sthe\sday(.*) regex 1 pragma_ 1195076311 0 nobody say Anything cin isn't listening to!
|
||||
songoftheday text 1 Cin 1195012324 1 cin video killed the radio star
|
||||
sorting text 1 kate` 1249125597 0 nobody /say Sorting algorithm animations: http://www.sorting-algorithms.com/
|
||||
source text 1 pragma_ 1105954460 51 pragma_ /say candide's $sizes $animal_nouns $animals can be found at 'svn checkout http://pbot2-pl.googlecode.com/svn/trunk/'
|
||||
source text 1 pragma_ 1105954460 60 pragma_ /say candide's $sizes $animal_nouns $animals can be found at 'svn checkout http://pbot2-pl.googlecode.com/svn/trunk/'
|
||||
south text 1 pragma_ 1231873967 2 Spark /say $rpg_ans
|
||||
southeast text 1 pragma_ 1231873996 1 cousteau /say $rpg_ans
|
||||
southwest text 1 pragma_ 1231874001 2 Wulf_ /say $rpg_ans
|
||||
spiral text 1 Draconx|Laptop 1198028238 10 Draconx The "Clockwise/Spiral Rule" is a technique for understanding C declarations. See http://c-faq.com/decl/spiral.anderson.html
|
||||
sry text 1 Draconx 1187652590 4 chroos /call plz
|
||||
sscanf text 1 PoppaVic 1252155489 0 nobody a useful, (albeit slightly limited), function. Unlike it's idiot cousin scanf(3), sscanf(3) works explicity on strings.. Buffered strings. sscanf(3) likes to work with fgets(3) and both can play well with sprintf(3). Be advised that sscanf and sprintf are NOT perfectly reflective, and that fgets can fetch PART of a line. See the wiki aka 'home'.
|
||||
sscanf text 1 PoppaVic 1252155489 1 pragma_ a useful, (albeit slightly limited), function. Unlike it's idiot cousin scanf(3), sscanf(3) works explicity on strings.. Buffered strings. sscanf(3) likes to work with fgets(3) and both can play well with sprintf(3). Be advised that sscanf and sprintf are NOT perfectly reflective, and that fgets can fetch PART of a line. See the wiki aka 'home'.
|
||||
stack text 1 pragma_ 1209618274 6 lemonade`_ /say This factoid coming soon from OldWolfNZ!
|
||||
stack_machine text 1 PoppaVic 1182007038 2 pragma_ http://forth.sourceforge.net/ http://www.zetetics.com/bj/papers/moving1.htm http://www.albany.net/~hello/simple.htm http://www.ece.cmu.edu/~koopman/stack_computers/index.html http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm
|
||||
stacktrace text 1 pragma_ 1235765092 0 nobody http://www.tlug.org.za/wiki/index.php/Obtaining_a_stack_trace_in_C_upon_SIGSEGV
|
||||
standard text 1 kate` 1249578326 25 spv /say C99 + TC1,2,3 working paper: http://open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf - Quick C library reference: http://www.acm.uiuc.edu/webmonkeys/book/c_guide/ - An explanation of all C standards: http://clc-wiki.net/wiki/The_C_Standard
|
||||
static text 1 Major-Willard 1106976976 12 Wulf_ used if the function/variable is only used in one source file, at global scope, it should be declared as static; variables of this storage class are initialised to zero; variables of this storage class which are declared in functions maintain their value between calls to the function
|
||||
std text 1 Chris 1247743928 62 pragma_ /say C99 early draft: http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n843.pdf - C99 + TC 3 working paper: http://open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf - C1X 2009-03-01 draft: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1362.pdf - Quick C library reference: http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
|
||||
standard text 1 kate` 1249578326 35 umopepisdn` /say C99 + TC1,2,3 working paper: http://open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf - Quick C library reference: http://www.acm.uiuc.edu/webmonkeys/book/c_guide/ - An explanation of all C standards: http://clc-wiki.net/wiki/The_C_Standard - Draft ANSI C Rationale: http://www.scribd.com/doc/16306895/Draft-ANSI-C-Rationale
|
||||
static text 1 Major-Willard 1106976976 13 optraz used if the function/variable is only used in one source file, at global scope, it should be declared as static; variables of this storage class are initialised to zero; variables of this storage class which are declared in functions maintain their value between calls to the function
|
||||
std text 1 Chris 1247743928 111 Zen /say C99 early draft: http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n843.pdf - C99 + TC 3 working paper: http://open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf - C1X 2009-11-24 draft: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1425.pdf - Quick C library reference: http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
|
||||
std:: text 1 NeverDream 1108585411 2 pragma_ C++, not C. Try #c++
|
||||
stdarg text 1 prec 1104404716 2 pragma_ interfaces for handling variable argument lists; #include <stdarg.h>; void va_start(va_list ap, arg); void va_copy(va_list dest, va_list src); type va_arg(va_list ap, type); void va_end(va_list ap); see http://www.iso-9899.info/man?stdarg
|
||||
stderr text 1 Major-Willard 1104616252 0 nobody a FILE *, traditionally associated with file descriptor 2
|
||||
stdin text 1 Major-Willard 1104616182 16 Major-Willard a FILE *, traditionally associated with file descriptor 0, using fflush() with it is generally pointless
|
||||
stdinflush text 1 pragma_ 1193892288 15 pragma_ /say Will fflush(stdin) flush unread characters from the standard input stream? No! See http://www.c-faq.com/stdio/stdinflush.html and http://www.c-faq.com/stdio/stdinflush2.html
|
||||
stdinflush text 1 pragma_ 1193892288 19 pragma_ /say Will fflush(stdin) flush unread characters from the standard input stream? No! See http://www.c-faq.com/stdio/stdinflush.html and http://www.c-faq.com/stdio/stdinflush2.html
|
||||
stdout text 1 Major-Willard 1104616210 2 Major-Willard a FILE *, traditionally associated with file descriptor 1
|
||||
stfu text 1 pragma_ 1180052783 7 snhmib /say No, you stfu!
|
||||
stinkin-thinkin text 1 _pragma 1203669727 1 pragma_ http://psychcentral.com/lib/2006/the-top-10-types-of-stinkin-thinkin/
|
||||
stop text 1 joeyadams 1249676931 3 umopepisdn` /say If you do not stop it, I'm going to invoke my scary admin powers against you. You've been warned.
|
||||
storage text 1 kate` 1221600563 0 nobody /call linkageandstorage
|
||||
str text 1 prec 1104399552 4 pragma_ a reserved file-scope identifier prefix when followed by a lowercase letter
|
||||
string text 1 kate` 1179262366 33 Wulf_ a sequence of characters terminated by and including a null character ; http://www.iso-9899.info/wiki/String
|
||||
string text 1 kate` 1179262366 34 Wulf_ a sequence of characters terminated by and including a null character ; http://www.iso-9899.info/wiki/String
|
||||
strlen(s) text 1 banisterfiend 1224143962 0 nobody quite expressive
|
||||
strncpy text 1 pragma_ 1204705609 6 pragma_ http://c-faq.com/lib/strncpy.html and http://blogs.msdn.com/oldnewthing/archive/2005/01/07/348437.aspx
|
||||
strncpy text 1 pragma_ 1204705609 7 tp76 http://c-faq.com/lib/strncpy.html and http://blogs.msdn.com/oldnewthing/archive/2005/01/07/348437.aspx
|
||||
struct text 1 Major-Willard 1104886362 5 cousteau used to define an abstract data type containing other (possibly nested) data types
|
||||
stupid text 1 pragma_ 1194256622 27 Slat_Carf /say $args is a $sizes $idiot!
|
||||
stupid text 1 pragma_ 1194256622 28 autoclesius /say $args is a $sizes $idiot!
|
||||
sudo text 1 PoppaVic 1195562711 0 nobody http://aplawrence.com/cgi-bin/printer.pl?/Basics/sudo.html
|
||||
support text 1 prec 1108943444 16 pragma_ /say If you are looking for installation support for a particular piece of software, you are in the wrong place. This channel exists for C programmers and those aspiring to be C programmers -- it is not a general software support channel.
|
||||
support text 1 prec 1108943444 17 pragma_ /say If you are looking for installation support for a particular piece of software, you are in the wrong place. This channel exists for C programmers and those aspiring to be C programmers -- it is not a general software support channel.
|
||||
surprise text 1 syntropy_ 1250290153 2 syntropy_ /say How about a nice cold glass of shut the fuck up
|
||||
system-dependent text 1 pragma_ 1199480739 1 codemonke /call doesntcare
|
||||
system-dependent text 1 pragma_ 1199480739 2 jwillia3 /call doesntcare
|
||||
t&g text 1 gamag 1198330155 1 gamag The C Answer Book by Clovis L. Tondo and Scott E. Gimpel.
|
||||
take text 1 pragma_ 1231874071 27 pragma_ /say You take the $args.
|
||||
talking text 1 pragma_ 1194294839 1 pragma_ babbling talking "going on" ranting raving spouting muttering mumbling
|
||||
taocp text 1 twkm 1104462083 7 JasonosaJ The Art of Computer Programming, by Knuth, http://www.iso-9899.info/wiki/Special:Booksources/0201485419
|
||||
taocp text 1 twkm 1104462083 8 nadder The Art of Computer Programming, by Knuth, http://www.iso-9899.info/wiki/Special:Booksources/0201485419
|
||||
taunt text 1 pragma_ 1259025697 1 pragma_ /call insult
|
||||
teacher text 1 pragma_ 1199779292 5 kate` /say If someone in the channel is asking pointed questions of a specific individual, please do not answer their questions if you are not that individual. We're sure you're quite smart and capable, but the point is to let the individual infer the answer himself. You can give a programmer Coca-cola, but if you teach them how to carbonate coffee ...
|
||||
teaching text 1 twkm 1108008187 7 lemonade` not just accepting that the person asking knows what they are doing and has merely forgotten the proper forms to use. Rather, they need insight into what solutions exist to solve the problems they face; for which, there can be no better tool than a clear explanation of the problem, even if you must draw it out of them millimeter by torturous millimeter.
|
||||
temp text 1 syntropy_ 1254013586 0 nobody /msg ##c foo
|
||||
terminator text 1 Cin 1194839172 0 nobody http://img223.imageshack.us/img223/7959/stringliteralgg3.png
|
||||
test text 1 tolkad 1264736374 0 nobody /say Oort: candide ! test
|
||||
test88 text 1 Cin 1194548259 0 nobody test
|
||||
testbed text 1 PoppaVic 1187198287 0 nobody A simple program that grows and evolves to _test_ what you learn/read and is disposable.
|
||||
testcase text 1 lemonade` 1249772768 111 tp76 /say a testcase is a minimal compilable example exhibiting your symptoms. "Minimal" means just the bare essentials required to illustrate your question. Please paste a testcase at http://codepad.org to help us assist you.
|
||||
thanks text 1 pragma_ 1109979248 134 ccihcdaa /say $welcome, $nick
|
||||
testcase text 1 lemonade` 1249772768 181 jwillia3 /say a testcase is a minimal compilable example exhibiting your symptoms. "Minimal" means just the bare essentials required to illustrate your question. Please paste a testcase at http://codepad.org to help us assist you.
|
||||
thanks text 1 pragma_ 1109979248 162 Nately /say $welcome, $nick
|
||||
thanx text 1 pragma_ 1179879852 3 praveen /call thanks
|
||||
that text 1 RuralHack 1254142262 3 BenHem how we can alter the teaching of children like in the republic
|
||||
that text 1 RuralHack 1254142262 6 c_nick how we can alter the teaching of children like in the republic
|
||||
the_cake text 1 pragma_ 1195100423 0 nobody "The cake was moist and delicious." "The cake is a lie ... The cake is a lie ... The cake is a lie ..."
|
||||
there text 1 RuralHack 1254142285 3 Its_Neuroscience no bad in this world
|
||||
thesims text 1 pragma_ 1260214746 1 pragma_ /say It's not entirely unreasonable that God is just a computer programmer and we're just The Sims; albeit with a very complex and intelligent autonomous AI that is capable of deluding us into thinking we have free-will. See also !godprogrammer
|
||||
thesims text 1 pragma_ 1260214746 2 pragma_ /say It's not entirely unreasonable that God is just a computer programmer and we're just The Sims; albeit with a very complex and intelligent autonomous AI that is capable of deluding us into thinking we have free-will. See also !godprogrammer
|
||||
theworld text 1 pragma_ 1262055589 0 nobody http://strangemaps.files.wordpress.com/2006/11/800px-reagan-digitised-poster.JPG -- http://interactive.usc.edu/members/nsharkasi/americanworld.jpg -- http://cdn.epltalk.com/wp-content/uploads/2009/10/world-according-to-americans.jpg -- http://img293.imageshack.us/img293/2952/usworldem8.jpg
|
||||
thingswedo text 1 pragma_ 1259592605 0 nobody http://faculty.ed.uiuc.edu/g-cziko/twd/pdf/index.html
|
||||
thinking text 1 PoppaVic 1185822844 5 PoppaVic http://thinking-forth.sourceforge.net/
|
||||
this text 1 LogicCore 1205229084 45 Maxdamantus awesome dude :)
|
||||
threads text 1 twkm 1104460742 15 Dianora tutorial: http://www.llnl.gov/computing/tutorials/workshops/workshop/pthreads/MAIN.html - threads suck: http://threading.2038bug.com/
|
||||
thx text 1 pragma_ 1179879858 27 the_unmaker /call thanks
|
||||
tias text 1 Spark 1228985071 7 pragma_ /say "Try It And See" is a damaged philosophy that leads to unportable code and may lead to an undefined behavior trap.
|
||||
title module 1 pragma_ 1258840021 22 stoop get_title.pl
|
||||
this text 1 LogicCore 1205229084 46 Orlandopip awesome dude :)
|
||||
threads text 1 twkm 1104460742 16 jwillia3 tutorial: http://www.llnl.gov/computing/tutorials/workshops/workshop/pthreads/MAIN.html - threads suck: http://threading.2038bug.com/
|
||||
thx text 1 pragma_ 1179879858 28 EnginA /call thanks
|
||||
tias text 1 Spark 1228985071 12 Pryon /say "Try It And See" is a damaged philosophy that may lead to unportable code/undefined behavior.
|
||||
title module 1 pragma_ 1258840021 30 pragma_ get_title.pl
|
||||
tits text 1 pragma_ 1252284750 0 nobody http://fukung.net/v/9783/10c26d61f447c5ae1d141cc1485244fe.gif
|
||||
tnx text 1 pragma_ 1251695064 1 pragma_ /call thanks
|
||||
to text 1 prec 1104400219 3 oioioio a reserved function identifier prefix when followed by a lowercase letter
|
||||
tolkad text 1 tolkad 1264116317 0 nobody test\ntest
|
||||
tools4c text 1 PoppaVic 1209749114 1 PoppaVic /say ##workset is for lex/yacc and other such support tools.
|
||||
top10 text 1 pragma_ 1193812563 11 halberd /say Top 10 beginner mistakes: http://www.andromeda.com/people/ddyer/topten.html (Bonus: find the mistakes within the mistakes!)
|
||||
topic module 1 pragma_ 1258699440 1300 Nick_Patterson random_quote.pl
|
||||
tor]{ text 1 pragma_ 1258970930 7 pragma_ a devout extremist Christian zealot who believes strongly in the Bible's "word of God". He will "conveniently" ignore any relevent commentary you make and will relentlessly pursue his attempts to belittle non-believers. He possesses no logic or rationality; only absolute faith. He cannot make arguments; he can only preach. Converse with him at your own risk.
|
||||
topic module 1 pragma_ 1258699440 1782 SailorReality random_quote.pl
|
||||
tor]{ text 1 pragma_ 1258970930 8 pragma_ a devout extremist Christian zealot who believes strongly in the Bible's "word of God". He will "conveniently" ignore any relevent commentary you make and will relentlessly pursue his attempts to belittle non-believers. He possesses no logic or rationality; only absolute faith. He cannot make arguments; he can only preach. Converse with him at your own risk.
|
||||
touché text 1 themathkid 1203837688 1 themathkid /say Touché is what you say when you make a point, then someone makes a counterpoint.
|
||||
tp76 text 1 Pip 1250500121 5 Pip /say tp76 must be bored !
|
||||
tp76 text 1 Pip 1250500121 6 orbitz /say tp76 must be bored !
|
||||
trie text 1 PoppaVic 1205343145 2 Wulf_ http://www.cs.bu.edu/teaching/c/tree/trie/
|
||||
trigraph text 1 twkm 1104552373 3 pippijn a three character sequence beginning with two question marks, intended to make using c possible on systems where the usual punctuators are missing, typically from keyboards. these sequence is replaced during phase 1 of translation and takes place even within quoted strings.
|
||||
true text 1 snhmib 1197769594 2 musty- !false
|
||||
true text 1 snhmib 1197769594 3 jwillia3 !false
|
||||
truth text 1 PoppaVic 1189455615 13 marshmallows http://www.cs.virginia.edu/~evans/cs655/readings/ewd498.html
|
||||
tutorial text 1 pragma_ 1108597292 38 jrt05 http://www.iso-9899.info/wiki/Web_resources#Getting_Started , "the tutorial, by being brief, may also be misleading"
|
||||
tutorial text 1 pragma_ 1108597292 40 snhmib http://www.iso-9899.info/wiki/Web_resources#Getting_Started , "the tutorial, by being brief, may also be misleading"
|
||||
tuts text 1 Jafet 1216118004 7 lemonade` /say Almost every "tutorial" on the web is written by a person who does not know C well. Would you learn C from such a person? Obtain a good C book (see !books) and read it.
|
||||
twiddle text 1 kate` 1204722036 1 kate` /call twiddling
|
||||
twiddling text 1 kate` 1221611255 10 Wulf_ /say http://www.cs.utk.edu/~vose/c-stuff/bithacks.html
|
||||
twiddling text 1 kate` 1221611255 11 kate` /say http://www.cs.utk.edu/~vose/c-stuff/bithacks.html
|
||||
twkm text 1 Major-Willard 1106352903 4 dahitokiri a cruel man, but fair
|
||||
ty text 1 pragma_ 1179879872 5 variable /call thanks
|
||||
ty text 1 pragma_ 1179879872 6 delimax /call thanks
|
||||
typo text 1 Wulf_ 1235599055 1 Wulf_ typographical error
|
||||
u text 1 Wulf_ 1252559062 3 Senfberg /say plz learn how 2 spl "you"!
|
||||
u text 1 Wulf_ 1252559062 5 c_nick /say plz learn how 2 spl "you"!
|
||||
uafshs,da text 1 snhmib 1231383719 1 snhmib /say use a friggin shell script, dumbass
|
||||
ub text 1 kate` 1236376997 29 Oddity undefined behavior. Invoking undefined behavior can cause fluffy kittens to fly out from your nose.
|
||||
ub text 1 kate` 1236376997 35 rvvs89 undefined behavior. Invoking undefined behavior can cause fluffy kittens to fly out from your nose.
|
||||
ubuntumanpages text 1 lemonade` 1238264335 0 nobody sudo apt-get install manpages manpages-dev
|
||||
udefine text 1 pragma_ 1255059316 4 pragma_ /call urban
|
||||
udict text 1 pragma_ 1255059294 406 Sailormoon /call urban
|
||||
unbufferedgetc text 1 pragma_ 1106032892 5 pragma_ /say How to disable line-buffering with termios: http://shtrom.ssji.net/skb/getc.html
|
||||
udict text 1 pragma_ 1255059294 535 pragma_ /call urban
|
||||
unbufferedgetc text 1 pragma_ 1106032892 6 pragma_ /say How to disable line-buffering with termios: http://shtrom.ssji.net/skb/getc.html
|
||||
understood text 1 Auris- 1204317155 12 kate` /say We understood you the first time, and answered already; you may not have understood the answers. Instead of ignoring them and repeating your question, find out what they mean.
|
||||
union text 1 Major-Willard 1104886538 4 ColonelJ used to define an abstract data type whose members occupy the same memory
|
||||
unixfaq text 1 twkm 1104460642 1 cousteau http://www.erlenstar.demon.co.uk/unix/faq_toc.html
|
||||
unmaintainable text 1 vorpal 1207882362 1 vorpal http://freeworld.thc.org/root/phun/unmaintain.html
|
||||
unp1 text 1 pragma_ 1195011079 80 Wulf_ /say Unix Network Programming Vol I: http://www.unpbook.com/
|
||||
unp1 text 1 pragma_ 1195011079 94 Dianora /say Unix Network Programming Vol I: http://www.unpbook.com/
|
||||
unp2 text 1 twkm 1104636219 6 pragma_ unix network programming, volume 2: interprocess communications, by stevens, see http://www.kohala.com/start/unpv22e/unpv22e.html
|
||||
unsigned text 1 infobahn 1104595343 0 nobody a qualifier for integer data types, which renders them incapable of representing negative numbers but increases the number of positive values they can represent.
|
||||
urban module 1 pragma_ 1255045031 495 Sailormoon urban
|
||||
usetherighttool text 1 vorpal 1225802282 2 vorpal Use the right tool for the job. Someone once said, “if the only tool you have is a hammer, you tend to see every problem as a nail. ” Avoid placing artificial limitations on your projects by keeping an open mind and learning more tools, as your skills improve.
|
||||
urban module 1 pragma_ 1255045031 627 pragma_ urban
|
||||
usetherighttool text 1 vorpal 1225802282 4 pragma_ /say Use the right tool for the job. Someone once said, "if the only tool you have is a hammer, you tend to see every problem as a nail." Avoid placing artificial limitations on your projects by keeping an open mind and learning more tools, as your skills improve.
|
||||
utf-8 text 1 Wulf_ 1236229252 6 Random832 an ascii-compatible way to represent arbitrary unicode characters with octets. http://en.wikipedia.org/wiki/UTF-8 | printf("\xc3\xb6\n");
|
||||
utsl text 1 Wulf4 1235548349 3 Wulf4 /call UTSL
|
||||
v text 1 Zhivago 1178320878 2 pshr_ the same as v == 0
|
||||
@ -900,44 +952,49 @@ voidmain text 1 twkm 1104875507 6 boris`` main returns an int, void main() is fo
|
||||
volatile text 1 twkm 1105427414 5 pepsi a type qualifier, which requires that value caching not be performed.
|
||||
vt100 text 1 PoppaVic 1188660161 2 pragma_ http://pegasus.cs.csubak.edu/Tables_Charts/VT100_Escape_Codes.html http://members.save-net.com/jko@save-net.com/asm/r_vt200.txt
|
||||
warning-labels text 1 pragma_ 1183266883 2 pragma_ http://www.myconfinedspace.com/2007/03/23/internet-warning-labels/
|
||||
warnings text 1 Baughn 1173671019 125 spv http://www.iso-9899.info/wiki/WarningFlags
|
||||
warnings text 1 Baughn 1173671019 127 Saparok http://www.iso-9899.info/wiki/WarningFlags
|
||||
wcs text 1 prec 1104399769 1 Saparok a reserved function identifier prefix when followed by a lowercase letter
|
||||
wcsftime text 1 twkm 1104393957 1 mauke convert date and time to wide string, #include <wchar.h>, size_t wcsftime(wchar_t *ws, size_t maxlen, const wchar_t *format, const struct tm *timeptr); returns NULL if the conversion would succeed within maxlen wide characters otherwise the number of codes stored excluding the terminating null wide character, see http://www.iso-9899.info/man?wcsftime
|
||||
wcsrtombs text 1 twkm 1104395426 0 nobody convert wide character string to (narrow) character string (restartable), #include <wchar.h>, size_t wcsrtombs(char *s, const wchar_t **ws, size_t len, mbstate_t *ps); returns (size_t)-1 and stores EILSEQ in errno if a wide character is encountered that cannot be converted otherwise the number of bytes in the resulting sequence not including the terminating null character, see http://www.iso-9899.info/man?wcsrtombs
|
||||
wdict text 1 pragma_ 1257554566 257 Sailormoon /call wikipedia
|
||||
wdict text 1 pragma_ 1257554566 353 pragma_ /call wikipedia
|
||||
weapon text 1 kate` 1208626492 5 noncompoop "Beretta 9mm" "Smith and Wesson" BFG9000 MP40 "rocket launcher" "hand grenade" shotgun railgun catapult "Cupid's bow" M16 "flare gun" harpoon flamethrower "chainsaw bazooka"
|
||||
weapon_action text 1 pragma_ 1109021669 3 pragma_ "locks and loads" cocks loads "lovingly cleans" aims
|
||||
welcome text 1 pragma_ 1109979223 5 lemonade` "No problem" "You're welcome" "Think nothing of it" "Not a problem" "My pleasure"
|
||||
west text 1 pragma_ 1231873982 3 d3mn0id /say $rpg_ans
|
||||
wg14 text 1 twkm 1104460837 1 pragma_ http://www.open-std.org/jtc1/sc22/wg14/
|
||||
what text 1 pragma_ 1236820003 174 grot /call excuse
|
||||
what text 1 pragma_ 1236820003 195 pragma_ /call excuse
|
||||
what_answers text 1 pragma_ 1195012185 1 pragma_ "I don't know." "That is a $severity $question_type question."
|
||||
who text 1 pragma_ 1258611970 6 seakazam /say $who_answers
|
||||
where text 1 hellyeah 1263503154 87 ajnr bot country
|
||||
who text 1 pragma_ 1258611970 12 andy-laptop_ /say $who_answers
|
||||
who_answers text 1 pragma_ 1258611928 0 nobody "Hannah Montana" "Britney Spears" "Thomas Hobbes" "Rene Descartes" "Mr. T" "Chuck Norris" "the Power Rangers" "the Teletubbies" "Spider-Man" "Hulk Hogan" "a butterfly" Goethe "Barack Obama" "John McCain" "Hillary Clinton" "Rodney Dangerfield" "LeVar Burton" "Sarah Palin"
|
||||
why text 1 pragma_ 1194258443 48 umopepisdn` /say $why_answers
|
||||
why text 1 pragma_ 1194258443 55 zvn101 /say $why_answers
|
||||
why_answers text 1 pragma_ 1194140322 4 joeyadams "I don't know." "Because the $sizes $colors $animals made it that way." "That's just how it is." "If you just investigate a $sizes amount further, you can figure it out." "Because I said so!" "Are you thinking clearly?" "Are you sure you're not a $sizes $idiot?"
|
||||
whymove text 1 pragma_ 1111196059 3 pragma_ /say See http://freenode.net/policy.shtml and http://freenode.net/policy.shtml#channelnaming for information on the unusual channel name.
|
||||
wiki text 1 twkm 1104229988 17 KingAztech http://www.iso-9899.info/
|
||||
wikipedia module 1 pragma_ 1257554350 262 Sailormoon wikipedia.pl
|
||||
win32 text 1 PoppaVic 1180888225 72 n00p try #winprog on EFnet or #winapi on freenode
|
||||
wiki text 1 twkm 1104229988 22 Ari-Ugwu http://www.iso-9899.info/
|
||||
wikipedia module 1 pragma_ 1257554350 358 pragma_ wikipedia.pl
|
||||
win32 text 1 PoppaVic 1180888225 76 s00p try #winprog on EFnet or #winapi on freenode
|
||||
winGTK+ text 1 PoppaVic 1203017835 1 Cin http://www.gtk.org/download-windows.html
|
||||
windows text 1 Major-Willard 1106527942 15 Jafet a thirty-two bit extension and graphical shell to a sixteen-bit patch to an eight-bit operating system originally coded for a four-bit microprocessor which was written by a two-bit company that can't stand one bit of competition.
|
||||
wizo text 1 kp 1194487607 2 kp /me <3 wizo.
|
||||
works text 1 pragma_ 1231373678 24 pragma_ /say It works it works! Omg omg omg! I mean it compiles. Now what's a segfault?
|
||||
works text 1 pragma_ 1231373678 25 pragma_ /say It works it works! Omg omg omg! I mean it compiles. Now what's a segfault?
|
||||
wotsit text 1 snhmib 1199573903 6 snhmib http://www.wotsit.org, loads of file type resources!
|
||||
wtf text 1 pragma_ 1251245783 34 pragma_ /call acronym
|
||||
wright text 1 pragma_ 1263178267 0 nobody http://www.pagetutor.com/jokebreak/139.html
|
||||
wtf text 1 pragma_ 1251245783 40 pragma_ /call acronym
|
||||
x text 1 mauke 1267135629 0 nobody exactly equivalent to x != 0
|
||||
x->y text 1 prec 1108845393 equivalenv prec (*x).y
|
||||
xY text 1 Baughn 1203448278 0 nobody /call xy
|
||||
x[y] text 1 prec 1106283927 24 pragma_ syntactic sugar for *(x + y)
|
||||
xy text 1 Draconx|Laptop 1175596315 145 Wulf_ /say The XY problem: You want to do X, but don't know how. You think you can solve it using Y, but don't know how to do that, either. You ask about Y, which is a strange thing to want to do. Just ask about X.
|
||||
xY text 1 Baughn 1203448278 3 jwillia3 /call xy
|
||||
x[y] text 1 prec 1106283927 29 pragma_ syntactic sugar for *(x + y)
|
||||
x[y][z] text 1 pragma_ 1268438822 0 nobody syntactic sugar for *(*(x + y) + z)
|
||||
xy text 1 Draconx|Laptop 1175596315 155 Draconx|Laptop /say The XY problem: You want to do X, but don't know how. You think you can solve it using Y, but don't know how to do that, either. You ask about Y, which is a strange thing to want to do. Just ask about X.
|
||||
yo text 1 pragma_ 1179679895 5 pragma_ /call hi
|
||||
you\sremind\sme\sof\sthe\s(.*) regex 1 pragma_ 1196905060 0 nobody say $nick: What $1
|
||||
youredoingitwrong text 1 pragma_ 1178966474 4 pragma_ /say This is you: http://www.doingitwrong.com/
|
||||
yz text 1 kate` 1203601730 7 peapicker /call understood
|
||||
zalgo text 1 pragma_ 1262652805 2 pragma_ http://www.centernegative.com/2009/03/zalgo-he-comes/
|
||||
zealot text 1 Wolf 1106956916 0 nobody a close minded fool
|
||||
zhivago text 1 Wulf_ 1250501184 1 Wulf_ /call Zhivago
|
||||
zhivago text 1 Wulf_ 1250501184 2 pragma_ /call Zhivago
|
||||
zhivago_idiots text 1 snhmib 1236413890 2 kate` "infantile paraplegic" idiot "brain damaged moron"
|
||||
zhivago_insult text 1 snhmib 1236414077 6 kate` /say $args: are you an $zhivago_idiots "?"
|
||||
zhivago_insult text 1 snhmib 1236414077 7 n00p /say $args: are you an $zhivago_idiots "?"
|
||||
zhivago_query text 1 snhmib 1236414332 13 kate` /say $args: $sometypes what is the type of a "?"
|
||||
zvrba text 1 kp 1200492362 1 pragma_ a silly doodoohead
|
||||
{ text 1 Major-Willard 1106528232 0 nobody used to commence a block
|
||||
|
1
fpb
Executable file
1
fpb
Executable file
@ -0,0 +1 @@
|
||||
perl -I /home/msmud/lib/lib/perl5/site_perl/5.10.0/i686-linux/ -I /home/msmud/libwww-perl-5.808/lib/LWP -I /home/msmud/Net-IRC-0.75 pbot.pl 2>>stderr_log
|
@ -1 +1 @@
|
||||
nohup perl -I /home/msmud/lib/lib/perl5/site_perl/5.10.0/i686-linux/ -I /home/msmud/libwww-perl-5.808/lib/LWP -I /home/msmud/Net-IRC-0.75 pbot2.pl >> log 2>&1
|
||||
nohup perl -I /home/msmud/lib/lib/perl5/site_perl/5.10.0/i686-linux/ -I /home/msmud/libwww-perl-5.808/lib/LWP -I /home/msmud/Net-IRC-0.75 pbot.pl 2>>stderr_log
|
43
pbot.pl
Executable file
43
pbot.pl
Executable file
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# File: pbot.pl
|
||||
# Author: pragma_
|
||||
#
|
||||
# Purpose: IRC Bot (3rd generation)
|
||||
#
|
||||
# Version History:
|
||||
########################
|
||||
|
||||
my $VERSION = "0.5.0-beta";
|
||||
|
||||
########################
|
||||
# 0.5.0-beta (03/14/10): Initial version using PBot::PBot module
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use PBot::PBot;
|
||||
|
||||
my $home = $ENV{HOME};
|
||||
|
||||
my %config = ( log_file => "$home/pbot/log",
|
||||
|
||||
channels_file => "$home/pbot/channels",
|
||||
commands_file => "$home/pbot/commands",
|
||||
quotegrabs_file => "$home/pbot/quotegrabs",
|
||||
|
||||
ircserver => 'irc.freenode.net',
|
||||
botnick => 'pbot3'
|
||||
);
|
||||
|
||||
my $pbot = PBot::PBot->new(%config);
|
||||
|
||||
$pbot->load_channels();
|
||||
$pbot->load_quotegrabs();
|
||||
$pbot->load_commands();
|
||||
|
||||
$pbot->connect();
|
||||
|
||||
while(1) {
|
||||
$pbot->do_one_loop();
|
||||
}
|
70
quotegrabs
Normal file
70
quotegrabs
Normal file
@ -0,0 +1,70 @@
|
||||
Sailormoon ##philosophy 1260399990.80643 pragma_ thats pretty cool pragma
|
||||
offender_ ##philosophy 1260401620.52631 Sailormoon i think that bach was satanist because he made a song named devil's staricase
|
||||
Raiford ##c 1260403515.76577 pragma_ rational representation is almost like symbolic representation
|
||||
KernelJ ##c 1260404632.29595 pragma_ ohday_: not really I just like playing with stuff... and making it fail
|
||||
snhmib ##c 1260406072.54312 pragma_ now all you gotta do is code up a funny evaluator so only the funny quotes get saved
|
||||
PARLIAMENT ##philosophy 1260413375.67733 pragma_ I imagine it's like he thinks of something to say, and then waits for an answer, realizes he didn't actually say anything, and mumbles out some incoherent fragment of his idea and stands there with a blank stare waiting for a reply
|
||||
Sailormoon ##philosophy 1260413727.40344 pragma_ I'm retarded
|
||||
goblinshark ##philosophy 1260413885.8645 pragma_ shit hurts so bad
|
||||
Zhivago ##c 1260414995.08893 pragma_ ende: Now shut up and stop whining like a schoolgirl and start to think.
|
||||
Zhivago ##c 1260414983.29978 pragma_ ende: You are acting like a moron. If no-one tells you this, why would you stop?
|
||||
Zhivago ##c 1260416784.36793 pragma_ ulq: Do you suffer from mental retardation?
|
||||
n00p ##c 1260419744.92694 LimCore don't you dare quote me without permission mbohun
|
||||
Mkop ##c 1260429170.97791 pragma_ Insight of the day: Programming is likely to induce an extreme of moods, alternating quickly between, "Wow, I'm a freaking genius!" and "Wow, I'm a freaking moron!"
|
||||
Sailormoon ##philosophy 1260428479.9636 pragma_ hey pragma can u beat this wagner guy up, i think he looked down my blouse
|
||||
Mkop ##c 1260429869.08334 pragma_ I'll stop playing with it in public.
|
||||
wcarss ##c 1260439638.90734 pragma_ "What do trumpets and pirates have in common? They're both terrible on the high C's"
|
||||
Wulf_ ##c 1260440015.57858 pragma_ Why do all Pascal programmers ask to live in Atlantis? Because it is below C level.
|
||||
twkm ##c 1260440632.46203 pragma_ oh, and ewww, x86.
|
||||
Pryon ##c 1260468358.44293 pragma_ (users are evil)
|
||||
codrus ##philosophy 1260475825.13385 pragma_ Give a man a fish and he will eat for a day. Teach him how to fish, and he will sit in a boat and drink beer all day.
|
||||
sleeptyper ##philosophy 1260482099.91531 pragma_ shoves a fork in the toaster from Hell
|
||||
pragma_ ##philosophy 1260490037.9738 pragma_ It's like trying to teach math to someone. You tell them, "You have 4 apples, and I take away 2; how many do you have left?" Then you tell them, "You have 3 oranges, and I give you 2; how many do you have?" But they instead go off to read about fruit.
|
||||
musty ##c 1260490052.73879 pragma_ hi how to hack into C plz?
|
||||
musty ##c 1260490254.2449 pragma_ I don't feel like I'm very wanted here.
|
||||
musty ##c 1260490382.43831 pragma_ I think I'll leave, and just never return.
|
||||
Sacho ##c 1260492229.1149 pragma_ how can you use fgets to read from a string?
|
||||
Utopiah ##philosophy 1260561216.85707 pragma_ Koganei: could you write a algorithm that would convert each philosophy paper to a running algorithm? you could call it philosophical_embodiment() and see if instancianting the state of the art from the last publications help to make the world a better place
|
||||
Nately ##philosophy 1260564436.7579 pragma_ pragma_ is... the most interesting man in the world.
|
||||
Sailormoon ##philosophy 1260585505.72736 pragma_ that makes sense pragma..
|
||||
halberd ##philosophy 1260586060.79826 pragma_ Utopiah, you lay off of pragma_ , it was a terrifying midget attack, there were just millions of them, tiny little buggers, they get up your nose, in your eyes, clawing at your brain, it's not a pretty sight
|
||||
pragma_ ##philosophy 1260589088.76471 pragma_ Also, each time you wank, you give your sperm-system more experience points and it gains levels. It learns from previous mistakes and it improves itself for future insemination. If you wank a few thousand times before you finally create a child, that child will be as fast as an African runner and as smart as Einstein.
|
||||
GreatMan-ever ##philosophy 1260589491.1352 pragma_ for a man to be a great man one need to learn to control his penis
|
||||
Tired ##philosophy 1260590784.0129 pragma_ do you know how hard it is to get a table for 1 at chuckie cheese?
|
||||
goblinshark ##philosophy 1260592876.59628 Tired i dont know
|
||||
R0b0t1 ##c 1260602147.46191 pragma_ I've had kinky robot sex with candide before.
|
||||
spv ##c 1260602124.77513 pragma_ /msg candide how're you doing sexy
|
||||
halberd ##philosophy 1260604751.7772 Sailormoon I think they kind of rub openings
|
||||
pnotes ##philosophy 1260604700.99294 Sailormoon how do male birds get their sperm in the females?
|
||||
pragma_ ##philosophy 1260604972.54802 Sailormoon "most birds do not have a penis (ducks and ostriches are a couple that do), and mate simply by pressing their cloacas together (the cloaca is the single opening birds use to excrete, mate and lay eggs)"
|
||||
Nately ##philosophy 1260605639.37135 pragma_ pragma_: you must be extraordinary
|
||||
tor]{ ##philosophy 1260647326.31643 pragma_ and your jaw wont drop when God hands that rear end to ya with just a handful of people
|
||||
tor]{ ##philosophy 1260647762.49836 pragma_ Christ laid the whole thing waste
|
||||
tor]{ ##philosophy 1260647950.39623 pragma_ newton studied the bible as well
|
||||
tor]{ ##philosophy 1260648182.7218 pragma_ there is nothing wrong with learning the occult
|
||||
tor]{ ##philosophy 1260648432.50101 pragma_ God only exists to people who implement the tools he gave mankind to utilize his existence
|
||||
tor]{ ##philosophy 1260648569.28016 pragma_ Satan is a greater being...
|
||||
tor]{ ##philosophy 1260648768.92263 pragma_ benzap..forcing a belief on to people is manipulating scientific data to hide declines to push a fascist agenda like global warming across
|
||||
Nately ##philosophy 1260689740.5131 pragma_ is there still random fap?
|
||||
Incarnation ##philosophy 1260766213.17936 pragma_ and I'm not saying I'm smart
|
||||
gnech ##c 1260766721.60784 spv are there any good tutorials on how to code webpages using C
|
||||
Zhivago ##c 1260775613.60165 ColonelJ waits for the moment of illumination.
|
||||
patrisk ##c 1260822079.36312 pragma_ I wonder how many K&R books have been sold because of this channel.
|
||||
pragma_ ##philosophy 1260828964.99089 pragma_ I've known for a long while that politicans and rulers do not live by their own constitutions or rules; they preach one thing, and do a different thing in privacy; schools are just day-care centers and training camps to brainwash more complacant sheep for the diplomats and bureaucracies to utilize as slaves; paychecks are just a facade when you consider how much money the top dogs are making compared to the so-called workers
|
||||
R0b0t1 ##c 1260830770.32572 pragma_ I wrote a audio driver in brainfuck once.
|
||||
dr_traktor ##philosophy 1260920708.31454 Sailormoon !rq dr_traktor
|
||||
pragma_ ##philosophy 1261001833.7305 pragma_ "I just had an argument with a girl I know. She was saying how it's unfair that if a guy fucks a different girl every week, he's a legend, but if a girl fucks just two guys in a year, she's a slut. So in response I told her that if a key opens lots of locks, then it's a master key. But if a lock is opened by lots of keys, then it's a shitty lock. That shut her up."
|
||||
kronix ##philosophy 1261312046.39745 pragma_ I found a photo of Sailormoon: http://semantink.com/wordpress/wp-content/uploads/2009/08/bad_cosplay_1.jpg
|
||||
pragma_ ##philosophy 1261317031.77827 kronix Utopiah: please die a slow torturous death
|
||||
Zhivago ##c 1261637602.64852 pragma_ Produce a goddamned test program that demonstrates your problem so that we can stop listening to your confused gibberish and explain what enormously stupid thing you are doing.
|
||||
Incarnation ##philosophy 1262408367.92508 pragma_ i dont think 4chan exhibits immaturity, i think 4chan exhibits a sort of collective and extreme satire of the absurdity of hypocrisy
|
||||
PARLIAMENT ##philosophy 1262471120.84726 notk0 dear diary, today pragma_ and notk0 couldn't stop talking about my 5 phds and how they wish they could be me
|
||||
Incarnation ##philosophy 1262496459.23261 Sailormoon that's just awful
|
||||
jotik ##philosophy 1262503434.42706 Sailormoon at least its still running
|
||||
pragma_ ##philosophy 1262874175.91937 notk0 <Jayded> pragma_: I've had lots of lovers, I've traveled overseas as a gay sailor, played in homo bands, been whupped by homophobes, got drunk in gay bars, and had fun
|
||||
Cyndre ##philosophy 1264210052.77581 notk0 AR - we had fun in the sun chasing nazi's on the run, but the fun didn't last, the nazi's RAN to fast
|
||||
Incarnation ##philosophy 1267569619.64089 SailorReality maybe i just dont masturbate in public because so many people hate it
|
||||
Incarnation ##philosophy 1267679795.41578 Nately admit it SailorReality you'd be a total public masturbator if it wasn't against the law
|
||||
SailorReality ##philosophy 1267680060.78619 Incarnation If public masturbation were legal Id hang out in womens washrooms and then run after cumming on them and id also learn kung fu and aikido so if their boyfriends came at me id kick their ass and cum on their face
|
||||
SailorReality ##philosophy 1267769675.33316 pragma_ wait, how do u see their mouths if ur deaf?
|
||||
pragma_ ##philosophy 1268441807.43464 pragma_ If you really examine the course of the development of our world, we're really all (ants, birds, humans, reptiles, mammals, bacteria, fish, insects, plants, etc), all of us, are all just parasites eating each other and adapting to each other.
|
Loading…
Reference in New Issue
Block a user