mIRC Homepage

Set %var no longer works

Posted By: Stephen

Set %var no longer works - 29/12/19 07:07 AM

What would cause variables to no longer set on any level? I have tried blowing away vars.ini to a new file but anytime I try to set any variable I do not see it in the vars tab of script editor.

Posted By: Khaled

Re: Set %var no longer works - 29/12/19 12:00 PM

The most common reason for this is that one of your scripts has an incorrect number of { or } and this is causing the /set command to be overridden. To track it down, you would need to unload your scripts one at a time, use the /set command in the status window and then check the variables section. If the variable is set as expected, you have narrowed the issue down to a particular script. You would then need to load the script and check the aliases defined in it to narrow the cause of the issue.
Posted By: maroon

Re: Set %var no longer works - 29/12/19 05:38 PM

One possible cause could be accidentally creating an alias for the /set command.

If you have a line beginning with /set somewhere in your alt+D aliases file, that makes it intercept the /set command and perform that alias instead.

To see if that has happened, paste this into any editbox:

Code
//echo -a $isalias(set) $isalias(set).fname


If it says $true, then that's where the alias is located. If it says $false, then that's not the problem.

If the /set command works when it's inside a script, but not when typed in the editbox, another possibility could be an ON INPUT event which doesn't correctly handle editbox commands beginning with the forward slash.
Posted By: Stephen

Re: Set %var no longer works - 31/12/19 08:38 PM

well while I was waiting for the reply I started unloading ini's and loading one at a time.
I came up with this this as the culprit. An alias I had started but had to stop to take care of something else. There is of course a broken bracket at the bottom. It was for a hangman script that I was trying to change to allow for spaces to be shown for a couple of word handman word.

/hangit {
set %broken.appear $str(-,$len(%broken.word))
set %broken.appear2{
if
}
var %l = 1
while (( %l <= $len(%broken.word) )) {
set $+(%,broken.letter.,%l) $leftind(%broken.word,%l)
set $+(%,broken.appear.,%l) -
inc %l
}
echo 4 %broken.appear
}
Posted By: maroon

Re: Set %var no longer works - 31/12/19 11:21 PM

Yes, by having that { bracket touching the 2, it no longer is a special symbol, so the } below the "if" line is closing out the alias.

This causes the next line "var %l = 1" to be the definition for an alias. I suspect you also have trouble with the 'while' command being redefined by the remainder of that line.
© 2020 mIRC Discussion Forums