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 

Just a little modification

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


Joined: 24 Sep 2007
Posts: 20
Location: Philippines

PostPosted: Wed Oct 10, 2007 9:10 pm    Post subject: Just a little modification Reply with quote

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:
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..
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Wed Oct 10, 2007 11:13 pm    Post subject: Reply with quote

If you edited the script, and it then causes an error, it would be helpful to post your edited code..
Back to top
View user's profile Send private message
JohnJohnJohn
Voice


Joined: 24 Sep 2007
Posts: 20
Location: Philippines

PostPosted: Wed Oct 10, 2007 11:43 pm    Post subject: Reply with quote

oh sorry for that rosc2112.. anyway here's the code that i've edited.

Code:
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
Quote:
Tcl error [showgreet]: missing close-bracket


--hope ya can fix that for me Smile Smile
_________________
watch your step. you might fall..
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Oct 11, 2007 7:11 am    Post subject: Reply with quote

Enclose your \n with "" and I believe the problem should go away. Ie:
Code:
set join1 [split [read $file5] "\n"]

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
JohnJohnJohn
Voice


Joined: 24 Sep 2007
Posts: 20
Location: Philippines

PostPosted: Thu Oct 11, 2007 8:48 am    Post subject: Reply with quote

nml375 i changed it in that way as u've said but unfortunately i still encounter the same problem.. Sad Sad
_________________
watch your step. you might fall..
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Oct 11, 2007 8:57 am    Post subject: Reply with quote

Ahh, overlooked this line:
Code:
  utimer $greetime [list putserv "PRIVMSG $chan :[lindex $join1 [rand [llength $join1]]]]"


Brackets and quotes are not in proper order, should be like this:
Code:
  utimer $greetime [list putserv "PRIVMSG $chan :[lindex $join1 [rand [llength $join1]]]"]

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
JohnJohnJohn
Voice


Joined: 24 Sep 2007
Posts: 20
Location: Philippines

PostPosted: Thu Oct 11, 2007 9:48 pm    Post subject: Reply with quote

that was quick! thanks nml375 Smile Smile Smile
_________________
watch your step. you might fall..
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
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