| View previous topic :: View next topic |
| Author |
Message |
loulou7593 Voice
Joined: 08 Apr 2008 Posts: 12
|
Posted: Tue Apr 08, 2008 1:11 pm Post subject: To keep in memory |
|
|
hello I have a problem with a code,
This code is supposed when I type
! order MSG on my living room, Ca puts a new greeting message and when a person joined the living room Ca him sending a note with the message which I had put.
But for each .rehash and well it is necessary all to start again. to you there is a means of safeguarding the messages which I return?
here the code.
| Code: | bind pub - !welcome pub:welcome
proc pub:welcome {nick uhost hand channel text} {
global onjoin_msg
if {[validuser $hand] && ($text != "")} {
set onjoin_msg "$text"
putserv "NOTICE $nick :Nouveau message d'acceuil -> $text"
} else {
putserv "NOTICE $nick :Erreur..."
}
} |
And in more so that this code functions it is necessary I put another TCL with the following code.
| Code: | set onjoin_msg {
{
"Welcome to Channel \$chan \$nick"
}
}
set onjoin_chans "#BG® #eg-lovech"
bind join - * join_onjoin
putlog "Onjoin.tcl 0.1 by Banned loaded"
proc join_onjoin {nick uhost hand chan} {
global onjoin_msg onjoin_chans botnick
if {([lsearch -exact [string tolower $onjoin_chans] [string tolower $chan]] != -1) && (![matchattr $hand b]) && ($nick != $botnick)} {
puthelp "NOTICE $nick :[subst $onjoin_msg]"
}
} |
Thank you to say to me if I can gather these two code in only one, and that Ca can safeguard the messages so that after each .rehash Ca does not erase all.
Thank you |
|
| Back to top |
|
 |
vigilant Halfop
Joined: 05 Jan 2006 Posts: 48
|
Posted: Wed Apr 09, 2008 2:30 am Post subject: |
|
|
Use the file open and close TCL commands
It will be easy for you to do it that way, just save each message to the file and then open it again and you know that way..
There is a nice tutorial on that.
Just search for "file" or look in the tutorial forum.
Hope that helps. _________________ Anser Quraishi
Website: http://www.anserq.com |
|
| Back to top |
|
 |
|