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!
JohnJohnJohn
Voice
Posts: 20 Joined: Mon Sep 24, 2007 12:20 pm
Location: Philippines
Contact:
Post
by JohnJohnJohn » Wed Oct 10, 2007 9:10 pm
i tried to edit this code to pick random line in txt.file to greet specific nicks who joins the channel but it says that tcl error showgreet missing close bracket. Here is the untouched code.
--Not all users who join the channel are been greeted. Only those specified nick which are saved in tha patch.
Code: Select all
set patch "/usr/space/frozen/eggdrop"
set greetime "15"
bind join - * showgreet
proc showgreet {nick uhost hand chan} {
global patch greetime
if {[file exist /$patch/$nick.txt]} {
set file5 [open /$patch/$nick.txt r+]
gets $file5 text
close $file5
utimer $greetime [list putserv "PRIVMSG $chan :$text"]
}
}
watch your step. you might fall..
rosc2112
Revered One
Posts: 1454 Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania
Post
by rosc2112 » Wed Oct 10, 2007 11:13 pm
If you edited the script, and it then causes an error, it would be helpful to post your edited code..
JohnJohnJohn
Voice
Posts: 20 Joined: Mon Sep 24, 2007 12:20 pm
Location: Philippines
Contact:
Post
by JohnJohnJohn » Wed Oct 10, 2007 11:43 pm
oh sorry for that rosc2112.. anyway here's the code that i've edited.
Code: Select all
set patch "/usr/space/frozen/eggdrop"
set greetime "15"
bind join - * showgreet
proc showgreet {nick uhost hand chan} {
global patch greetime
if {[file exist /$patch/$nick.txt]} {
set file5 [open /$patch/$nick.txt r+]
set join1 [split [read $file5] \n]
close $file5
utimer $greetime [list putserv "PRIVMSG $chan :[lindex $join1 [rand [llength $join1]]]]"
}
}
And the error that i've encountered is
Tcl error [showgreet]: missing close-bracket
--hope ya can fix that for me
watch your step. you might fall..
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Thu Oct 11, 2007 7:11 am
Enclose your \n with "" and I believe the problem should go away. Ie:
Code: Select all
set join1 [split [read $file5] "\n"]
NML_375
JohnJohnJohn
Voice
Posts: 20 Joined: Mon Sep 24, 2007 12:20 pm
Location: Philippines
Contact:
Post
by JohnJohnJohn » Thu Oct 11, 2007 8:48 am
nml375 i changed it in that way as u've said but unfortunately i still encounter the same problem..
watch your step. you might fall..
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Thu Oct 11, 2007 8:57 am
Ahh, overlooked this line:
Code: Select all
utimer $greetime [list putserv "PRIVMSG $chan :[lindex $join1 [rand [llength $join1]]]]"
Brackets and quotes are not in proper order, should be like this:
Code: Select all
utimer $greetime [list putserv "PRIVMSG $chan :[lindex $join1 [rand [llength $join1]]]"]
NML_375
JohnJohnJohn
Voice
Posts: 20 Joined: Mon Sep 24, 2007 12:20 pm
Location: Philippines
Contact:
Post
by JohnJohnJohn » Thu Oct 11, 2007 9:48 pm
watch your step. you might fall..