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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
stalix
Voice
Posts: 23 Joined: Tue Sep 13, 2005 6:06 pm
Post
by stalix » Sun Jan 01, 2006 8:30 am
Code: Select all
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.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sun Jan 01, 2006 9:35 am
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.
stalix
Voice
Posts: 23 Joined: Tue Sep 13, 2005 6:06 pm
Post
by stalix » Sun Jan 01, 2006 10:58 am
i make this but the "bye" takes the file of "hello"
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sun Jan 01, 2006 11:12 am
That because you're using dbfile in the bye proc, create another variable for example
and instead of
use
stalix
Voice
Posts: 23 Joined: Tue Sep 13, 2005 6:06 pm
Post
by stalix » Sun Jan 01, 2006 3:12 pm
dont work the eggdrop To continue use the DB of first TCL. :S
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Mon Jan 02, 2006 10:10 am
post your code and we might see what your doing wrong.
stalix
Voice
Posts: 23 Joined: Tue Sep 13, 2005 6:06 pm
Post
by stalix » Mon Jan 02, 2006 5:56 pm
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
hello.txt
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Mon Jan 02, 2006 7:10 pm
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).
stalix
Voice
Posts: 23 Joined: Tue Sep 13, 2005 6:06 pm
Post
by stalix » Tue Jan 03, 2006 7:50 am
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
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Tue Jan 03, 2006 10:22 am
I hope you finally understand after you see this, I really really hope so.
Code: Select all
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
}
stalix
Voice
Posts: 23 Joined: Tue Sep 13, 2005 6:06 pm
Post
by stalix » Tue Jan 03, 2006 12:30 pm
very thanks !