Przeglądaj źródła

Switch tabs to spaces for TCL scripts

James Seward 6 lat temu
rodzic
commit
5ed79dffb8

+ 21 - 21
GuardChan/guardchan.tcl

@@ -31,26 +31,26 @@ bind join - *!*@* guardchan_join
 setudef flag guardchan
 
 proc guardchan_join { nick host handle channel } {
-  global guardchan_owner guardchan_ban
-
-  if {![channel get $channel guardchan]} {
-    return 0
-  }
-
-  if {$handle == "*"} {
-    if [botisop $channel] {
-			if {!$guardchan_ban} {
-				putkick $channel $nick "You are not permitted to be in here"
-				puthelp "PRIVMSG $guardchan_owner :Kicked $nick from $channel"
-			} else {
-				set ban [maskhost "$nick!$host"]
-				newchanban $channel $ban "guardchan" "Banned for not being in userfile"
-				puthelp "PRIVMSG $guardchan_owner :Banned $nick from $channel"
-			}
-      return 0
-    } else {
-      puthelp "PRIVMSG $guardchan_owner :HELP! $nick has joined $channel and I can't do anything about it :("
-      return 0
+    global guardchan_owner guardchan_ban
+
+    if {![channel get $channel guardchan]} {
+        return 0
+    }
+
+    if {$handle == "*"} {
+        if [botisop $channel] {
+            if {!$guardchan_ban} {
+                putkick $channel $nick "You are not permitted to be in here"
+                puthelp "PRIVMSG $guardchan_owner :Kicked $nick from $channel"
+            } else {
+                set ban [maskhost "$nick!$host"]
+                newchanban $channel $ban "guardchan" "Banned for not being in userfile"
+                puthelp "PRIVMSG $guardchan_owner :Banned $nick from $channel"
+            }
+            return 0
+        } else {
+            puthelp "PRIVMSG $guardchan_owner :HELP! $nick has joined $channel and I can't do anything about it :("
+            return 0
+        }
     }
-  }
 }

+ 37 - 37
HostClean/hostclean.tcl

@@ -2,51 +2,51 @@
 set seen_hostnames [list]
 
 proc load_hostnames { handle idx filename } {
-	global seen_hostnames
+    global seen_hostnames
 
-	set filehandle [open $filename "r"]
-	set line [gets $filehandle]
+    set filehandle [open $filename "r"]
+    set line [gets $filehandle]
 
-	set count 0
+    set count 0
 
-	while {![eof $filehandle]} {
-		set line [string trim $line]
-		set line "somenick!$line"
-		lappend seen_hostnames $line
-		incr count
-		set line [gets $filehandle]
-	}
+    while {![eof $filehandle]} {
+        set line [string trim $line]
+        set line "somenick!$line"
+        lappend seen_hostnames $line
+        incr count
+        set line [gets $filehandle]
+    }
 
-	putidx $idx "hostclean: loaded [llength $seen_hostnames] hostnames from cache"
+    putidx $idx "hostclean: loaded [llength $seen_hostnames] hostnames from cache"
 }
 
 
 proc hostclean { handle idx user } {
-	global seen_hostnames
-	set hostnames [getuser $user HOSTS]
-	putlog "hostclean: found [llength $hostnames] hosts for $user"
-	if {[llength $hostnames] > 0} {
-		foreach host $hostnames {
-			if [string match "-telnet*" $host] {
-				set seen 1
-				continue
-			}
-			set regexp_hostname [string map { . \\. * .+ ? . } $host]
-			regsub {\.\+!([a-zA-Z0-9_])} $regexp_hostname {.+!~?\1} regexp_hostname
-			regsub {\.\+!\.\+([a-zA-Z0-9_])} $regexp_hostname {.+!.*\1} regexp_hostname
-			set seen 0
-			foreach seen_host $seen_hostnames {
-				if [regexp -nocase $regexp_hostname $seen_host] {
-					set seen 1
-					break
-				}
-			}
-			if {!$seen} {
-			# XXX delete this host
-				putidx $idx ".-host $user $host"
-			}
-		}
-	}
+    global seen_hostnames
+    set hostnames [getuser $user HOSTS]
+    putlog "hostclean: found [llength $hostnames] hosts for $user"
+    if {[llength $hostnames] > 0} {
+        foreach host $hostnames {
+            if [string match "-telnet*" $host] {
+                set seen 1
+                continue
+            }
+            set regexp_hostname [string map { . \\. * .+ ? . } $host]
+            regsub {\.\+!([a-zA-Z0-9_])} $regexp_hostname {.+!~?\1} regexp_hostname
+            regsub {\.\+!\.\+([a-zA-Z0-9_])} $regexp_hostname {.+!.*\1} regexp_hostname
+            set seen 0
+            foreach seen_host $seen_hostnames {
+                if [regexp -nocase $regexp_hostname $seen_host] {
+                    set seen 1
+                    break
+                }
+            }
+            if {!$seen} {
+            # XXX delete this host
+                putidx $idx ".-host $user $host"
+            }
+        }
+    }
 }
 
 bind dcc n hostload load_hostnames

+ 40 - 40
ProxyCheck/proxycheck.tcl

@@ -28,8 +28,8 @@
 
 # space-separated list of RBLs to look in
 set proxycheck_rbls {
-  "cbl.abuseat.org"
-  "opm.blitzed.org"
+    "cbl.abuseat.org"
+    "opm.blitzed.org"
 }
 
 # time in minutes to ban for
@@ -55,63 +55,63 @@ set proxycheck_lastip ""
 
 # catch joins
 proc proxycheck_join { nick host handle channel } {
-  #check we're active
-  if {![channel get $channel proxycheck]} {
+#check we're active
+if {![channel get $channel proxycheck]} {
     return 0
-  }
+}
 
-  #don't apply to friends, voices, ops
-  if {[matchattr $handle fov|fov $channel]} {
-    return 0
+#don't apply to friends, voices, ops
+if {[matchattr $handle fov|fov $channel]} {
+return 0
   }
 
   #get the actual host
   regexp ".+@(.+)" $host matches newhost
   if [regexp {[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$} $newhost] {
-    #it's a numeric host, skip the lookup
-    proxycheck_check2 $newhost $newhost 1 $nick $newhost $channel
+  #it's a numeric host, skip the lookup
+      proxycheck_check2 $newhost $newhost 1 $nick $newhost $channel
   } else {
-    putloglev d * "proxycheck: doing dns lookup on $newhost to get IP"
-    dnslookup $newhost proxycheck_check2 $nick $newhost $channel
+      putloglev d * "proxycheck: doing dns lookup on $newhost to get IP"
+      dnslookup $newhost proxycheck_check2 $nick $newhost $channel
   }
 }
 
 # first callback (runs RBL checks)
 proc proxycheck_check2 { ip host status nick orighost channel } {
-  global proxycheck_rbls proxylookup_rbls
-
-  if {$status == 1} {
-    putloglev d * "proxycheck: $host resolves to $ip"
-
-    # reverse the IP
-    regexp {([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})} $ip matches a b c d
-    set newip "$d.$c.$b.$a"
-
-    # look it up in the rbls
-    foreach rbl $proxycheck_rbls {
-      putloglev d * "proxycheck: looking up $newip.$rbl"
-      dnslookup "$newip.$rbl" proxycheck_check3 $nick $host $channel $rbl
+    global proxycheck_rbls proxylookup_rbls
+
+    if {$status == 1} {
+        putloglev d * "proxycheck: $host resolves to $ip"
+
+        # reverse the IP
+        regexp {([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})} $ip matches a b c d
+        set newip "$d.$c.$b.$a"
+
+        # look it up in the rbls
+        foreach rbl $proxycheck_rbls {
+            putloglev d * "proxycheck: looking up $newip.$rbl"
+            dnslookup "$newip.$rbl" proxycheck_check3 $nick $host $channel $rbl
+        }
+    } else {
+        putlog "proxycheck: Couldn't resolve $host. (No further action taken.)"
     }
-  } else {
-    putlog "proxycheck: Couldn't resolve $host. (No further action taken.)"
-  }
 }
 
 # second callback (catches RBL results)
 proc proxycheck_check3 { ip host status nick orighost channel rbl } {
-  global proxycheck_bantime proxycheck_lastip
-
-  if {$status} {
-    if {$ip == $proxycheck_lastip} {
-      putloglev d * "proxycheck: $host = $ip appears in RBL $ip, but I've already seen this one."
-      return 0
+    global proxycheck_bantime proxycheck_lastip
+
+    if {$status} {
+        if {$ip == $proxycheck_lastip} {
+            putloglev d * "proxycheck: $host = $ip appears in RBL $ip, but I've already seen this one."
+            return 0
+        }
+        set proxycheck_lastip $ip
+        putloglev d * "proxycheck: got host $host = ip $ip from RBL $rbl ... banning"
+        putlog "proxycheck: $nick ($orighost) is listed in $rbl ... banning from $channel"
+        newchanban $channel "*@$orighost" "proxychk" "proxycheck: $rbl" $proxycheck_bantime
     }
-    set proxycheck_lastip $ip
-    putloglev d * "proxycheck: got host $host = ip $ip from RBL $rbl ... banning"
-		putlog "proxycheck: $nick ($orighost) is listed in $rbl ... banning from $channel"
-    newchanban $channel "*@$orighost" "proxychk" "proxycheck: $rbl" $proxycheck_bantime
-  }
-  #if we didn't get a host, they're not in RBL
+    #if we didn't get a host, they're not in RBL
 }
 
 putlog "proxycheck 1.11 by JamesOff loaded (checking [llength $proxycheck_rbls] RBLs)"

Plik diff jest za duży
+ 871 - 871
TopicEngine/TopicEngine.tcl


Plik diff jest za duży
+ 493 - 493
TriviaEngine/TriviaEngine-sqlite.tcl


Plik diff jest za duży
+ 538 - 538
TriviaEngine/TriviaEngine.tcl


+ 12 - 12
noIPhost/noiphost.tcl

@@ -35,24 +35,24 @@ setudef flag noiphosts
 
 #it all happens in here
 proc bancheck_join { nick host handle channel } {
-  #check we're active
-	if {![channel get $channel noiphosts]} {
-		return 0
-	}
+#check we're active
+if {![channel get $channel noiphosts]} {
+    return 0
+}
 
-  putloglev d * "noiphosts: join by $host to $channel"
+putloglev d * "noiphosts: join by $host to $channel"
 
-  #don't apply to friends, voices, ops
-	if {[matchattr $handle +fov|+fov $channel]} {
-    putloglev d * "noiphosts: $nick is a friend"
-    return 0
+#don't apply to friends, voices, ops
+if {[matchattr $handle +fov|+fov $channel]} {
+putloglev d * "noiphosts: $nick is a friend"
+return 0
   }
 
   #check host
   if [regexp {@([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})$} $host matches ip] {
-    putlog "noiphosts: $nick has an un-resolved host ($ip), banning"
-    set banhost "*@$ip"
-    newchanban $channel $banhost "noiphosts" "Non-resolving host" 1440
+      putlog "noiphosts: $nick has an un-resolved host ($ip), banning"
+      set banhost "*@$ip"
+      newchanban $channel $banhost "noiphosts" "Non-resolving host" 1440
   }
 }
 

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików