mIRC Home    About    Download    Register    News    Help

Print Thread
#161334 06/10/06 12:13 AM
Joined: Oct 2006
Posts: 82
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Hi there all.

I am looking to customise my /notice message.

As it stands now when i type /notice user, they recieve just the message text i type, but i wish them to recieve the following text:

for example if i were to type:
/notice user hello there and welcome to this room

the would recieve:

-BritishGent- {privately says to user} hello and welcome to this room

But i do not wish to be typing {privately says to user} all the time......

Could anyone please assist me in this.

Thank you in advance.


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Type this in any window:

/alias notice notice $1 {your custom thing here} $2-


-genius_at_work

Joined: Oct 2003
Posts: 313
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
Note that $1 here is the nickname you are sending to, and $2- is the text you are sending.

So your "user"-specific message in the above would be something like:

Code:
{Private message to $1 $+ } $2-


(i.e.
Code:
/alias notice notice $1 {Private message to $1 $+ } $2- 
)

The $+ is needed to join the identifier to the following text without an intervening space. $1} would be misinterpreted as the identifier called "1}", and not as $1 followed by a }

HTH


Sais
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Actually, $N identifiers can have text appended to them, and in the case of appending } its better to use $N}
Code:
alias notice notice $1 {Private message to $1} $2-

Or (longer and more obscure)
Code:
alias notice notice $1 {Private message to $1 $+ $chr(125) $2-


This, {Private message to $1 $+ } $2-, won't work.

Joined: Oct 2003
Posts: 313
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
Oops - I made the assumption that the } wouldn't be parsed, as there wasn't an opening brace to match it....

Of course, $(},0) works, too smile

But I'm sure that just confuses things - as I find escaping does in any language to those inexperienced in the language's quirks.

The important bit was that you can add a prefix to the message, as deegee showed in the original response.


Sais
Joined: Oct 2006
Posts: 82
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
Thank you so much it worked a treat.

Here have a cyber beer on me


Never ASSUME!!!

As it often makes and ASS out of U and ME!!

Link Copied to Clipboard