mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2021
Posts: 33
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Nov 2021
Posts: 33
If you use the unset command in the following way with wildcards at the beginning and end:

unset % [ $+ [ $+(*,NAME,*) ] ]

It messes up the variables in general. I don't know what exactly happens.

If it is a Wildcard only at the end like below:
unset % [ $+ [ $+(NAME,*) ] ]

It works normally, but with Joker at the beginning the variables get strange and messy.

I tried to make an alias by passing a standard name like $1 and what was reported above happened. The idea was to delete everything with the suggested name.

Joined: Dec 2002
Posts: 5,477
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,477
Thanks for your bug report. I have not been able to reproduce an issue with this so far. Can you provide a short script that 1) creates a list of variables, and 2) makes one call to /unset with wildcards that reproduces your issue?

Joined: Nov 2021
Posts: 33
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Nov 2021
Posts: 33
I created this alias and noticed that the variables screen looks strange after a while, as shown in the attached image.

alias noticias.unset.num {
var %t $1
while (%t >= 0) {
unset % [ $+ [ $+(*?,news.,%t,*) ] ] % [ $+ [ $+(news.,%t,.*) ] ] $&
% [ $+ [ $+(*?,narracao.placar.,%t,*) ] ] % [ $+ [ $+(narracao.placar.,%t,.*) ] ]
dec %t
}
}

[Linked Image from henriquepb.000webhostapp.com]

Joined: Dec 2002
Posts: 5,477
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,477
Thanks for your reply. I have still not been able to reproduce this issue.

Can you please provide a short script that:

Quote
1) Creates a list of variables
2) Makes one call to /unset with wildcards that reproduces your issue?

Without the above, I will be unable to reproduce your issue.

Joined: Nov 2021
Posts: 33
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Nov 2021
Posts: 33
The command used is the one above. It's a routine that is used from time to time and at some point the variable editor gets weird like in the image posted. That's why I said that after the command, things got strange and I couldn't say why. That's why I brought the question to the forum.

Joined: Dec 2002
Posts: 5,477
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,477
That is why I asked for a script that 1) Creates a list of variables. I already tested /unset, including your above alias, and cannot reproduce any issues with the list of variables that I have.

Looking at the image you provided, it looks like you may be using /set with text that contains $cr and/or $lf characters? You cannot do this since /set does not support that. You should store these types of lines either in binary variables, in files, or encoded in some way.

Joined: Nov 2021
Posts: 33
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Nov 2021
Posts: 33
In the ON SOCKREAD event I use:

breplace &bin 13 32 10 32 12 32 9 32 11 32
%s [ $+ [ $sockname ] ] = $bvar(&bin,1,$sockbr).text

Only if at some point the replacement doesn't work.

Joined: Dec 2002
Posts: 5,477
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,477
Okay, if you find a way of reproducing the issue, please let us know.

Note that you would need to provide a short, simple script, of a few lines, that we can use to reproduce the issue you are reporting. For example, here are the steps I would follow before posting a bug report:

1) Install a clean copy of mIRC, using the portable option in the installer, into a new empty folder.
2) Run this new copy of mIRC with no other scripts or addons.
3) In the scripts editor, add the following alias:

Code
; This script creates a list of variables and then uses /unset with wildcards
test {
  unsetall
  var %x 0
  while (%x < 100) {
    set -s % [ $+ [ $+(%x,test,%x) ] ] %x
    inc %x
  }
  unset -s %*2test2*
  unset -s %*3test4*
  unset -s %*4test3*
}

4) Test the script to make sure it reproduces the issue.
5) Post the bug report on the forums with the working script that anyone can type into mIRC to reproduce the same issue.

Joined: Nov 2021
Posts: 33
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Nov 2021
Posts: 33
When you talked about %var not accepting $crlf I thought about everything and saw that I have a script that sends messages to the Telegram api and I was putting %link = txt1 $crlf text2 in a var...
I made the change by making $urlencode(text) with the $crfl embedded before entering the %Link var to avoid the issue.
Let's see if that was the case in my case.

Joined: Nov 2021
Posts: 33
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Nov 2021
Posts: 33
Just one more question:
The image I sent from the variable editor does not match the script for sending messages to Telegram. That seems to be in another issue in my other script as I reported here about the breplace issue. Unless one interferes with the other in some way.


Link Copied to Clipboard