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.
hikaro
Halfop
Posts: 68 Joined: Wed Mar 10, 2004 4:29 am
Post
by hikaro » Wed Mar 10, 2004 4:35 am
on Me:*:join:#channel:/play #channel story.txt 10000
on 1:PLAYEND:{ if (%q8 = 1) { /play #channel story2.txt 10000 | set %q8 2 } | else { /play #channel story.txt 10000 | set %q8 1 } }
pls anyone help me convert this, coz i really need the tcl thanks =)
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Mar 10, 2004 1:22 pm
What does it do?
Have you ever read "The Manual"?
hikaro
Halfop
Posts: 68 Joined: Wed Mar 10, 2004 4:29 am
Post
by hikaro » Wed Mar 10, 2004 1:26 pm
it is for telling story to a channel so the script will read from story.txt and sopy to a channel line by line every 10 seconds
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Mar 10, 2004 1:47 pm
hikaro wrote: it is for telling story to a channel so the script will read from story.txt and sopy to a channel line by line every 10 seconds
Like
this ? (replace 'timer' with 'utimer', change the delay and call the proc with your channel name instead of a nick)
Have you ever read "The Manual"?
hikaro
Halfop
Posts: 68 Joined: Wed Mar 10, 2004 4:29 am
Post
by hikaro » Wed Mar 10, 2004 3:09 pm
i have try it but i dont think it works/.. can u give me the proper code... like converting the mirc script that i typed.
i dont know much tcl script so pls help me...
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Mar 10, 2004 5:00 pm
hikaro wrote: i have try it but i dont think it works/.. can u give me the proper code... like converting the mirc script that i typed.
i dont know much tcl script so pls help me...
In what way does it not work? My suggestion would result in a script that does exactly what you asked for.
Have you ever read "The Manual"?
hikaro
Halfop
Posts: 68 Joined: Wed Mar 10, 2004 4:29 am
Post
by hikaro » Wed Mar 10, 2004 7:17 pm
hikaro wrote: on Me:*:join:#channel:/play #channel story.txt 10000
on 1:PLAYEND:{ if (%q8 = 1) { /play #channel story2.txt 10000 | set %q8 2 } | else { /play #channel story.txt 10000 | set %q8 1 } }
pls anyone help me convert this, coz i really need the tcl thanks =)
can u just convert this script pls?
i really need this tcl, its for telling a story to channel repeatly. it will send line by line from story.txt in 10 seconds.
thx
Xpert
Halfop
Posts: 88 Joined: Mon Mar 08, 2004 7:03 am
Post
by Xpert » Thu Mar 11, 2004 11:33 am
Try this:
Code: Select all
bind join - * join:story
proc join:story {nick host hand chan} {
global botnick
if {$nick == $botnick} {
slowmsg "story.txt"
}
}
proc slowmsg {file {pos 0}} {
set f [open $file]
seek $f $pos
if {[gets $f line]>-1} {
putserv "privmsg #channel $line"
utimer 10 [list slowmsg $file [tell $f]]
} {
}
close $f
}
Hope it helps
Xpert.
hikaro
Halfop
Posts: 68 Joined: Wed Mar 10, 2004 4:29 am
Post
by hikaro » Thu Mar 11, 2004 1:02 pm
xpert it got error... i just read one word not all the whole sentence.
<hikpalsu> KISAHKU
<hikpalsu> Kisah
<hikpalsu> demi
<hikpalsu> Aku
do u know where's the error??
Xpert
Halfop
Posts: 88 Joined: Mon Mar 08, 2004 7:03 am
Post
by Xpert » Thu Mar 11, 2004 1:07 pm
Replace:
to:
Xpert.
hikaro
Halfop
Posts: 68 Joined: Wed Mar 10, 2004 4:29 am
Post
by hikaro » Thu Mar 11, 2004 1:15 pm
xpert it works!! but i want it repeat (loop) so when it gets to the last line it will go to the first line again.. can u add some code there pls
arcane
Master
Posts: 280 Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:
Post
by arcane » Thu Mar 11, 2004 1:44 pm
just add this line after "close $f"
although this is a bad solution. i'd suggest you to read the file into memory instead of opening/closing it every time.
btw: i guess my first action in this chan would be to ignore the bot
Xpert
Halfop
Posts: 88 Joined: Mon Mar 08, 2004 7:03 am
Post
by Xpert » Thu Mar 11, 2004 1:46 pm
Code: Select all
bind join - * join:story
proc join:story {nick host hand chan} {
global botnick
if {$nick == $botnick} {
slowmsg "story.txt"
}
}
proc slowmsg {file {pos 0}} {
set f [open $file]
seek $f $pos
if {[gets $f line]>-1} {
putserv "privmsg #channel $line"
utimer 10 [list slowmsg $file [tell $f]]
} else {
utimer 9 [list putserv "Re-reading the story:"]
utimer 10 [list slowmsg $file]
}
close $f
}
Xpert.
hikaro
Halfop
Posts: 68 Joined: Wed Mar 10, 2004 4:29 am
Post
by hikaro » Thu Mar 11, 2004 2:33 pm
it repeat line by line... not when they have reach last line go to first line
<Teraquad> 60
<Teraquad> 60
<Teraquad> 10
<Teraquad> 10
do u know why =(
arcane
Master
Posts: 280 Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:
Post
by arcane » Thu Mar 11, 2004 3:26 pm
have you tried my solution?
although it's bad (as noted) it should work.