egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Checking for identical messages in proc

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sun Apr 27, 2008 2:56 pm    Post subject: Checking for identical messages in proc Reply with quote

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 Razz its just the one proc i need to prevent identical messages from being sent.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Apr 27, 2008 4:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sun Apr 27, 2008 6:27 pm    Post subject: Reply with quote

thanks Very Happy
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber