mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#7450 20/01/03 02:14 AM
Joined: Dec 2002
Posts: 83
A
Babel fish
OP Offline
Babel fish
A
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.

Code:
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?

#7451 20/01/03 05:32 AM
Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
you could use /debug -pt @debug to see what it sending to the server.

#7452 20/01/03 05:37 AM
Joined: Dec 2002
Posts: 83
A
Babel fish
OP Offline
Babel fish
A
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.

#7453 20/01/03 06:53 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
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:
Code:
msg $pnick Welcome to the Black Mesa
msg $pnick The time is: $time
msg $pnick Have a very safe day!

And the script:
Code:
on *:text:!help*:?:{ play -ct $+ $2 $nick file.txt }


#7454 20/01/03 07:08 AM
Joined: Dec 2002
Posts: 83
A
Babel fish
OP Offline
Babel fish
A
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.

#7455 20/01/03 07:10 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Not [bold] .. [[/b]b] and [[/b]/b]. laugh


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#7456 20/01/03 07:11 AM
Joined: Dec 2002
Posts: 83
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 83
Damn you're fast Hammer.. at least let me View the post :tongue:

#7457 20/01/03 07:16 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
welcome smirk

#7458 20/01/03 07:35 AM
Joined: Dec 2002
Posts: 83
A
Babel fish
OP Offline
Babel fish
A
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)
Code:
!                      Welcome to Help                 !



What it comes out to look like:
Code:
! Welcome to Help !


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.
#7459 20/01/03 07:53 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
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.

#7460 20/01/03 03:01 PM
Joined: Dec 2002
Posts: 54
L
laz Offline
Babel fish
Offline
Babel fish
L
Joined: Dec 2002
Posts: 54
Code:
  
alias space { return $str($chr(32) $chr(32),$$1) }


Usage: $space(number)

#7461 20/01/03 04:37 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
this one won't help either, unless '32' is replaced by '160'.

#7462 20/01/03 04:52 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
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.
cool

#7463 21/01/03 02:47 AM
Joined: Dec 2002
Posts: 54
L
laz Offline
Babel fish
Offline
Babel fish
L
Joined: Dec 2002
Posts: 54
Quote:

this one won't help either, unless '32' is replaced by '160'.


Works fine for me.

#7464 21/01/03 06:43 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
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'?

#7465 21/01/03 07:40 AM
Joined: Dec 2002
Posts: 54
L
laz Offline
Babel fish
Offline
Babel fish
L
Joined: Dec 2002
Posts: 54
http://www.geocities.com/laz552/space.bmp

If the link doesn't work, copy into your Address bar.

#7466 21/01/03 08:22 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Doesn't work for me, I just get "Hello".

#7467 21/01/03 08:45 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Yeah, it worked for you. are you using mIRC 6.03 with the exact alias posted above?

#7468 21/01/03 02:50 PM
Joined: Dec 2002
Posts: 54
L
laz Offline
Babel fish
Offline
Babel fish
L
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.
#7469 21/01/03 02:55 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
So I did... it's not supposed to work, anyway. did that work to anyone else?

#7470 21/01/03 02:57 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Humor me and try //!echo -a $space(10) Hello. please smile

#7471 21/01/03 03:17 PM
Joined: Dec 2002
Posts: 54
L
laz Offline
Babel fish
Offline
Babel fish
L
Joined: Dec 2002
Posts: 54
Collective, same as the first pic I posted.

#7472 22/01/03 05:20 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You're lying.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#7473 22/01/03 06:11 AM
Joined: Dec 2002
Posts: 54
L
laz Offline
Babel fish
Offline
Babel fish
L
Joined: Dec 2002
Posts: 54
Well qwerty, I don't know why you would say I lie even though you have absolutly no proof. This in fact does work for me, and if its not suppose to I don't know why it is.

I did just try it on my older machine (Win98) but it was running 6.01. It didn't work, but on my XP with mIRC 6.03 it works fine.

Also, I try not to post false info, and even if I did make an error, I'd atleast admit it.

Page 1 of 2 1 2

Link Copied to Clipboard