Changeset 41


Ignore:
Timestamp:
02/11/09 05:39:06 (3 years ago)
Author:
notopic
Message:

Add option to shrink multiple spaces down

File:
1 edited

Legend:

Unmodified
Added
Removed
  • QuoteEngine/QuoteEngine.tcl

    r40 r41  
    6767set quote_chanmax 5 
    6868 
     69# shrink multiple spaces to single spaces when fetching a quote? 
     70set quote_shrinkspaces 1 
     71 
    6972### code starts here (no need to edit stuff below currently) 
    7073#1.00 
     
    146149################################################################################ 
    147150proc quote_rand { nick host handle channel text } { 
    148   global db_handle quote_noflags 
     151  global db_handle quote_noflags quote_shrinkspaces 
    149152 
    150153  if {![channel get $channel quoteengine]} { 
     
    178181    set by [lindex $row 1] 
    179182    set when [clock format [lindex $row 5] -format "%Y/%m/%d %H:%M"] 
     183                catch { 
     184                        if {$quote_shrinkspaces == 1} { 
     185                                regsub -all "  +" $quote " " quote 
     186                        } 
     187                        set quote [stripcodes bcruag $quote] 
     188                } 
    180189 
    181190    puthelp "PRIVMSG $channel :\[\002$id\002\] $quote" 
     
    193202################################################################################ 
    194203proc quote_fetch { nick host handle channel text } { 
    195   global db_handle quote_noflags 
     204  global db_handle quote_noflags quote_shrinkspaces 
    196205 
    197206  if {![channel get $channel quoteengine]} { 
     
    224233                set quote [lindex $row 3] 
    225234                catch { 
     235                        if {$quote_shrinkspaces == 1} { 
     236                                regsub -all "  +" $quote " " quote 
     237                        } 
    226238                        set quote [stripcodes bcruag $quote] 
    227239                } 
Note: See TracChangeset for help on using the changeset viewer.