mIRC Home    About    Download    Register    News    Help

Print Thread
#86929 15/06/04 03:37 AM
Joined: Oct 2003
Posts: 37
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Oct 2003
Posts: 37
Is there a way to take a line of text and compress it to make a message shorter?

I saw the $compress identifier but that seems to deal with binvars, so then my question would become how do I convert a text string to a binary variable and back again?

-eMpTy

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Text to binvar: /bset -t &var 1 text goes here
Binvar to text: $bvar(&var,1-).text

/help /bset for more on binary variables.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Feb 2003
Posts: 282
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
I way always wandering what kind of compression is it...
It is not a standard zip compression. Is it Gzip by any chance?
(So it might be used while talking so servers which support PHP).

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
/help acknowledgements:

Zlib support is based on the work of Jean-loup Gailly and Mark Adler.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Oct 2003
Posts: 37
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Oct 2003
Posts: 37
I read the help file before I posted and couldn't get anything running, I used your example and had the same problem.

Below is precisely what I typed into the command line of my status window and the results I got. Please take a second and tell me how I"m screwing this up.

Code:
 
/bset -t &binvar 1 yo you yo
//echo -s $bvar(&binvar,1-).text

* Invalid parameters: $bvar

 


-eMpTy

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi,

in the help file the following is stated:

Notes on &binvar binary variables
Binary variables have no size limit, and are limited only by memory, can only be accessed by commands /bread and /bwrite, so they can't be printed or assigned or edited, and are automatically destroyed when a script finishes processing.

When you run those commands seperatly then the $bvar won't return anything, because it can be seen as "different scripts"

Try this:
Code:

//bset -t &binvar 1 yo you yo | echo -s $bvar(&binvar,1-).text  

Greets



Gone.
Joined: Oct 2003
Posts: 37
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Oct 2003
Posts: 37
Yeah as it turns out the variable isn't actually stored...that's why I was having problems...silly me...

-eMpTy


Link Copied to Clipboard