$biton() and $bitoff() require a bit of knowledge of binary (but submitted in decimal).
Code:

  0000 =  0     0100 =  4     1000 =  8     1100 = 12
  0001 =  1     0101 =  5     1001 =  9     1101 = 13
  0010 =  2     0110 =  6     1010 = 10     1110 = 14
  0011 =  3     0111 =  7     1011 = 11     1111 = 15

So, let's say we want to start with 3 (0011) and see what that would be if we turned ON the 4th bit.

//echo -a * $biton(3, 4)
* 11


Notice that 3 is 0011 and we turned on the 4th bit, which becomes 1011, which is 11 from the chart above.

If we started with 15 (1111) and wanted to see what the value would be if we turned OFF the 3rd bit:

//echo -a * $bitoff(15,3)
* 11


Starting with 1111 and turning off the 3rd bit gives 1011, which is 11.

These are basically useless as they are given here, but become very useful when you start using variables that you don't know the value ahead of time during any given execution of $biton or $bitoff.


$log() is a mathematical function, just as $sin(), $cos(), $tan(), etc. are. $log(N) returns the natural logarithm of the value you give it.

Assume that X raised to the Yth power equals Z. Translated into mIRC scripting, this is %Z = $calc(%X ^ %Y). But what if we wanted to find %Y if we knew %X and %Z? That's where $log() comes in.

A natural logarithm uses as its base (%X) the constant e (which is approximately equal to 2.7182818). Exponential and logarithmic functions with base e occur in many practical applications, including those involving growth and decay, continuous compounding of interest, alternating currents and learning curves.

If you have need of this function, you'll know it and mIRC provides a way to use it; if you don't, you can safely ignore it. laugh


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C