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 

Script MSG Problem !

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
stalix
Voice


Joined: 13 Sep 2005
Posts: 23

PostPosted: Sun Jan 01, 2006 8:30 am    Post subject: Script MSG Problem ! Reply with quote

Code:

set dbfile "scripts/hello.txt"

bind pub - hello aleatory

proc aleatory {nick uhost hand chan arg} {
 global dbfile
 set r [lindex [set d [split [read [set f [open $dbfile]]] \n]] [rand [llength $d]]]
 puthelp "PRIVMSG $chan : $r"
 close $f
}


I have this scripts but i want have a similar script simultanion with this, i want hello and bye but in other file bye.txt. is possible?

thanks.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Jan 01, 2006 9:35 am    Post subject: Reply with quote

That's very simple since you already have everything done, just bind to bye, create a file for byes and a similar proc to the one you have for hello.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
stalix
Voice


Joined: 13 Sep 2005
Posts: 23

PostPosted: Sun Jan 01, 2006 10:58 am    Post subject: Reply with quote

i make this but the "bye" takes the file of "hello" Confused
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Jan 01, 2006 11:12 am    Post subject: Reply with quote

That because you're using dbfile in the bye proc, create another variable for example
Code:
set dbfile2 "scripts/bye.txt"

and instead of
Code:
[open $dbfile]

use
Code:
[open $dbfile2]

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
stalix
Voice


Joined: 13 Sep 2005
Posts: 23

PostPosted: Sun Jan 01, 2006 3:12 pm    Post subject: Reply with quote

Embarassed dont work the eggdrop To continue use the DB of first TCL. :S
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Mon Jan 02, 2006 10:10 am    Post subject: Reply with quote

post your code and we might see what your doing wrong.
Back to top
View user's profile Send private message
stalix
Voice


Joined: 13 Sep 2005
Posts: 23

PostPosted: Mon Jan 02, 2006 5:56 pm    Post subject: Reply with quote

Quote:

set dbfile2 "scripts/bye.txt"

bind pub - bye aleatory

proc aleatory {nick uhost hand chan arg} {
global dbfile
set r [lindex [set d [split [read [set f [open $dbfile2]]] \n]] [rand [llength $d]]]
puthelp "PRIVMSG $chan : $r"
close $f
}


and goes to first txt Crying or Very sad hello.txt Question
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Jan 02, 2006 7:10 pm    Post subject: Reply with quote

You have to change the name of the proc too (i.e. aleatory2 instead of aleatory) since you're still using aleatory for hello. Also, dbfile should be dbfile2 (in the global).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
stalix
Voice


Joined: 13 Sep 2005
Posts: 23

PostPosted: Tue Jan 03, 2006 7:50 am    Post subject: Reply with quote

Sir_Fz wrote:
You have to change the name of the proc too (i.e. aleatory2 instead of aleatory) since you're still using aleatory for hello. Also, dbfile should be dbfile2 (in the global).


i dont undersantd can modify the script ? thx
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Jan 03, 2006 10:22 am    Post subject: Reply with quote

I hope you finally understand after you see this, I really really hope so.
Code:
set dbfile "scripts/hello.txt"
set dbfile2 "scripts/bye.txt"

bind pub - hello aleatory
bind pub - bye aleatory2

proc aleatory {nick uhost hand chan arg} {
 global dbfile
 set r [lindex [set d [split [read [set f [open $dbfile]]] \n]] [rand [llength $d]]]
 puthelp "PRIVMSG $chan : $r"
 close $f
}

proc aleatory2 {nick uhost hand chan arg} {
 global dbfile2
 set r [lindex [set d [split [read [set f [open $dbfile2]]] \n]] [rand [llength $d]]]
 puthelp "PRIVMSG $chan : $r"
 close $f
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
stalix
Voice


Joined: 13 Sep 2005
Posts: 23

PostPosted: Tue Jan 03, 2006 12:30 pm    Post subject: Reply with quote

very thanks ! Laughing
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 -> Script Requests 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