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.

To keep in memory

Help for those learning Tcl or writing their own scripts.
Post Reply
l
loulou7593
Voice
Posts: 12
Joined: Tue Apr 08, 2008 12:52 pm

To keep in memory

Post by loulou7593 »

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: Select all

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: Select all

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
v
vigilant
Halfop
Posts: 48
Joined: Thu Jan 05, 2006 12:06 am

Post by vigilant »

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
Post Reply