Changeset 38 for QuoteEngine
- Timestamp:
- 01/25/08 09:27:34 (4 years ago)
- File:
-
- 1 edited
-
QuoteEngine/QuoteEngine.tcl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
QuoteEngine/QuoteEngine.tcl
r37 r38 40 40 41 41 # minimum number of seconds between automatic quotes 42 set quote_automatic_minimum 720042 set quote_automatic_minimum [expr 3 * 3600] 43 43 44 44 # bind commands CHANGE as needed … … 219 219 if {[set row [mysqlnext $result]] != ""} { 220 220 set id [lindex $row 0] 221 set quote [lindex $row 3] 221 set quote [lindex $row 3] 222 catch { 223 set quote [stripcodes bcruag $quote] 224 } 222 225 set by [lindex $row 1] 223 226 set when [clock format [lindex $row 5] -format "%Y/%m/%d %H:%M"] … … 521 524 } 522 525 523 global quote_auto_last db_handle 526 global quote_auto_last db_handle quote_automatic_minimum 527 524 528 if [info exists quote_auto_last($channel)] { 525 529 set diff [expr [clock seconds] - $quote_auto_last($channel)] 530 putloglev 1 * "diff for $channel is $diff" 526 531 } else { 527 set diff 3601 532 set diff [expr $quote_automatic_minimum + 1] 533 putloglev d * "initialising diff for $channel" 528 534 set quote_auto_last($channel) 0 529 535 } 530 536 531 if {$diff < 3600} {537 if {$diff < $quote_automatic_minimum} { 532 538 return 533 539 } … … 537 543 538 544 foreach word $words { 539 if [regexp -nocase {^[a-z0-9'] +$} $word] {540 if {[lsearch [list " about" "their" "there"] $word] > -1} {545 if [regexp -nocase {^[a-z0-9']{4,}$} $word] { 546 if {[lsearch [list "yeah" "about" "hello" "their" "there" "that's" "can't" "morning" "won't"] $word] > -1} { 541 547 continue 542 548 } … … 546 552 } 547 553 548 if {[string length $word] > 4} { 549 lappend newwords [mysqlescape $word] 550 } 554 lappend newwords [mysqlescape $word] 551 555 } 552 556 }
Note: See TracChangeset
for help on using the changeset viewer.
