This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Checking for identical messages in proc

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Checking for identical messages in proc

Post by TCL_no_TK »

I'm looking for way to check for identical messages, example:

Code: Select all

proc my:message {text} {
global settings
 puthelp "PRIVMSG $settings(dest) :$text"
  return
}
I've thought about doing

Code: Select all

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:
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 :P its just the one proc i need to prevent identical messages from being sent.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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]
 }
}
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

thanks :D
Post Reply