Jump to content

%# Question


iLia

Recommended Posts

Daniel forgot his password (and e-mail I suspect) for TG so he asked me to post this . I can't always read his handwriting though so if something looks odd just say so and I'll clarify it with him.

 

 

 

I'll just quote what he wrote on the note for me

 

I want to post from one room to another

 

Normally that would be like this, when in channel a

 

/msg #b-Room Blah

 

 

The problem is that roomnames start with %#

 

Is there a way around this?

 

 

P.S. Plz edit the title , I really didn't know what to put.

Link to comment
Share on other sites

this will do it

 

/msg $chr(37) $+ $chr(35) $+ b-Room Blah

 

$chr(37) = %

$chr(35) = #

$+ = put item before and item after together as one

Link to comment
Share on other sites

this will do it

 

/msg $chr(37) $+ $chr(35) $+ b-Room Blah

 

$chr(37) = %

$chr(35) = #

$+ = put item before and item after together as one

 

Why use $chr() when you can just use the actual characters like I did? :unsure:

Link to comment
Share on other sites

Guest Travis

Why use $chr() when you can just use the actual characters like I did? :unsure:

 

Because mIRC uses % for variables and so has issues sometimes using % in room names. (One of the reasons MSN OCX sucks)

 

For instance. If you called an alias named testing and wanted to include the $nick and $chan:

 

if ($nick != $me) testing $chan $nick

 

alias testing {

if ($2 ison $1) mode $1 +o $2

}

 

If the channel had %# to start with mIRC wouldn't process it and so $1 would be the $nick and there would be no $2.

 

The typical way connections handled this was to remove $chr(37) to move the info around and then when sending it to the server, add it back on.

Link to comment
Share on other sites

Because mIRC uses % for variables and so has issues sometimes using % in room names. (One of the reasons MSN OCX sucks)

 

I understand all of that, but what I gave him works fine. Try typing this in mIRC:

 

//echo -a % $+ test

 

You will see "%test" in the active window. This shows that mIRC has in fact NOT evaluated the string as a variable. The same can be used for channels: % $+ #chan

 

You could also use $(%#chan,0) or $eval(%#chan,0), but whichever way you use (% $+ #chan being the shortest), there's no need to use two $chr()s

 

For instance. If you called an alias named testing and wanted to include the $nick and $chan:

If the channel had %# to start with mIRC wouldn't process it and so $1 would be the $nick and there would be no $2.

 

The typical way connections handled this was to remove $chr(37) to move the info around and then when sending it to the server, add it back on.

 

No, that is wrong.

 

alias test { echo -a $1 }

 

Now type this (exactly this) in the status window: /test %#x

 

You will see "%#x" come up. The "echo -a $1" will only evaluate $1 once, which will turn it into %#x, you would have to evaluate it again to get the value of that variable. For mIRC to do what you're saying, you would have to change the /test alias to this:

 

alias test { echo -a $eval($1,2) }

 

You have probably ran into problems with calling aliases on a timer or something which has misled you, but that is because timers evaluate everything an extra time.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...