mIRC Home    About    Download    Register    News    Help

Print Thread
Set %var no longer works #266578 29/12/19 07:07 AM
Joined: Dec 2019
Posts: 13
S
Stephen Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2019
Posts: 13
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.


Re: Set %var no longer works [Re: Stephen] #266580 29/12/19 12:00 PM
Joined: Dec 2002
Posts: 4,832
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,832
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.

Re: Set %var no longer works [Re: Stephen] #266585 29/12/19 05:38 PM
Joined: Jan 2004
Posts: 1,412
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,412
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.

Re: Set %var no longer works [Re: maroon] #266602 31/12/19 08:38 PM
Joined: Dec 2019
Posts: 13
S
Stephen Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2019
Posts: 13
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
}

Re: Set %var no longer works [Re: Stephen] #266603 31/12/19 11:21 PM
Joined: Jan 2004
Posts: 1,412
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,412
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.