Sfoglia il codice sorgente

Fix whitespace issues

James Seward 6 anni fa
parent
commit
fb2aeffe6e

+ 1 - 2
GuardChan/guardchan.tcl

@@ -1,7 +1,7 @@
 # GuardChan by JamesOff
 # GuardChan by JamesOff
 # Kickbans people if they're not in the bot's userfile
 # Kickbans people if they're not in the bot's userfile
 # No other filtering options, sorry
 # No other filtering options, sorry
-# 
+#
 # Released under the BSD licence
 # Released under the BSD licence
 # http://jamesoff.net/site/projects/eggdrop-scripts/guardchan
 # http://jamesoff.net/site/projects/eggdrop-scripts/guardchan
 
 
@@ -54,4 +54,3 @@ proc guardchan_join { nick host handle channel } {
     }
     }
   }
   }
 }
 }
-

+ 0 - 1
HostClean/README.md

@@ -14,4 +14,3 @@ $( for f in "#channel.*.log"; do python parse.py "$f"; done ) | sort | uniq > ho
 Then load the TCL script into your bot, and run `.hostload <path to file you made above>`, and then do `.hostclean <handle>` for each user.
 Then load the TCL script into your bot, and run `.hostload <path to file you made above>`, and then do `.hostclean <handle>` for each user.
 
 
 The script outputs a bunch of `.-host` lines on the partyline, which you should double check, and then you can copy/paste them back into the partyline to execute them.
 The script outputs a bunch of `.-host` lines on the partyline, which you should double check, and then you can copy/paste them back into the partyline to execute them.
-

+ 0 - 1
HostClean/parse.py

@@ -29,4 +29,3 @@ def main():
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
     main()
     main()
-

+ 3 - 3
ProxyCheck/proxycheck.tcl

@@ -27,9 +27,9 @@
 ###############################################################################
 ###############################################################################
 
 
 # space-separated list of RBLs to look in
 # space-separated list of RBLs to look in
-set proxycheck_rbls { 
-  "cbl.abuseat.org" 
-  "opm.blitzed.org" 
+set proxycheck_rbls {
+  "cbl.abuseat.org"
+  "opm.blitzed.org"
 }
 }
 
 
 # time in minutes to ban for
 # time in minutes to ban for

+ 1 - 1
QuoteEngine/QuoteEngine-settings.sample.tcl

@@ -1,6 +1,6 @@
 # Settings file for QuoteEngine
 # Settings file for QuoteEngine
 #
 #
-# Edit this file and save it as QuoteEngine-settings.tcl in 
+# Edit this file and save it as QuoteEngine-settings.tcl in
 # your eggdrop's scripts/ directory
 # your eggdrop's scripts/ directory
 
 
 # The mysql hostname to connect to
 # The mysql hostname to connect to

+ 3 - 3
QuoteEngine/QuoteEngine.tcl

