mIRC Home    About    Download    Register    News    Help

Print Thread
#153782 22/07/06 11:07 PM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
Is it possible to set $nick as a Nick Identifier within a set %variable?

I know you can use /set -n to treat value as plain text.

When I use this statement in a alias it returns my nick and not the Identifier $nick

alias test {
set -n %line Hello $nick $+ , Your message has been recieved....
}

This is what i get
%line Hello , Your message has been recieved....

This is what I am trying to achieve when I set the command
%line Hello $nick $+ , Your message has been recieved....

The only way it seems to work is if I use this command
/set -n %line Hello $nick $+ , Your message has been recieved....

If I try to use it in a alias it does not work. any Ideas on how to achieve the correct responce to using this in a aliases?




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
#153783 22/07/06 11:14 PM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
try to set $nick as a variable, and/or change $nick to $1, depends on where it's being used..


-Kurdish_Assass1n
#153784 22/07/06 11:33 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Is this what you are looking for?

I'll use $ctime as an example:

//set %ctime $ctime
//echo -a %ctime

Echos: 1153611089


//set %ctime $!ctime
//echo -a %ctime

Echos: $ctime

-genius_at_work

#153785 22/07/06 11:54 PM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
I am trying to set a variable %line
to contain this information

Hello $nick $+ , Your message has been recieved....

that way I can edit my message. the variable would be used in a statement like this

on ^:OPEN:?:*: { msg $nick %line }




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
#153786 23/07/06 12:01 AM
Joined: Feb 2004
Posts: 206
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
Code:
 
alias myLineOfText return Hello $1 $+ , Your message has been received.... 

on ^:OPEN:?:*: { msg $nick $myLineOfText($nick)}
 


Not the only way to skin this particular cat, of course!

Cheers,

DK


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
#153787 23/07/06 12:09 AM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
I am trying to set the line as a variable so other users can edit the line without having to edit the script. that is why I am looking for a way to use this as an alias so when the script is loaded it will not display the users nick.

it seems to be more of a bug within the /set command being used as a alias.

it works using /set -n %line Hello $nick $+ , Your message has been recieved....

but not when I use it as an alias
alias test {
set -n %line Hello $nick $+ , Your message has been recieved....
}




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
#153788 23/07/06 12:15 AM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
Quote:
Is it possible to set $nick as a Nick Identifier within a set %variable?

I know you can use /set -n to treat value as plain text.

When I use this statement in a alias it returns my nick and not the Identifier $nick

alias test {
set -n %line Hello $nick $+ , Your message has been recieved....
}

This is what i get
%line Hello , Your message has been recieved....

This is what I am trying to achieve when I set the command
%line Hello $nick $+ , Your message has been recieved....

The only way it seems to work is if I use this command
/set -n %line Hello $nick $+ , Your message has been recieved....

If I try to use it in a alias it does not work. any Ideas on how to achieve the correct responce to using this in a aliases?

you're trying to get the actual $nick in there, and, not to replace it with the nick? sorry, I'm just not understanding.


-Kurdish_Assass1n
#153789 23/07/06 12:18 AM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
yes. That is what I am trying to achieve




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
#153790 23/07/06 12:22 AM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
ok, understood, I have NEVER tried this, but, I don't know, maybe you could do something like set %line $ni $+ ck w/e here
I don't know, I'll try it really quick, and, if I get there before you, then, I'll let you know what goes on laugh


-Kurdish_Assass1n
#153791 23/07/06 12:23 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
genius-at-work told you how to do this
test this
Code:
alias test {
  set %line Hello $!nick $!+ , Your message has been recieved....
  msg $active %line
}

using the ! stops the identifier from performing, see if this will do what you asked

#153792 23/07/06 12:25 AM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
:\, lol, I came up with this.. $chr(36) $+ nick etc. lol, but, yea, I'd do what genius said to do :P


-Kurdish_Assass1n
#153793 23/07/06 12:51 AM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
Thank you MikeChat
That works command for me.....

Sometimes its the simplest thing that enables the most complicated script




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
#153794 23/07/06 03:54 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
Hello $nick $+ , Your message has been recieved....

For that as yuo have been told already its set %line Hello $!nick $!+ , Your message has been recieved....

Quote:
on ^:OPEN:?:*: { msg $nick %line }

For this i beleive you well find you need to use on ^:OPEN:?:*: { msg $nick $(%line,2) }

other wise you really well send "Hello $nick $+ , Your message has been recieved...." to the nick.

#153795 23/07/06 04:10 AM
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
Thanks davec.
What I was doing, was setting the variables for a script I need to update.

The problem was, when the identifiers were loaded into the dialog window on load. it was loading my own nick as the nick name in the reply message.




Intelligence: It's better to ask a stupid question, then to prove it by not asking....

Link Copied to Clipboard