summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlookshe <mail@lookshe.org>2012-02-06 12:28:12 +0100
committerlookshe <mail@lookshe.org>2012-02-06 12:28:12 +0100
commited521c96a03dad1f860bcc818482eed0ffadb378 (patch)
tree8fb6904ccffad6b35aabc304f0c2ffb7591faea5
parentd45663caaad3fb3f266f064b9c70955bf7d985c9 (diff)
removed unwanted entry from filelist
added !random to decision
-rw-r--r--decision.tcl32
-rw-r--r--file.pl2
2 files changed, 33 insertions, 1 deletions
diff --git a/decision.tcl b/decision.tcl
index 80f7d6c..92fbdb2 100644
--- a/decision.tcl
+++ b/decision.tcl
@@ -15,6 +15,38 @@
bind pub - \[ proc_decision
+bind pub - !zufall proc_zufall
+bind pub - !random proc_zufall
+
+proc proc_zufall {nick host hand chan arguments} {
+ global do_dec
+ if {[info exists do_dec($nick:$chan)]} {
+ set act_do_dec $do_dec($nick:$chan)
+ if {$act_do_dec < 3} {
+ incr act_do_dec
+ set do_dec($nick:$chan) $act_do_dec
+ } else {
+ putserv "NOTICE $nick :no flooding!"
+ return 0
+ }
+ } else {
+ set do_dec($nick:$chan) 1
+ timer 10 "unset do_dec($nick:$chan)"
+ }
+ if {$arguments == ""} {
+ set arguments 0
+ }
+ if {![string is integer $arguments]} {
+ set arguments 0
+ }
+ set arg $arguments
+ set myran 0
+ if {$arg == 0} {
+ set arg 6
+ }
+ set myran [expr [rand $arg] + 1]
+ putserv "PRIVMSG $chan :Der Würfel sagt: $myran ($arg)"
+}
proc proc_decision {nick host hand chan arguments} {
diff --git a/file.pl b/file.pl
index 6bc1faa..28aa08b 100644
--- a/file.pl
+++ b/file.pl
@@ -68,7 +68,7 @@ if ($found == 0) {
if ($$list[$i] =~ /^.$type.+/i) {
last;
}
- if ($$list[$i] !~ /^.$type$/i) {
+ if ($$list[$i] !~ /^.$type$/i & $$list[$i] !~ /^Next matched file extensions?$/) {
print ".$type is $$list[$i]\n";
$found = 1;
}