@@ -46,7 +46,7 @@ setudef flag quoteengine
 # connect to database
 # connect to database
 proc quote_connect { } {
 proc quote_connect { } {
 	global db_handle quote_db
 	global db_handle quote_db
-		
+
 	set db_handle [mysqlconnect -host $quote_db(host) -user $quote_db(user) -password $quote_db(password) -db $quote_db(database)]
 	set db_handle [mysqlconnect -host $quote_db(host) -user $quote_db(user) -password $quote_db(password) -db $quote_db(database)]
 
 
 	if {$db_handle != ""} {
 	if {$db_handle != ""} {
@@ -204,7 +204,7 @@ proc quote_fetch { nick host handle channel text } {
 		return 0
 		return 0
 	}
 	}
 
 
-	
+
 	set text [mysqlescape $quote_id]
 	set text [mysqlescape $quote_id]
   set sql "SELECT * FROM quotes WHERE id='$text'"
   set sql "SELECT * FROM quotes WHERE id='$text'"
   putloglev d * "QuoteEngine: executing $sql"
   putloglev d * "QuoteEngine: executing $sql"
@@ -580,7 +580,7 @@ proc quote_auto { nick host handle channel text } {
 		return
 		return
 	}
 	}
 
 
-	
+
 	set where_clause "WHERE channel='[mysqlescape $channel]' AND quote LIKE '%$thisword%' ORDER BY RAND() LIMIT 1"
 	set where_clause "WHERE channel='[mysqlescape $channel]' AND quote LIKE '%$thisword%' ORDER BY RAND() LIMIT 1"
 	putloglev d * "quoteengine: $where_clause"
 	putloglev d * "quoteengine: $where_clause"
 	set sql "SELECT * FROM quotes $where_clause"
 	set sql "SELECT * FROM quotes $where_clause"

+ 17 - 17
QuoteEngine/README.md

@@ -41,7 +41,7 @@ Database setup, first steps
 <br>
 <br>
 
 
 1. Create admin user for mysql if you don't have it yet.
 1. Create admin user for mysql if you don't have it yet.
-   
+
    // In case you have an admin user for your mysql server other than the "root" user, you can skip this. //
    // In case you have an admin user for your mysql server other than the "root" user, you can skip this. //
 
 
    With root user enter the following command in your shell:
    With root user enter the following command in your shell:
@@ -49,19 +49,19 @@ Database setup, first steps
    ```# mysql -u root```
    ```# mysql -u root```
       <br>
       <br>
       This will let you to login to mysql, so you can make changes on/in it.
       This will let you to login to mysql, so you can make changes on/in it.
- 
+
    Create a new admin user (so you can login to phpmyadmin later on):
    Create a new admin user (so you can login to phpmyadmin later on):
    <br>
    <br>
    ```mysql> CREATE USER '<user>'@'%' IDENTIFIED BY '<pwhere>';```
    ```mysql> CREATE USER '<user>'@'%' IDENTIFIED BY '<pwhere>';```
       <br>
       <br>
       This will create the <user> with the given password.
       This will create the <user> with the given password.
-      
+
    Grant all right to the user:
    Grant all right to the user:
    <br>
    <br>
    ```mysql> GRANT ALL PRIVILEGES ON *.* TO '<user>'@'%' WITH GRANT OPTION;```
    ```mysql> GRANT ALL PRIVILEGES ON *.* TO '<user>'@'%' WITH GRANT OPTION;```
       <br>
       <br>
       This command allows you to login from any host/ip and gives you unlimited control over all databases.
       This command allows you to login from any host/ip and gives you unlimited control over all databases.
-   
+
    Check if you did everything well, so the user exists:
    Check if you did everything well, so the user exists:
    <br>
    <br>
    ```mysql> SHOW GRANTS FOR '<user>'@'%';```
    ```mysql> SHOW GRANTS FOR '<user>'@'%';```
@@ -69,30 +69,30 @@ Database setup, first steps
    ```mysql> exit```
    ```mysql> exit```
    <br>
    <br>
       This will exit you out from the mysql console.
       This will exit you out from the mysql console.
-   
+
 2. Create a user and database in your mysql server for the bot to use.
 2. Create a user and database in your mysql server for the bot to use.
-   
+
    You have two options now:
    You have two options now:
    <br>
    <br>
    <br>
    <br>
    a, Use phpmyadmin, where you can log in with the user which you created in point one and there
    a, Use phpmyadmin, where you can log in with the user which you created in point one and there
       create a new database and a new user, then grant that user rights over the database ..
       create a new database and a new user, then grant that user rights over the database ..
-   
+
    OR
    OR
-   
+
    b, Use the following commands:
    b, Use the following commands:
-   
+
    With your shell user, login to mysql with the previously created user:
    With your shell user, login to mysql with the previously created user:
    <br>
    <br>
    ```$ mysql -u <user> -p```
    ```$ mysql -u <user> -p```
    <br>
    <br>
       Here you will need to enter the password which you have given previous (`<pwhere>`).
       Here you will need to enter the password which you have given previous (`<pwhere>`).
    <br>
    <br>
-   
+
    ```mysql> CREATE DATABASE quotesdb;```
    ```mysql> CREATE DATABASE quotesdb;```
    <br>
    <br>
       This will create a database, named "quotesdb".
       This will create a database, named "quotesdb".
-   
+
    Now we need to create an other user for the bot.
    Now we need to create an other user for the bot.
    <br>
    <br>
    ```mysql> CREATE USER '<botnick>'@'localhost' IDENTIFIED BY '<botpwhere>';```
    ```mysql> CREATE USER '<botnick>'@'localhost' IDENTIFIED BY '<botpwhere>';```
@@ -102,15 +102,15 @@ Database setup, first steps
       to connect to mysql and make changes in database named "quotesdb".
       to connect to mysql and make changes in database named "quotesdb".
       <br>
       <br>
       For that, we need to set rights.
       For that, we need to set rights.
-      
+
    ```mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON quotesdb.* TO '<botnick>'@'localhost';```
    ```mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON quotesdb.* TO '<botnick>'@'localhost';```
    <br>
    <br>
       This will grant all right on db "quotesdb" to "botnick" user, connecting from localhost.
       This will grant all right on db "quotesdb" to "botnick" user, connecting from localhost.
-    
-    
+
+
    Now we are ready to move on to the next step. :)
    Now we are ready to move on to the next step. :)
-   
-   
+
+
 2. Now, you have to create the tables into the database which you made.
 2. Now, you have to create the tables into the database which you made.
    <br>
    <br>
    For this, you can download the pre-made script - you can find it in the sql folder, named "quotes.sql".
    For this, you can download the pre-made script - you can find it in the sql folder, named "quotes.sql".
@@ -140,7 +140,7 @@ Setting up the tcl script, edit the config(s)
    <br>
    <br>
       `"QuoteEngine 1.3 loaded"`
       `"QuoteEngine 1.3 loaded"`
     <br>
     <br>
-   In case you cannot see it, you did something wrong. Check again the guide. :) 
+   In case you cannot see it, you did something wrong. Check again the guide. :)
 
 
 
 
 Usage
 Usage

+ 8 - 8
QuoteEngine/www/index.php

@@ -40,7 +40,7 @@
 		$page = $_GET['page'];
 		$page = $_GET['page'];
 	}
 	}
 
 
-	
+
 	if (empty($channel)) {
 	if (empty($channel)) {
 	  $channel = DEFAULT_CHAN;
 	  $channel = DEFAULT_CHAN;
   }
   }
@@ -102,7 +102,7 @@ Filter for: <input type="text" name="filter" maxlength="32" size="32"> <input ty
   while ($chan = mysql_fetch_object($result)) {
   while ($chan = mysql_fetch_object($result)) {
           $chanlink = preg_replace("/#(.+)/", "\\1", $chan->channel);
           $chanlink = preg_replace("/#(.+)/", "\\1", $chan->channel);
           echo "<a href=\"" . $_SERVER['PHP_SELF']. "?channel=$chanlink\">$chan->channel</a> :: ";
           echo "<a href=\"" . $_SERVER['PHP_SELF']. "?channel=$chanlink\">$chan->channel</a> :: ";
-  } 
+  }
 ?>
 ?>
 		<a href="<?php echo $SERVER['PHP_SELF']; ?>?channel=__all">(All channels)</a> ::
 		<a href="<?php echo $SERVER['PHP_SELF']; ?>?channel=__all">(All channels)</a> ::
 </center>
 </center>
@@ -192,7 +192,7 @@ Sorted with most recent first.
           $q = preg_replace('/^\[?[0-9:.]+\]?/', '', $q);
           $q = preg_replace('/^\[?[0-9:.]+\]?/', '', $q);
 
 
           //$q = preg_replace('/^((&lt;|\\[|\\()*.*?)( )(.*?(&gt;|\\]|\\))+:?)/', "\\1&nbsp;\\4", $q);
           //$q = preg_replace('/^((&lt;|\\[|\\()*.*?)( )(.*?(&gt;|\\]|\\))+:?)/', "\\1&nbsp;\\4", $q);
