|
Joined: Dec 2002
Posts: 83
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 83 |
I am trying to /play a file to users. The file uses identifiers and variables to give some information out.
on *:text:!help:?: {
play -ct $+ $2 $nick help.txt 1000
}
The help.txt file is sectioned into groups, so that someone can get '!help commands' or something like that. Again, the help.txt files has occurances like: 'Today is $date and the time is $time.' When someone types !help commands, mIRC spits out errors like: "-> *Welcome* to my help file No such nick/channel" So I suspect it's trying to send the message to whatever the first word of each line is. Any way to correct this?
|
|
|
|
Joined: Dec 2002
Posts: 191
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 191 |
you could use /debug -pt @debug to see what it sending to the server.
|
|
|
|
Joined: Dec 2002
Posts: 83
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 83 |
As I suspected, it's trying to send it to the first letter of the line.
I tried adding /msg $nick to every line of the doc, but that failed as well.
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
So you're looking for a switch which evaluates the text before playing it. I didn't find such a switch. one way around would be preceding each line by msg $pnick. $pnick is the nick which is the file is being played to. Your file will be looking like: msg $pnick Welcome to the Black Mesa
msg $pnick The time is: $time
msg $pnick Have a very safe day! And the script: on *:text:!help*:?:{ play -ct $+ $2 $nick file.txt }
|
|
|
|
Joined: Dec 2002
Posts: 83
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 83 |
I hate when it is that easy... These late-night coding sessions are going nowhere..
Thanks man for your assistance.
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
Not [bold] .. [[/b]b] and [[/b]/b].
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Dec 2002
Posts: 83
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 83 |
Damn you're fast Hammer.. at least let me View the post :tongue:
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
welcome
|
|
|
|
Joined: Dec 2002
Posts: 83
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 83 |
Oh, one more thing... When I do /play a text file, it seems to sometimes show the spaces, sometimes not. i.e. What it should look like: (and what is typed in my text editor) What it comes out to look like: and I've tried using three differant text editors, and I've also tried with just spaces, just tabs, and tabs & spaces (one tab, one space, one tab, etc).
Last edited by acemiles_ed; 20/01/03 07:35 AM.
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
This is an another sensitive point in mIRC... it strips spaces from anything due to the way it works.
To get around it you'll have to replace any space character - $chr(32) - by a fake-space, transparent char: $chr(160). To create that char hold the Alt key and press 0160 in the numeric keyboard. then copy & paste the result to anywhere you need it.
|
|
|
|
Joined: Dec 2002
Posts: 54
Babel fish
|
Babel fish
Joined: Dec 2002
Posts: 54 |
alias space { return $str($chr(32) $chr(32),$$1) }
Usage: $space(number)
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
this one won't help either, unless '32' is replaced by '160'.
|
|
|
|
Joined: Dec 2002
Posts: 143
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 143 |
I am sure there is a way (or used to be) of getting mIRC to evaluate the text before sending it. Something like /play -e file.txt 1000
I remember having this problem years ago (maybe v5.x?)
Aubs.
|
|
|
|
Joined: Dec 2002
Posts: 54
Babel fish
|
Babel fish
Joined: Dec 2002
Posts: 54 |
this one won't help either, unless '32' is replaced by '160'.
Works fine for me.
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
Aubs, -e stands for echo... notfor avaluate. believe me, I have read the whole help file on playing, but looks like there's no evaluation switch. If such a script existed but was taken out, I hope it'll be added in the next version.
Laz, what I'm trying is: //echo -a $space(10) Hello. Does it create 10 spaces before the word 'Hello'?
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
Doesn't work for me, I just get "Hello".
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
Yeah, it worked for you. are you using mIRC 6.03 with the exact alias posted above?
|
|
|
|
Joined: Dec 2002
Posts: 54
Babel fish
|
Babel fish
Joined: Dec 2002
Posts: 54 |
Yes, I copyed it and pasted it and have 6.03.
Last edited by laz; 21/01/03 02:55 PM.
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
So I did... it's not supposed to work, anyway. did that work to anyone else?
|
|
|
|
|