mIRC Home    About    Download    Register    News    Help

Print Thread
#135094 07/11/05 07:30 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ok, another question. I'm trying to make a script to play a text file to someone and let them get a screenful of text and then a [C]ontinue, [S]top choice. I know I could manage this with playing through an alias that does X number of lines at a time, but is there a better option? Some people don't like downloading a help/rules file and playing out a hundred lines or something like that isn't great if they only needed something off the first few lines. Any ideas?


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
I'm sure you can use the /play command. This does support pausing, but not in the sense what you're attempting to do. Though you could easily play, say the first 25 lines, then display the [C]ontinue and [S]top commands. If they decide to continue, play the next 25 and so on.

Last edited by nycdiesel; 07/11/05 07:50 PM.
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
use the topic play method
[section1]
blah
stuff and more blah
lots of stuff
[secion2]
important blah also
as well as more stuff
[]

/play -tsection1 who.nick filename speed

if they request more, play -tsection2 and so on

Joined: Oct 2004
Posts: 8,330
Riamus2 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Thanks guys. I think I'll just do like I was thinking and play X number of lines, then play the next if they press C. The topic method won't work very well without redoing the help files ... and I don't want to do that right now. smile


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
Personally, I'de use the /play command and play the specified amount of lines. Using a while loop will probably be slower. Though it's up to you.

Joined: Oct 2004
Posts: 8,330
Riamus2 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I don't think I said anything about using a while loop, did I?

I'm planning to /play a certain number of lines, then if they press C, I play the next set of lines, and so on until they either press S or finish the file.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
Ah okay, I just assumed ;P

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
looking forward to your solution on this, could be quite usefull

Joined: Oct 2004
Posts: 8,330
Riamus2 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Well, I was busy last night and didn't work on this at all, but I know how I'm doing it. Basically, I will set a variable to tell me that a person is viewing it. The variable will unset if nothing is done in X seconds. While the variable is set, it will only accept C or S commands. The /play will be through an alias that will play X lines and then issue /play stop and message the C or S choice. If C is pressed, the /play will again be called, using -f and a variable that is set to track the location we're in. It will then play X lins through the alias as previously. If S is done, or the file end is reached, it will unset all variables and accept all commands.

Once I take time to actually write it, I'll post it if you would like it. It's not going to really be that hard to write up. I was just looking for a simpler method. smile


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard