mIRC Homepage

on part with variables

Posted By: snabbi

on part with variables - 03/07/06 11:17 AM

Today I discovered that the following code does not work in mIRC 6.17

on *:part:%room : { echo -s test }

When I replace %room with the actual roomname it does work. Thus it seems like it doesn't replace the variablename with its value.

However,
on *:join:%room { echo -s test }
does work.

*Workaround could be
on *:part:*: {
if ( !$istok(%room,$chan,44) ) { return }
echo -s test
}
Posted By: hmtX

Re: on part with variables - 03/07/06 11:26 AM

on *:part:%room: works perfectly fine here.. remove the space between the variable and the : i guess. nevertheless, on *:part:$(%room): will work aswell

/edit: your workaround is missing a closing } after the return.
Posted By: qwerty

Re: on part with variables - 03/07/06 11:27 AM

It works fine here. If you use the code you posted here, your problem is a syntax error. You must not leave a space after the variable and before the colon:

on *:part:%room : <- wrong
on *:part:%room: <- right

You also have a syntax error in the on join example you posted. Although this one may be tolerated by mIRC, you should use the correct syntax.

on *:join:%room { code } <- wrong
on *:join:%room: { code } <- right
Posted By: snabbi

Re: on part with variables - 03/07/06 11:41 AM

Okay, seems to be the syntax error yes. The variable is replaced with the correct syntax and isn't replaced with the bad syntax. And it is tolerated at the on join.

I have always used the wrong syntax from 5.91 and just learned today that it was wrong. Sorry to disturb you.

PS
Though it does strike me that it is tolerated with the on join and it isn't tolerated at the on part.
Posted By: qwerty

Re: on part with variables - 03/07/06 11:44 AM

The space between the variable and the colon is not tolerated in on JOIN either.
© 2019 mIRC Discussion Forums