mIRC Home    About    Download    Register    News    Help

Print Thread
#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?

Joined: Oct 2005
Posts: 1,741
G
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

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I'm unable to reproduce this bug on mirc 6.3, i use this code :
Code:
on *:input:*: {
  set -sn %origtext $1-
}




#mircscripting @ irc.swiftirc.net == the best mIRC help channel
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.
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I'm not sure this is a bug, you should use $(,0)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2003
Posts: 2,523
Q
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
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"

Joined: Jun 2006
Posts: 508
D
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

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.
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?

Joined: Jun 2006
Posts: 508
D
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

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


Link Copied to Clipboard