#dccforward.irc by phos # similar to a mirc script dcc reflector # # shouts to the abortion peeps you know who you are # need scripting help join #jircii on freenode or EFnet # irc.freenode.net irc.blessed.net,irc.easynews.com # # dan's jircii scripts page; http://deep.jircii.info/ # # # questions / suggestions -> danfare@jircii.info on request { if (getProperty("dccforward") eq "on") { if (getProperty("ignoredcc") eq "yes") { echo("* ignoring $1-"); return; } if (uc($1) eq "DCC" && uc($2) eq "SEND") { if (getProperty("multiserver") eq "on") { for ($_session = 0; $_session < getTotalSessions(); $_session++) { callInSession($_session, "/_fwdnet $1-"); $_ntwork = " "; } } $tonick = getProperty("tonick"); $addr = getAddress($tonick); if (-istrue $addr) { echo("/dccforward: forwarding $3 to $tonick"); sendReply("$nick", "$1", "$2-"); } } # halt; } } alias dccforward { echo("/dccforward: /dcctog /dcctoghelp /dview"); } call("/dccforward"); alias dcctog { if ($1 eq "delay") { if (!-isnumber $2) { echo("/dcctog: /dcctog delay \b###\b (in seconds)"); return; } $ms = $2 * 1000; echo("/dcctog: setting $1" . ": $2 seconds"); setProperty("$1", $ms); return; } if ($1 eq "tonick") { $addr = getAddress($2); if (!-istrue $addr) { echo("/dcctog: sorry $2 is not a known nick (are you in the correct server window?)"); sendRaw("who $1"); return; } echo("/dcctog: setting $1" . ": $2"); setProperty("tonick", $2); return; } if ($1 eq "tonetwork") { if ($2 eq " ") { echo("/dcctog: /dcctog tonetwork \bIRC NETWORK\b (i.e. EFnet, freenode"); } echo("/dcctog: setting $1" . ": $2"); setProperty("tonetwork", $2); return; } $regex = '(on|off)'; if ($2 ismatch $regex) { @match = matches($2, $regex); $match = @match[0]; if ($1 eq "dccforward") { echo("/dcctog: setting $1" . ": $2"); setProperty("$1", $match); return; } if ($1 eq "multiserver") { echo("/dcctog: setting $1" . ": $2"); setProperty("$1", $match); return; } } call("/dcctoghelp"); } alias dview { echo("dccforward: " . getProperty("dccforward")); echo("delay: " . getProperty("delay")); echo("tonick: " . getProperty("tonick")); echo("multiserver : " . getProperty("multiserver")); echo("tonetwork: " . getProperty("tonetwork")); } alias dcctoghelp { echo("/dcctog list hhhhhhhhh" . " ref: /dview " . "h" x 48); echo("h dccforward: forward dcc's (with options below) ref: /dcctog tonick h"); echo("h delay: delay to ignore dcc sends untill sepecified time, in seconds h"); echo("h tonick: send request to specified nick h"); echo("h multiserver: \bon/off\b send request to a nick on a specified network h"); echo("h tonetwork: \bon/off\b which network would you like to forward the request to h"); echo("hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"); } alias _fwdnet { if (getProperty("ignoredcc") eq "yes") { return; } $tonick = getProperty("tonick"); $tonetwork = getProperty("tonetwork"); $dccdelay = getProperty("delay"); $_ntwork = getServerNetwork(); if (uc($_ntwork) eq uc($tonetwork)) { $_addr = getAddress("$tonick"); setProperty("ignoredcc", "yes"); $unsetvar = addTimer(&_unst, $dccdelay, 1); $_addr = getAddress("$tonick"); if (-istrue $_addr) { echo("forwarding $2 to $tonick" . ":" . "$1-"); sendReply("$nick", "$1", "$2-"); return; } echo("* /dccforward: $tonick is not known on $tonetwork, turning forward off"); call("/dcctog dccforward off"); } } sub _unst { setProperty("ignoredcc", "no"); }