| View previous topic :: View next topic |
| Author |
Message |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Sun Apr 27, 2008 2:56 pm Post subject: Checking for identical messages in proc |
|
|
I'm looking for way to check for identical messages, example: | Code: | proc my:message {text} {
global settings
puthelp "PRIVMSG $settings(dest) :$text"
return
} |
I've thought about doing | Code: | if {($::settings(lastmsg) != "$text")} {
set settings(lastmsg) "$text"
return
} | but not having much luck getting it to work. alot of the text contains color codes. incase that helps any.
I'm aware of the settings: | Quote: | set double-mode 0
Allow identical messages in the mode queue?
set double-server 0
Allow identical messages in the server queue?
set double-help 0
Allow identical messages in the help queue? | *sigh* as nice as it would be set these all to 1 its just the one proc i need to prevent identical messages from being sent. _________________ TCL the misunderstood |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Apr 27, 2008 4:29 pm Post subject: |
|
|
| Code: | proc my:message {text} {
global settings
if {![string equal -nocase [stripcodes bcruag $text] $settings(last)]} {
puthelp "PRIVMSG $settings(dest) :$text"
set settings(last) [stripcodes bcruag $text]
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
|
| Back to top |
|
 |
|