-          
+
           //hilight nicks
           //hilight nicks
           if (!preg_match("/^\* /", $q)) {
           if (!preg_match("/^\* /", $q)) {
             if (preg_match('/^((&lt;|\\[|\\()*[@%+]?([^\]>\\\)]+?)[@%+]?(&gt;|\\]|\\))+:?)/', $q, $matches)) {
             if (preg_match('/^((&lt;|\\[|\\()*[@%+]?([^\]>\\\)]+?)[@%+]?(&gt;|\\]|\\))+:?)/', $q, $matches)) {
@@ -219,7 +219,7 @@ Sorted with most recent first.
           //$newquote .= preg_replace('/ /', "&nbsp;", $q);
           //$newquote .= preg_replace('/ /', "&nbsp;", $q);
           $newquote .= $q;
           $newquote .= $q;
           $newquote .= "<br>";
           $newquote .= "<br>";
-        }      
+        }
         $quote_text = preg_replace('/ \| /', "<br>", $quote_text);
         $quote_text = preg_replace('/ \| /', "<br>", $quote_text);
         echo "<td class=\"quote\">" . $newquote . "</td>";
         echo "<td class=\"quote\">" . $newquote . "</td>";
         echo "</tr>";
         echo "</tr>";
@@ -229,7 +229,7 @@ Sorted with most recent first.
         echo $quote->quote . "\n";
         echo $quote->quote . "\n";
       }
       }
     }
     }
-		
+
     if (!$remote) {
     if (!$remote) {
       echo "</table>";
       echo "</table>";
       echo "$count results<br>";
       echo "$count results<br>";
@@ -273,7 +273,7 @@ Sorted with most recent first.
     }
     }
 	}
 	}
 	else echo "oops: no results<br>" . mysql_error();
 	else echo "oops: no results<br>" . mysql_error();
-  
+
   if ($remote) {
   if ($remote) {
     exit;
     exit;
   }
   }
@@ -300,7 +300,7 @@ Sorted with most recent first.
           $q = preg_replace('/^\[?[0-9:.]+\]?/', '', $q);
           $q = preg_replace('/^\[?[0-9:.]+\]?/', '', $q);
 
 
           //$q = preg_replace('/^((&lt;|\\[|\\()*.*?)( )(.*?(&gt;|\\]|\\))+:?)/', "\\1&nbsp;\\4", $q);
           //$q = preg_replace('/^((&lt;|\\[|\\()*.*?)( )(.*?(&gt;|\\]|\\))+:?)/', "\\1&nbsp;\\4", $q);
-          
+
           //hilight nicks
           //hilight nicks
           if (!preg_match("/^\* /", $q)) {
           if (!preg_match("/^\* /", $q)) {
             $q = preg_replace('/^((&lt;|\\[|\\()*[^\]>\\\)]+?(&gt;|\\]|\\))+:?)/', "<b>\\1</b>", $q);
             $q = preg_replace('/^((&lt;|\\[|\\()*[^\]>\\\)]+?(&gt;|\\]|\\))+:?)/', "<b>\\1</b>", $q);
@@ -310,7 +310,7 @@ Sorted with most recent first.
           }
           }
           $newquote .= $q;
           $newquote .= $q;
           $newquote .= "<br>";
           $newquote .= "<br>";
-        }      
+        }
 				?>
 				?>
 					<?=$newquote?><br><br>
 					<?=$newquote?><br><br>
 					<div class="meta">
 					<div class="meta">

+ 1 - 1
QuoteEngine/www/settings.example.inc

@@ -21,7 +21,7 @@
 	// The stylesheet to use
 	// The stylesheet to use
 	// styles.css or ocean.css
 	// styles.css or ocean.css
 	// Or your own, if you're super-clever
 	// Or your own, if you're super-clever
-	define("QUOTES_CSS", "styles.css"); 
+	define("QUOTES_CSS", "styles.css");
 
 
 	// Change 'false' to 'true' below!
 	// Change 'false' to 'true' below!
 	define("SETTINGS_EDITED", false);
 	define("SETTINGS_EDITED", false);

+ 51 - 51
TopicEngine/TopicEngine.tcl

@@ -18,7 +18,7 @@
 #      Credit to : Dan Durrans, for coming up with the idea and feature list
 #      Credit to : Dan Durrans, for coming up with the idea and feature list
 #                  #exeter and #ags people for testing it
 #                  #exeter and #ags people for testing it
 #
 #
-# 
+#
 
 
 ###############################################################################
 ###############################################################################
 # TopicEngine - a topic management TCL script for eggdrops
 # TopicEngine - a topic management TCL script for eggdrops
@@ -26,16 +26,16 @@
 #
 #
 # This program is free software; you can redistribute it and/or modify
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 # (at your option) any later version.
 #
 #
-# This program is distributed in the hope that it will be useful, but 
-# WITHOUT ANY WARRANTY; without even the implied warranty of 
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 # General Public License for more details.
 # General Public License for more details.
 #
 #
-# You should have received a copy of the GNU General Public License 
-# along with this program; if not, write to the Free Software 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 ###############################################################################
 ###############################################################################
 
 
