mIRC Home    About    Download    Register    News    Help

Print Thread
[7.46] Unlimited hash items with... (never mind) #258592 01/08/16 06:42 PM
Joined: Dec 2015
Posts: 148
Dazuz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Dec 2015
Posts: 148
Never mind, everything seems to be working as intended. I'm just going nuts.



Click to reveal.. (Old post)

You seem to be able to add any length of binary variable to a hash table item with "/hadd -b <hash table> <item> <binary variable>" command, and you can set the data from the hash table item to another binary variable with "$hget(<hash table>,<item>,<binary variable>)". In previous versions it would only set the first 4150 characters to the item.

Here's an example:
Code:
alias binaryhashtest {
  bread versions.txt 0 $file(versions.txt).size &input
  echo -at * Read $bvar(&input,0) characters to &input
  hfree -w test
  hmake test
  hadd -b test item &input
  echo -at * item appears to be $len($hget(test,item)) characters long
  echo -at * Got $hget(test,item,&output) characters from item and set it to &output
  hfree -w test
  editbox -a Echoing &output binary variable's content (Press CTRL+Break to stop)
  var %x = 1
  while ($bfind(&output,%x,$crlf).text) { echo -at * $bvar(&output,%x,$calc($v1 -%x)).text | var %x = $v1 + 4 }
  editbox -a
}


I find this "bug" to be absolutely fantastic change, but I assume it's not meant to work like this. At least I couldn't find anything about it from the change log.



EDIT:
Just to give you an example what the script prints out:
Quote:
21:51:30 * Read 621448 characters to &input
21:51:30 * item appears to be 4150 characters long
21:51:30 * Got 621448 characters from item and set it to &output
21:51:30 * 01/08/2016 - mIRC v7.46
21:51:30 * Changes:
21:51:30 * Updated to OpenSSL 1.0.2h library.
21:51:30 * Fixed /timer -h high resolution timer which was being limited to the
21:51:30 * same rate as the -m millisecond timer.
21:51:30 * Added $samepath(path1,path2) identifier that returns $true/$false
21:51:30 * if paths refer to the same file/dir. It resolves relative paths and
21:51:30 * converts long/short filenames.
21:51:30 * Added /copy -f switch to flush copy to disk immediately.
21:51:30 * Added /rename -f switch to flush rename to disk immediately and -o

and so on


Last edited by Dazuz; 01/08/16 07:26 PM.
Re: [7.46] Unlimited hash items with binary variables [Re: Dazuz] #258593 01/08/16 06:51 PM
Joined: Jul 2006
Posts: 3,738
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,738
Probably related to this fix http://forums.mirc.com/ubbthreads.php/topics/257736/Silent_truncation_with_non-asc#Post257736Wait what you are reporting isn't a bug, it's normal, it's a feature that you can add unlimited data to an item using binary variable


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: [7.46] Unlimited hash items with binary variables [Re: Wims] #258594 01/08/16 07:24 PM
Joined: Dec 2015
Posts: 148
Dazuz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Dec 2015
Posts: 148
Did some tests with older mIRC versions and they worked just like 7.46.

There's a chance I'm going nuts, for about a week I've been playing with a script that took advantage of the fact that it only set 4150 characters. The script started bugging out when I switched from 7.45 to 7.46.

In any case, this is fantastic.

Re: [7.46] Unlimited hash items with binary variables [Re: Dazuz] #258595 01/08/16 07:30 PM
Joined: Apr 2010
Posts: 959
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 959
Bvars from hashtables have always worked as they currently do -- all data from the hashtable item is added to the bvar regardless of length -- but I seem to recall there being an issue where, when outputting data from a bvar, instead of raising a line-to-long error the text was truncated.

I can't remember if it was related to /var, /echo, or some other output command but will look to see if I can find the report and documentation of the subsequent fix.


I am SReject
My Stuff
Re: [7.46] Unlimited hash items with binary variables [Re: Dazuz] #258596 01/08/16 07:55 PM
Joined: Jul 2006
Posts: 3,738
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,738
Well, when not adding a binvar, you're limited to 4150 characters (for the whole command + parameters).
What's the script which started bugging out in 7.46?


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: [7.46] Unlimited hash items with binary variables [Re: Wims] #258597 01/08/16 08:18 PM
Joined: Dec 2015
Posts: 148
Dazuz Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Dec 2015
Posts: 148
The part that started bugging out is long gone now, but it was just a "/hadd -b table item &binvar" and "$hget(table,item,&anotherbinvar)".

It would repeat those commands a few times, while keeping an eye on the &anotherbinvar. After I switched to 7.46, &anotherbinvar would get longer and longer until the script finished. It relied on that 4150 cap, which made me thought something changed in 7.46. I've tried to replicate the 7.45 results, but it's not happening.

There's a chance I'm just going senile and imagining things.