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.

Just a little modification

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
J
JohnJohnJohn
Voice
Posts: 20
Joined: Mon Sep 24, 2007 12:20 pm
Location: Philippines
Contact:

Just a little modification

Post by JohnJohnJohn »

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..
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

If you edited the script, and it then causes an error, it would be helpful to post your edited code..
J
JohnJohnJohn
Voice
Posts: 20
Joined: Mon Sep 24, 2007 12:20 pm
Location: Philippines
Contact:

Post by JohnJohnJohn »

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..
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Enclose your \n with "" and I believe the problem should go away. Ie:

Code: Select all

set join1 [split [read $file5] "\n"]
NML_375
J
JohnJohnJohn
Voice
Posts: 20
Joined: Mon Sep 24, 2007 12:20 pm
Location: Philippines
Contact:

Post by JohnJohnJohn »

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..
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
J
JohnJohnJohn
Voice
Posts: 20
Joined: Mon Sep 24, 2007 12:20 pm
Location: Philippines
Contact:

Post by JohnJohnJohn »

that was quick! thanks nml375 :) :) :)
watch your step. you might fall..
Post Reply