@@ -126,14 +126,14 @@ proc topicInitArray { {loaded 0} } {
       #set topicInfo($chan,needVGlobal) 0
       #set topicInfo($chan,needVGlobal) 0
       #set topicInfo($chan,needOMode) 1
       #set topicInfo($chan,needOMode) 1
       #set topicInfo($chan,needVMode) 0
       #set topicInfo($chan,needVMode) 0
-      #set topicInfo($chan,Tflag) 1 
+      #set topicInfo($chan,Tflag) 1
       set topicInfo($chan,canFlags) "o|ov"
       set topicInfo($chan,canFlags) "o|ov"
       set topicInfo($chan,canModes) "ov"
       set topicInfo($chan,canModes) "ov"
       set topicInfo($chan,cantFlags) "T"
       set topicInfo($chan,cantFlags) "T"
       set topicInfo($chan,topicBits) [list]
       set topicInfo($chan,topicBits) [list]
       set topicInfo($chan,learnOnChange) 1
       set topicInfo($chan,learnOnChange) 1
       set topicInfo($chan,initialised) "1"
       set topicInfo($chan,initialised) "1"
-      
+
       #DO NOT CHANGE THESE
       #DO NOT CHANGE THESE
       set topicInfo($chan,topic) ""
       set topicInfo($chan,topic) ""
       set topicInfo($chan,whoSet) [list]
       set topicInfo($chan,whoSet) [list]
@@ -145,9 +145,9 @@ proc topicInitArray { {loaded 0} } {
       if {$loaded == 0} {
       if {$loaded == 0} {
         #sync the topics if we're online
         #sync the topics if we're online
         catch {
         catch {
-          if {[lsearch $onChannels $chan] >= 0} { 
+          if {[lsearch $onChannels $chan] >= 0} {
             #putlog "Updating topic in $chan"
             #putlog "Updating topic in $chan"
-            setTopic $chan 
+            setTopic $chan
           }
           }
           set blah 0
           set blah 0
         } err
         } err
@@ -160,14 +160,14 @@ proc topicInitArray { {loaded 0} } {
           #set topicInfo($chan,needVGlobal) 0
           #set topicInfo($chan,needVGlobal) 0
           #set topicInfo($chan,needOMode) 1
           #set topicInfo($chan,needOMode) 1
           #set topicInfo($chan,needVMode) 0
           #set topicInfo($chan,needVMode) 0
-          #set topicInfo($chan,Tflag) 1 
+          #set topicInfo($chan,Tflag) 1
           set topicInfo($chan,canFlags) "o|ov"
           set topicInfo($chan,canFlags) "o|ov"
           set topicInfo($chan,canModes) "ov"
           set topicInfo($chan,canModes) "ov"
           set topicInfo($chan,cantFlags) "T"
           set topicInfo($chan,cantFlags) "T"
           set topicInfo($chan,topicBits) [list]
           set topicInfo($chan,topicBits) [list]
           set topicInfo($chan,learnOnChange) 1
           set topicInfo($chan,learnOnChange) 1
           set topicInfo($chan,initialised) "1"
           set topicInfo($chan,initialised) "1"
-          
+
           #DO NOT CHANGE THESE
           #DO NOT CHANGE THESE
           set topicInfo($chan,topic) ""
           set topicInfo($chan,topic) ""
           set topicInfo($chan,whoSet) [list]
           set topicInfo($chan,whoSet) [list]
@@ -191,7 +191,7 @@ proc topicInitArray { {loaded 0} } {
         #load a bot-specific file
         #load a bot-specific file
         source "${topicConfigPath}/TopicEngineSettings_${botnet-nick}.tcl"
         source "${topicConfigPath}/TopicEngineSettings_${botnet-nick}.tcl"
       }
       }
-    }    
+    }
   }
   }
 }
 }
 
 
@@ -199,7 +199,7 @@ proc topicInitArray { {loaded 0} } {
 
 
 #####
 #####
 # checkTopic
 # checkTopic
-# 
+#
 # Tries out a new topic (=current topic | newbit)
 # Tries out a new topic (=current topic | newbit)
 # returns 0 if it'll fit in the network topic length limit
 # returns 0 if it'll fit in the network topic length limit
 # else returns the number of characters over the limit
 # else returns the number of characters over the limit
@@ -217,7 +217,7 @@ proc checkTopic {channel newbit {noOldTopic 0}} {
   }
   }
 
 
   if {$newbit != ""} { lappend thisTopic $newbit }
   if {$newbit != ""} { lappend thisTopic $newbit }
-  
+
   if {$topicInfo($channel,leadIn) != ""} {
   if {$topicInfo($channel,leadIn) != ""} {
     set thisTopic [linsert $thisTopic 0 $topicInfo($channel,leadIn)]
     set thisTopic [linsert $thisTopic 0 $topicInfo($channel,leadIn)]
   }
   }
@@ -279,8 +279,8 @@ proc setTopic {channel {force 0}} {
     return 0
     return 0
   }
   }
 
 
