mIRC Home    About    Download    Register    News    Help

Print Thread
/set -n doesn't work? #184134 25/08/07 08:09 PM
Joined: Jan 2006
Posts: 111
N
noMen Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
I use mirc 6.17 and with this version I have the following problem:

Quote:

on *:input:*: {
set -n %origtext $1-
..etcetera..


I thought the -n switch would prevent $1- from being evaluated, but when I enter 8 - 1 the answer 7 is placed into %origtext. When I enter 8-1 indeed 8-1 is placed into %origtext.

What is wrong?

Re: /set -n doesn't work? [Re: noMen] #184138 25/08/07 08:55 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Does this happen on the latest mIRC (version 6.3) ?

-genius_at_work

Re: /set -n doesn't work? [Re: noMen] #184145 25/08/07 09:45 PM
Joined: Jul 2006
Posts: 3,755
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,755
I'm unable to reproduce this bug on mirc 6.3, i use this code :
Code:
on *:input:*: {
  set -sn %origtext $1-
}




Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /set -n doesn't work? [Re: Wims] #184146 25/08/07 09:52 PM
Joined: Jan 2006
Posts: 111
N
noMen Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
Ow ... set -n DOES work, BUT I call another alias where I store the entered text in a variable:

Quote:

on *:input:*: {
set -n %origtext $1-
saytext
halt
}

alias -l saytext {
var %temp = %origtext
.say %temp
}


I simplified the code for good understanding.

var -n %temp = %origtext is not valid

Last edited by noMen; 25/08/07 10:05 PM.
Re: /set -n doesn't work? [Re: noMen] #184152 25/08/07 10:16 PM
Joined: Jul 2006
Posts: 3,755
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,755
I'm not sure this is a bug, you should use $(,0)


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /set -n doesn't work? [Re: noMen] #184153 25/08/07 10:22 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
FYI, you can declare a local var with /var %temp and then set it with /set -n %temp %origtext (or use the undocumented -l switch, that makes /set create a local var: /set -ln %temp %origtext)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: /set -n doesn't work? [Re: Wims] #184154 25/08/07 10:25 PM
Joined: Jan 2006
Posts: 111
N
noMen Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
Can you give an example, because var %temp = $(%origtext, 0) results in saying "%origtext"

Re: /set -n doesn't work? [Re: noMen] #184164 26/08/07 03:11 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Originally Posted By: noMen
Can you give an example, because var %temp = $(%origtext, 0) results in saying "%origtext"

//set -un %original 8 - 1 | var %a | set -n %a %original | echo -ag %a

Re: /set -n doesn't work? [Re: deegee] #184177 26/08/07 06:52 AM
Joined: Jan 2006
Posts: 111
N
noMen Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
Thank you both qwerty and deegee smile

Last edited by noMen; 26/08/07 06:53 AM.
Re: /set -n doesn't work? [Re: noMen] #186061 17/09/07 12:01 AM
Joined: Jan 2006
Posts: 111
N
noMen Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
I am confused again ...
I try to set a variable to "type //echo -a $mircdir to find your mircdirectory". But using set -n %text type //echo -a $mircdir still evaluates $mircdir. According to the helpfile the -n switch should prevent that. I have to use $($mircdir, 0) with or without -n to prevent it from being evaluated. Why is the -n switch not working?

Re: /set -n doesn't work? [Re: noMen] #186062 17/09/07 12:12 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
The -n switch prevents calculations, not evaluations wink

You can use ! to prevent the evaluation

  • set %text type //echo -a $!mircdir to find your mircdirectory

Re: /set -n doesn't work? [Re: deegee] #186063 17/09/07 12:17 AM
Joined: Jan 2006
Posts: 111
N
noMen Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
aaaaaargh I always forget that. I'll save this link smile