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.
Old posts that have not been replied to for several years.
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Fri Apr 04, 2003 5:18 am
You really could use some coffee! You forgot another character, this time the final } in the code.
Pitchat
Op
Posts: 122 Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:
Post
by Pitchat » Fri Apr 04, 2003 5:21 am
arf just saw it after i did the last post but this time no crashes but when i type my pub command nothing append no error and no display
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Fri Apr 04, 2003 5:27 am
The 'poemsdir' should be like: set poemsdir "c://precieuse//histoires" if I'm not wrong and the regsub line needs to be changed. It should look like:
Code: Select all
set poemsdir "c://precieuse//histoires"
set regline "c:/precieuse/histoires"
bind pub * !poems pub:poems
proc pub:poems {nick host handle channel text} {
catch { glob -type f $::poemsdir/* } poems
regsub -all "$::regline/" $poems "" poems
putserv "PRIVMSG $channel :\002Poems\002: $poems"
}
Once the game is over, the king and the pawn go back in the same box.
Pitchat
Op
Posts: 122 Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:
Post
by Pitchat » Fri Apr 04, 2003 5:43 am
still dont work
maybe i messed up with the last change
<Precieuse> [04:38] Tcl error [pub:poems]: can't read "poems": no such variable
this is what the script look like now
Code: Select all
set poemsdir "c://precieuse//histoires"
set regline "c:/precieuse/histoires"
set poemlimit 3
bind pub * !histoire pub:poems
proc pub:poems {nick host handle channel text} {
if {![file exists $::poemsdir]} {
putserv "PRIVMSG $channel :\002Error\002: $::poemsdir dose not exist."
return 0
}
proc pub:poems {nick host handle channel text} {
catch { glob -type f $::poemsdir/* } poems
regsub -all "$::regline/" $poems "" poems
putserv "PRIVMSG $channel :\002Poems\002: $poems"
}
set first [list]
foreach item $poems {
if {[llength $first] == $::poemlimit} {
putserv "PRIVMSG $channel :\002Histoires\002: [string trimright [join $first ", "] ", "]"
set first [list]
}
lappend fist $item
}
if {[llength $first]} {
putserv "PRIVMSG $channel :\002Histoires\002: [string trimright [join $first ", "] ", "]"
}
}
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Fri Apr 04, 2003 5:50 am
What the heck are you doing there?
Here is the final and working smoothly version of the code I've did:
Code: Select all
set poemsdir "c://precieuse//histoires"
bind pub * !poems pub:poems
proc pub:poems {nick host handle channel text} {
catch { glob -type f $::poemsdir/* } poems
regsub -all "//" $::poemsdir "/" regline
regsub -all "$::regline/" $poems "" poems
putserv "PRIVMSG $channel :\002Poems\002: $poems"
}
Once the game is over, the king and the pawn go back in the same box.
Pitchat
Op
Posts: 122 Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:
Post
by Pitchat » Fri Apr 04, 2003 5:58 am
thanks for everything
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Fri Apr 04, 2003 6:12 am
So it working or not?
Your welcome anyway..
Once the game is over, the king and the pawn go back in the same box.
Pitchat
Op
Posts: 122 Joined: Tue Feb 18, 2003 11:24 pm
Location: Hebertville Quebec Canada
Contact:
Post
by Pitchat » Fri Apr 04, 2003 12:53 pm
i did thank you and i am grateful for your patience and knowledge
to answer your question the script in its "basic version" works well
it is juste the part where i`d try to have it display one item per lines that i am unable to make it work and i know it is because of my lack of experience in tcl, i`m working on it
thanks again and dont let people like me down there are many more good people like me who want to learn and needs good teachers
Pitchat
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Fri Apr 04, 2003 12:58 pm
Hehe, I was kidding. I'm glad to hear I've helped you, somehow. Your welcome.
Once the game is over, the king and the pawn go back in the same box.
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Fri Apr 04, 2003 1:05 pm
A tip to all of you: glob -nocomplain
(look that up in the manual ;P)