-  set thisTopic $topicInfo($channel,topicBits)  
-  
+  set thisTopic $topicInfo($channel,topicBits)
+
   ##leadin and leadout
   ##leadin and leadout
   if {$topicInfo($channel,leadIn) != ""} {
   if {$topicInfo($channel,leadIn) != ""} {
     putloglev 1 * "topicengine: adding prefix"
     putloglev 1 * "topicengine: adding prefix"
@@ -319,11 +319,11 @@ proc setTopic {channel {force 0}} {
 
 
   set topicInfo($channel,topic) $topicString
   set topicInfo($channel,topic) $topicString
   if {([topic $channel] == $topicString) && ($force == 0)} { return 0 }
   if {([topic $channel] == $topicString) && ($force == 0)} { return 0 }
-  if {$force == -1} { 
+  if {$force == -1} {
     #just update the topic cache
     #just update the topic cache
-    return 0 
+    return 0
   }
   }
-  
+
   putserv "TOPIC $channel :$topicString"
   putserv "TOPIC $channel :$topicString"
   set bufferDirty 0
   set bufferDirty 0
   return 0
   return 0
@@ -339,7 +339,7 @@ proc setTopic {channel {force 0}} {
 #
 #
 proc topicChanged {nick host handle channel text} {
 proc topicChanged {nick host handle channel text} {
   global topicInfo topicChannels
   global topicInfo topicChannels
-  
+
   #check the topic script is active in here
   #check the topic script is active in here
   if {![channel get $channel topicengine]} {
   if {![channel get $channel topicengine]} {
     return 0
     return 0
@@ -362,8 +362,8 @@ proc topicChanged {nick host handle channel text} {
 
 
   #if it's a bot setting the topic, ignore it
   #if it's a bot setting the topic, ignore it
   if [matchattr $handle b] { return 0 }
   if [matchattr $handle b] { return 0 }
-  
-  if {[lindex $topicInfo($channel,lock) 0] == 0} { 
+
+  if {[lindex $topicInfo($channel,lock) 0] == 0} {
     #learn it?
     #learn it?
     if {$topicInfo($channel,learnOnChange) == 1} {
     if {$topicInfo($channel,learnOnChange) == 1} {
       putlog "Topic in $channel changed, learning it"
       putlog "Topic in $channel changed, learning it"
@@ -371,7 +371,7 @@ proc topicChanged {nick host handle channel text} {
       backupTopic $channel
       backupTopic $channel
       topicParse $channel $text $nick
       topicParse $channel $text $nick
     }
     }
-    return 0 
+    return 0
   }
   }
 
 
   #it's locked, put it back and notify
   #it's locked, put it back and notify
@@ -410,7 +410,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
   set text [string trim $text]
   set text [string trim $text]
 
 
   incr loops
   incr loops
-  if {$loops > 5} { 
+  if {$loops > 5} {
     set loops 0
     set loops 0
     putlog "TopicEngine internal error: recursive looping. Aborting processing of this command."
     putlog "TopicEngine internal error: recursive looping. Aborting processing of this command."
     return 0
     return 0
@@ -418,12 +418,12 @@ proc topicCommand {nick host handle channel text {silent 0} } {
 
 
   #this is because the array isn't initialised when the bot first starts
   #this is because the array isn't initialised when the bot first starts
   topicInitArray 1
   topicInitArray 1
-  
+
   #these commands can be used by anyone
   #these commands can be used by anyone
 ################# INFO
 ################# INFO
   if [regexp -nocase "^info ?(.+)?" $text boom param] {
   if [regexp -nocase "^info ?(.+)?" $text boom param] {
     set loops 0
     set loops 0
-    if {$param == ""} { 
+    if {$param == ""} {
       set updateTime [clock format $topicInfo($channel,whenLastSet)]
       set updateTime [clock format $topicInfo($channel,whenLastSet)]
       if {[lindex $topicInfo($channel,lock) 0] != 0} {
       if {[lindex $topicInfo($channel,lock) 0] != 0} {
         set whoLocked [lindex $topicInfo($channel,lock) 1]
         set whoLocked [lindex $topicInfo($channel,lock) 1]
@@ -527,7 +527,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
 
 
   #these commands need permissions
   #these commands need permissions
   set canTopic 0
   set canTopic 0
-  
+
   #first we need to check global O and V
   #first we need to check global O and V
   #if {($topicInfo($channel,needOGlobal) == 1) && [matchattr $handle o]} { set canTopic 1 }
   #if {($topicInfo($channel,needOGlobal) == 1) && [matchattr $handle o]} { set canTopic 1 }
   #if {($topicInfo($channel,needVGlobal) == 1) && [matchattr $handle v]} { set canTopic 1 }
   #if {($topicInfo($channel,needVGlobal) == 1) && [matchattr $handle v]} { set canTopic 1 }
@@ -548,7 +548,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
   #if {($topicInfo($channel,Tflag) == 1) && [matchattr $handle -|T $channel]} { set canTopic 1 }
   #if {($topicInfo($channel,Tflag) == 1) && [matchattr $handle -|T $channel]} { set canTopic 1 }
 
 
   #New system: using channel settings
   #New system: using channel settings
-  
+
   # First we check canFlags, if the user has these eggdrop flags we'll allow use
   # First we check canFlags, if the user has these eggdrop flags we'll allow use
   if [matchattr $handle $topicInfo($channel,canFlags) $channel] {
   if [matchattr $handle $topicInfo($channel,canFlags) $channel] {
     putloglev d * "topicEngine: user $handle matches flags"
     putloglev d * "topicEngine: user $handle matches flags"
@@ -606,7 +606,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
       set bufferDirty 1
       set bufferDirty 1
       set doBuffer 1
       set doBuffer 1
     }
     }
-    
+
     global backupInfo
     global backupInfo
 
 
     if {$backupInfo($channel,topicBits) == ""} {
     if {$backupInfo($channel,topicBits) == ""} {
@@ -628,7 +628,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
     } else {
     } else {
       setTopic $channel -1
       setTopic $channel -1
     }
     }
-  
+
     return 1
     return 1
   }
   }
 
 
@@ -655,7 +655,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
     #remove extra spaces
     #remove extra spaces
     set params [string trim $params]
     set params [string trim $params]
     regsub -all "  +" $params " " params
     regsub -all "  +" $params " " params
-   
+
     #check length
     #check length
     set tooMany [checkTopic $channel $params]
     set tooMany [checkTopic $channel $params]
     if {$tooMany} {
     if {$tooMany} {
@@ -701,7 +701,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
     #remove extra spaces
     #remove extra spaces
     set params [string trim $params]
     set params [string trim $params]
     regsub -all "  +" $params " " params
     regsub -all "  +" $params " " params
-   
+
     #check length
     #check length
     set tooMany [checkTopic $channel $params]
     set tooMany [checkTopic $channel $params]
     set originalTopicBits $topicInfo($channel,topicBits)
     set originalTopicBits $topicInfo($channel,topicBits)
@@ -721,7 +721,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
         set topicInfo($channel,topicWhen) $originalTopicWhen
         set topicInfo($channel,topicWhen) $originalTopicWhen
         return 2
         return 2
       }
       }
-      
+
       set tooMany [checkTopic $channel $params]
       set tooMany [checkTopic $channel $params]
       incr count
       incr count
       if {$count == 100} {
       if {$count == 100} {
@@ -768,7 +768,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
     #remove extra spaces
     #remove extra spaces
     set params [string trim $params]
     set params [string trim $params]
     regsub -all "  +" $params " " params
     regsub -all "  +" $params " " params
-   
+
     #check length
     #check length
     set tooMany [checkTopic $channel $params]
     set tooMany [checkTopic $channel $params]
     set originalTopicBits $topicInfo($channel,topicBits)
     set originalTopicBits $topicInfo($channel,topicBits)
@@ -789,7 +789,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
         set topicInfo($channel,topicWhen) $originalTopicWhen
         set topicInfo($channel,topicWhen) $originalTopicWhen
         return 2
         return 2
       }
       }
-      
+
       set tooMany [checkTopic $channel $params]
       set tooMany [checkTopic $channel $params]
       incr count
       incr count
       if {$count == 100} {
       if {$count == 100} {
@@ -831,7 +831,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
           topicNotice "Sorry, adding that to the topic would make it go over the length limit by $tooMany characters. Please try a shorter topic."
           topicNotice "Sorry, adding that to the topic would make it go over the length limit by $tooMany characters. Please try a shorter topic."
           return 1
           return 1
         }
         }
-        set topicInfo($channel,leadIn) $what      
+        set topicInfo($channel,leadIn) $what
         setTopic $channel
         setTopic $channel
         return 1
         return 1
       }
       }
@@ -849,7 +849,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
     }
     }
 
 
     #else set the topic as is
     #else set the topic as is
-    if {$cmdString == "none"} { 
+    if {$cmdString == "none"} {
       set cmdString ""
       set cmdString ""
     }
     }
 
 
@@ -876,7 +876,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
     #remove extra spaces
     #remove extra spaces
     set cmdString [string trim $cmdString]
     set cmdString [string trim $cmdString]
     regsub -all "  +" $cmdString " " cmdString
     regsub -all "  +" $cmdString " " cmdString
-    
+
     backupTopic $channel
     backupTopic $channel
 
 
     set topicInfo($channel,whoSet) [list $nick]
     set topicInfo($channel,whoSet) [list $nick]
@@ -1156,7 +1156,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
     return 1
     return 1
   }
   }
 
 
-  
+
   ##If we got here, they used the command wrong
   ##If we got here, they used the command wrong
   # assume they meant set, and tell them how to get help
   # assume they meant set, and tell them how to get help
 
 
@@ -1167,7 +1167,7 @@ proc topicCommand {nick host handle channel text {silent 0} } {
     topicNotice "\[FYI\] For help on the !topic commands, please do \002/msg $botnick topic help\002."
     topicNotice "\[FYI\] For help on the !topic commands, please do \002/msg $botnick topic help\002."
     return 1
     return 1
   }
   }
-    
+
   #topicCommand $nick $host $handle $channel "set $text"
   #topicCommand $nick $host $handle $channel "set $text"
 
 
   global botnick
   global botnick
@@ -1315,7 +1315,7 @@ proc topicHelp {nick host handle arg} {
 #
 #
 proc topicUnsplit {nick host handle channel} {
 proc topicUnsplit {nick host handle channel} {
   global topicInfo topicChannels topicLastSplit topicSplitChans topicSplitDirty
   global topicInfo topicChannels topicLastSplit topicSplitChans topicSplitDirty
-  
+
   #check the topic script is active in here
   #check the topic script is active in here
   if {![channel get $channel topicengine]} {
   if {![channel get $channel topicengine]} {
     return 0
     return 0
@@ -1329,7 +1329,7 @@ proc topicUnsplit {nick host handle channel} {
 
 
 	putloglev d * "topicengine: last split time updated to $topicLastSplit ([clock format $topicLastSplit])"
 	putloglev d * "topicengine: last split time updated to $topicLastSplit ([clock format $topicLastSplit])"
 	putloglev d * "topicengine: dirty chans due to split: $topicSplitChans"
 	putloglev d * "topicengine: dirty chans due to split: $topicSplitChans"
-  
+
   return 0
   return 0
 }
 }
 
 
@@ -1345,7 +1345,7 @@ proc topicJoin {nick host handle channel mode victim} {
 
 
   #only do this if I've joined a channel
   #only do this if I've joined a channel
   if [isbotnick $victim] {
   if [isbotnick $victim] {
-      
+
     #check the topic script is active in here
     #check the topic script is active in here
     if {![channel get $channel topicengine]} {
     if {![channel get $channel topicengine]} {
       return 0
       return 0
@@ -1404,7 +1404,7 @@ proc topicParse {channel topic nick} {
 
 
   while {[string match "*$topicSeparator*" $topic]} {
   while {[string match "*$topicSeparator*" $topic]} {
     set sentence [string range $topic 0 [expr [string first $topicSeparator $topic] -1]]
     set sentence [string range $topic 0 [expr [string first $topicSeparator $topic] -1]]
-    if {$sentence != ""} { 
+    if {$sentence != ""} {
       if {$blah == 0} {
       if {$blah == 0} {
         set topicInfo($channel,topicBits) [list [string trim $sentence]]
         set topicInfo($channel,topicBits) [list [string trim $sentence]]
         set topicInfo($channel,whoSet) [list $nick]
         set topicInfo($channel,whoSet) [list $nick]
@@ -1418,7 +1418,7 @@ proc topicParse {channel topic nick} {
     }
     }
     set topic [string range $topic [expr [string first $topicSeparator $topic] +1] end]
     set topic [string range $topic [expr [string first $topicSeparator $topic] +1] end]
     incr loopCount
     incr loopCount
-    if {$loopCount > 10} { 
+    if {$loopCount > 10} {
       putlog "Couldn't get all of the topic"
       putlog "Couldn't get all of the topic"
       return 0
       return 0
     }
     }
@@ -1483,7 +1483,7 @@ proc topicBotCommand {fromBot cmd arg} {
 #
 #
 # update the topic automagically at 00:01 every day
 # update the topic automagically at 00:01 every day
 #
 #
-proc topicUpdate { min hour day month year } { 
+proc topicUpdate { min hour day month year } {
   global topicChannels
   global topicChannels
   putlog "topicEngine: auto-refreshing topics..."
   putlog "topicEngine: auto-refreshing topics..."
 
 
@@ -1492,7 +1492,7 @@ proc topicUpdate { min hour day month year } {
   }
   }
 
 
   return 0
   return 0
-} 
+}
 
 
 #####
 #####
 # topicNotice
 # topicNotice
@@ -1594,7 +1594,7 @@ proc topicCommandDCC {handle idx args} {
 }
 }
 
 
 #####
 #####
-# topicSplitCheck 
+# topicSplitCheck
 # handle splits intelligently
 # handle splits intelligently
 #
 #
 proc topicSplitCheck {hr min day month year} {
 proc topicSplitCheck {hr min day month year} {
@@ -1606,7 +1606,7 @@ proc topicSplitCheck {hr min day month year} {
 
 
 	set splitDiff [expr [clock seconds] - $topicLastSplit]
 	set splitDiff [expr [clock seconds] - $topicLastSplit]
 	putloglev 1 * "topicengine: checking for splits: diff between now and last split is $splitDiff sec"
 	putloglev 1 * "topicengine: checking for splits: diff between now and last split is $splitDiff sec"
-	
+
 	if {$splitDiff > 120} {
 	if {$splitDiff > 120} {
 		# redo topic in every chan
 		# redo topic in every chan
 		#don't do this is the setting is off
 		#don't do this is the setting is off

+ 13 - 13
TriviaEngine/TriviaEngine-sqlite.tcl

@@ -1,5 +1,5 @@
 # The trivia engine YAY
 # The trivia engine YAY
-# vim: foldmethod=marker:foldcolumn=2:foldmarker=<<<,>>>:sw=2:ts=2 
+# vim: foldmethod=marker:foldcolumn=2:foldmarker=<<<,>>>:sw=2:ts=2
 
 
 ### INIT <<<
 ### INIT <<<
 package require sqlite
 package require sqlite
@@ -91,7 +91,7 @@ set trivia_bmotion_bot "NoTopic"
 # Send a botnet command to the bmotion bot
 # Send a botnet command to the bmotion bot
 proc trivia_bmotion_send { command params } {
 proc trivia_bmotion_send { command params } {
 	global trivia_bmotion_bot
 	global trivia_bmotion_bot
-	
+
 	if {$trivia_bmotion_bot == ""} {
 	if {$trivia_bmotion_bot == ""} {
 		return 0
 		return 0
 	}
 	}
@@ -128,7 +128,7 @@ proc trivia_msg { nick host handle cmd } {
 			set category [trivia_sqlite_escape $category]
 			set category [trivia_sqlite_escape $category]
 			set sql "SELECT cat_id FROM categories WHERE cat_name='$category'"
 			set sql "SELECT cat_id FROM categories WHERE cat_name='$category'"
 			set cat_id 0
 			set cat_id 0
-			
+
 			set cat_id [trivia_db_handle eval $sql]
 			set cat_id [trivia_db_handle eval $sql]
 			if {$cat_id != ""} {
 			if {$cat_id != ""} {
 				puthelp "PRIVMSG $nick :Moving question $trivia_last_qid to category$trivia_c(purple) $category$trivia_c(off) ($cat_id)"
 				puthelp "PRIVMSG $nick :Moving question $trivia_last_qid to category$trivia_c(purple) $category$trivia_c(off) ($cat_id)"
@@ -178,7 +178,7 @@ proc trivia_msg { nick host handle cmd } {
 #<<< debug
 #<<< debug
 		if [regexp -nocase {^debug (.+)} $cmd matches func] {
 		if [regexp -nocase {^debug (.+)} $cmd matches func] {
 			global trivia_debug_mode
 			global trivia_debug_mode
-			
+
 			if {$trivia_debug_mode == 0} {
 			if {$trivia_debug_mode == 0} {
 				putquick "PRIVMSG $nick :Debug mode is disabled. Cannot use debug commands."
 				putquick "PRIVMSG $nick :Debug mode is disabled. Cannot use debug commands."
 				return 0
 				return 0
@@ -243,7 +243,7 @@ proc trivia_msg { nick host handle cmd } {
 					trivia_db_handle eval $sql result {
 					trivia_db_handle eval $sql result {
 						set question_id $result(question_id)
 						set question_id $result(question_id)
 					}
 					}
-					
+
 					if {$question_id == 0} {
 					if {$question_id == 0} {
 						putserv "PRIVMSG $nick :I can't seem to find that report, sorry :("
 						putserv "PRIVMSG $nick :I can't seem to find that report, sorry :("
 						return 0
 						return 0
@@ -408,7 +408,7 @@ proc trivia_correct { nick } {
 	trivia_bmotion_send "winner" "$nick $answer"
 	trivia_bmotion_send "winner" "$nick $answer"
 	if {$newuser == 1} {
 	if {$newuser == 1} {
 	  putquick "PRIVMSG $trivia_channel :Welcome to our newest player,  $trivia_c(purple)$nick$trivia_c(off) :)"
 	  putquick "PRIVMSG $trivia_channel :Welcome to our newest player,  $trivia_c(purple)$nick$trivia_c(off) :)"
-	}	
+	}
 	putquick "PRIVMSG $trivia_channel :Rankings: [trivia_near_five3 $uid]"
 	putquick "PRIVMSG $trivia_channel :Rankings: [trivia_near_five3 $uid]"
 
 
 	set leader [trivia_leader]
 	set leader [trivia_leader]
@@ -914,7 +914,7 @@ proc trivia_get_question { } {
 
 
 		set trivia_q_question [string trim $trivia_q_question]
 		set trivia_q_question [string trim $trivia_q_question]
 		set trivia_q_answer [string trim $trivia_q_answer]
 		set trivia_q_answer [string trim $trivia_q_answer]
-	} 
+	}
 
 
 	if {$trivia_q_id == ""} {
 	if {$trivia_q_id == ""} {
 		return
 		return
@@ -1295,7 +1295,7 @@ proc trivia_get_rank { uid } {
 	set sql "SELECT user_id FROM users ORDER by user_score DESC"
 	set sql "SELECT user_id FROM users ORDER by user_score DESC"
 	set dt [trivia_get_period]
 	set dt [trivia_get_period]
 	set sql "select user_id, count(dt) as d from scores where dt > $dt group by user_id order by d desc"
 	set sql "select user_id, count(dt) as d from scores where dt > $dt group by user_id order by d desc"
-	
+
 	set pos 0
 	set pos 0
 	trivia_db_handle eval $sql {
 	trivia_db_handle eval $sql {
 		incr pos
 		incr pos
@@ -1622,7 +1622,7 @@ proc trivia_near_five3 { uid } {
 			append output " $entry "
 			append output " $entry "
 		}
 		}
 	}
 	}
-	
+
 	putlog $output
 	putlog $output
 	return $output
 	return $output
 
 
@@ -1805,10 +1805,10 @@ proc trivia_score_winners { } {
 	set now [clock seconds]
 	set now [clock seconds]
 
 
 	set updates [list]
 	set updates [list]
-	
+
 	#knock off a week
 	#knock off a week
 	set cutoff [expr $now - 604800]
 	set cutoff [expr $now - 604800]
-	
+
 	set sql "SELECT user_id, COUNT(*) AS score FROM scores WHERE dt > $cutoff GROUP BY user_id ORDER BY score DESC LIMIT 5"
 	set sql "SELECT user_id, COUNT(*) AS score FROM scores WHERE dt > $cutoff GROUP BY user_id ORDER BY score DESC LIMIT 5"
 	putloglev d * $sql
 	putloglev d * $sql
 
 
@@ -1825,7 +1825,7 @@ proc trivia_score_winners { } {
 			lappend winner_name [list $user_name [lindex $winner 0] [lindex $winner 1]]
 			lappend winner_name [list $user_name [lindex $winner 0] [lindex $winner 1]]
 		}
 		}
 	}
 	}
-		
+
 	putlog $winners
 	putlog $winners
 	putlog $winner_name
 	putlog $winner_name
 
 
@@ -1880,7 +1880,7 @@ proc trivia_score_time_left { } {
 		putloglev d * [clock format $trivia_score_time]
 		putloglev d * [clock format $trivia_score_time]
 		return
 		return
 	}
 	}
-	
+
 	set diff [expr $trivia_score_time - $now]
 	set diff [expr $trivia_score_time - $now]
 	putloglev d * "trivia_score_time_left: difference is $diff seconds"
 	putloglev d * "trivia_score_time_left: difference is $diff seconds"
 
 

+ 1 - 1
TriviaEngine/TriviaEngine.tcl

@@ -210,7 +210,7 @@ proc trivia_correct { nick } {
 	putquick "PRIVMSG $trivia_channel :Congratulations $trivia_c(purple)$nick$trivia_c(off)! The answer was$trivia_c(purple) $answer$trivia_c(off)."
 	putquick "PRIVMSG $trivia_channel :Congratulations $trivia_c(purple)$nick$trivia_c(off)! The answer was$trivia_c(purple) $answer$trivia_c(off)."
 	if {$newuser == 1} {
 	if {$newuser == 1} {
 	  putquick "PRIVMSG $trivia_channel :Welcome to our newest player,  $trivia_c(purple)$nick$trivia_c(off) :)"
 	  putquick "PRIVMSG $trivia_channel :Welcome to our newest player,  $trivia_c(purple)$nick$trivia_c(off) :)"
-	}	
+	}
 	putquick "PRIVMSG $trivia_channel :rank0rs: [trivia_near_five2 $uid]"
 	putquick "PRIVMSG $trivia_channel :rank0rs: [trivia_near_five2 $uid]"
 
 
 	#set score [trivia_get_score $uid]
 	#set score [trivia_get_score $uid]

+ 0 - 1
TriviaEngine/schema.sql

@@ -41,4 +41,3 @@ user_id bigint(20) not null default '0',
 dt bigint(2) not null default '0',
 dt bigint(2) not null default '0',
 score int not null default '0'
 score int not null default '0'
 );
 );
-

+ 6 - 6
noIPhost/noiphost.tcl

@@ -10,15 +10,15 @@
 ## INSTRUCTIONS
 ## INSTRUCTIONS
 ###############################################################################
 ###############################################################################
 
 
-# This script bans users joining your channel with non-resolving hosts. Bans 
-# last for a day. (Change the 1440 in the line near the end of the script to 
+# This script bans users joining your channel with non-resolving hosts. Bans
+# last for a day. (Change the 1440 in the line near the end of the script to
 # change this).
 # change this).
-# 
+#
 # Users who are +o, +v, or +f in your bot (local or global) are left alone.
 # Users who are +o, +v, or +f in your bot (local or global) are left alone.
-# 
+#
 # Enable the 'noiphosts' flag for channels you want to protect.
 # Enable the 'noiphosts' flag for channels you want to protect.
 # --> .chanset #somechannel +noiphosts
 # --> .chanset #somechannel +noiphosts
-# 
+#
 # Enable the debug level on the partyline for some debug output
 # Enable the debug level on the partyline for some debug output
 # --> .console +d (to enable)
 # --> .console +d (to enable)
 # --> .console -d (to disable)
 # --> .console -d (to disable)
@@ -41,7 +41,7 @@ proc bancheck_join { nick host handle channel } {
 	}
 	}
 
 
   putloglev d * "noiphosts: join by $host to $channel"
   putloglev d * "noiphosts: join by $host to $channel"
-  
+
   #don't apply to friends, voices, ops
   #don't apply to friends, voices, ops
 	if {[matchattr $handle +fov|+fov $channel]} {
 	if {[matchattr $handle +fov|+fov $channel]} {
     putloglev d * "noiphosts: $nick is a friend"
     putloglev d * "noiphosts: $nick is a friend"