mIRC Home    About    Download    Register    News    Help

Print Thread
Variable don't unset #192523 03/01/08 01:07 PM
Joined: Dec 2002
Posts: 145
G
gemeau50 Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Dec 2002
Posts: 145
mIRC version 6.31
Network Undernet

on @*:TEXT:*:channel: {
if ($nick isop $chan ) { return }
inc -u2 %txt $+ $nick
if ($eval($+(%,txt,$nick ),2) == 5) {
mode $chan +b $address($nick,2)
kick $chan $nick flood
}
}

/inc [-cszeuN] <%var> [value]
This increases the value of %var by value.

If you specify the -uN switch, %var is increased by the value once and then %var is unset N seconds later, assuming it is not set again by another script.

This script works fine until I open the "Scripts Editor" and click on tab "Variables". All active temporary variables "%txt $+ $nick" freeze. They do not unset after 2 seconds. They become permanent and when the count reaches "5", out go the users. Clients are not that pleased.

Is it a bug or a flaw in the script?

Tx in advance


Re: Variable don't unset [Re: gemeau50] #192524 03/01/08 01:21 PM
Joined: Dec 2002
Posts: 2,028
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,028

The flaw is clicking the OK button or the Sort button while viewing the Variables tab, don't do that because all variables viewable under the Variables tab will be permanently set, instead click the Cancel button or switch to another tab and the variables that are currently viewable under the Variables tab will not be saved. Try the same thing as before, but rather than clicking the OK button, switch to the Remotes tab and then switch back to the Variables tab and your temporary variables will be gone.

Re: Variable don't unset [Re: RoCk] #192527 03/01/08 03:36 PM
Joined: Dec 2002
Posts: 145
G
gemeau50 Offline OP
Vogon poet
OP Offline
Vogon poet
G
Joined: Dec 2002
Posts: 145
RoCk tx for your reply

I added this line to the script:
echo $chan $nick $eval($+(%,txt,$nick ),2)

and I found that when the Scripts Editor is open and the tab "Variables" is on top, temporary variables are not unset. As soon as you change tab the unsetting restarts.

Re: Variable don't unset [Re: gemeau50] #192528 03/01/08 04:06 PM
Joined: Dec 2002
Posts: 2,028
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,028

Yes I see that now, the variable is not unset as long as the editor is open to the Variables tab, but is immediately unset when you switch to another tab or click OK or Cancel. Clicking the sort button doesn't effect it either way, it's still unset after switching tabs or clicking OK or cancel. I never realized this before.

Re: Variable don't unset [Re: gemeau50] #192651 06/01/08 07:15 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
mIRC will not dynamically update the contents of anything inside the scripts editor while it is open. This goes for the userlist, script files, and variables. It loads the contents once into memory and keeps that data until you close it.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"