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 

To keep in memory

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


Joined: 08 Apr 2008
Posts: 12

PostPosted: Tue Apr 08, 2008 1:11 pm    Post subject: To keep in memory Reply with quote

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
View user's profile Send private message Send e-mail
vigilant
Halfop


Joined: 05 Jan 2006
Posts: 48

PostPosted: Wed Apr 09, 2008 2:30 am    Post subject: Reply with quote

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
View user's profile Send private message
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