Top

Math Identifiers


mIRC Code
+ 1 likes
Please Register to submit score.
Bookmark and Share
Average Score  7.5 (of 2 scores)
Date Added  Feb 25, 2009
Last Updated  Feb 25, 2009
Tags  average  formula  math  number  opposite  quad  quadratic 

Introduction

These were a few identifiers I just came up with. Enjoy :-).

$avrg: Find the average of a given set of numbers (seperated by a space)
Usage: $avrg(Numbers)
Example: $avrg(10 2 5 3)
-> Returns "5"

$qdrc: Quadratic Equation
Usage: $qdrc(a,b,c)
Example: $qdrc(1,4,1)
-> Returns: "-0.267949 -3.732051"
*Note: The .x1 and .x2 properties can be used as well, e.g. $qdrc(1,4,1).x1 returns "-0.267949"

$opst: Get the opposite of a number
Usage: $opst(Number)
Example: $opst(372)
-> Returns "-372"

Grab the Code

/*
The text from line 1 to line 23 are comments. They may be deleted safely.
 
Math Aliases by vSkyzv
http://www.hawkee.com/
 
$avrg: Find the average of a given set of numbers (seperated by a space)
Usage: $avrg(Numbers)
Example: $avrg(10 2 5 3)
-> Returns "5"
 
$qdrc: Quadratic Equation
Usage: $qdrc(a,b,c)
Example: $qdrc(1,4,1)
-> Returns: "-0.267949 -3.732051"
*Note: The .x1 and .x2 properties can be used as well, e.g. $qdrc(1,4,1).x1 returns "-0.267949"
 
$opst: Get the opposite of a number
Usage: $opst(Number)
Example: $opst(372)
-> Returns "-372"
 
*/
alias avrg { return $calc(($replace($1,$chr(32),+)) / $numtok($1,32)) }
alias qdrc {
  var %dscrm = $calc(($2 * $2) - 4($1 * $3)), %x1 = $calc(($opst($2) + $sqrt(%dscrm)) / 2($1)), %x2 = $calc(($opst($2) - $sqrt(%dscrm)) / 2($1))
  if (!$prop) { return %x1 %x2 }
  elseif ($prop == x1) { return %x1 }
  elseif ($prop == x2) { return %x2 }
}
alias opst { return $iif($1 > 0,$calc($1 - $calc($1 * 2)),$abs($1)) }

Comments

  (8)  RSS
PunkTuReD
Comments: 461
 
mIRC Snippet:  Math Identifiers
Posted on Feb 26, 2009 3:28 am
very nice vSkyzv 8/10
Aucun50
Comments: 548
 
mIRC Snippet:  Math Identifiers
Posted on Feb 26, 2009 7:43 am
Nice
Kirby
Comments: 475
 
mIRC Snippet:  Math Identifiers
Posted on Feb 26, 2009 9:23 am
Nice, I like the "$qdrc: Quadratic Equation". xD
freaky
Comments: 19
 
mIRC Snippet:  Math Identifiers
Posted on Feb 26, 2009 11:58 am
Good use of scripting to do math problems, good work. 7/10
ducki
Comments: 8
 
mIRC Snippet:  Math Identifiers
Posted on Feb 26, 2009 1:47 pm
Nice.
vSkyzv
Comments: 22
 
mIRC Snippet:  Math Identifiers
Posted on Feb 28, 2009 11:11 pm
Thanks. Are there any more that you guys would like to suggest?
Firstmate
Comments: 119
 
mIRC Snippet:  Math Identifiers
Posted on Mar 1, 2009 12:15 am
:D nice snippet. I should've thought of these D:
Purplebeard
Comments: 21
 
mIRC Snippet:  Math Identifiers
Posted on Oct 28, 2009 6:51 pm
can any of you guys help me, i'm trying to turn this script into a remote for a Bot (added to a !calc)

this is what i have so far:

on *:text:!calc*:#: {
if ( $2 == $null) { /msg $chan Put a Equation after !calc please }
elseif ( $3 == $null ) { /msg $chan $2 = $calc( $2 ) }
elseif ( $2 == avrg ) { /msg $chan The Average of your numbers is $calc(($replace($2,$chr(32),+)) / $numtok($2,32)) }
elseif ( $2 == Opp ) { /msg $chan $calc($1 - $calc($2 * 2)),$abs($2)) }
elseif ( $2 == qdrc ) { var %dscrm = $calc(($3 * $3) - 4($2 * $4)), %x1 = $calc(($opst($2) + $sqrt(%dscrm)) / 2($1)), %x2 = $calc(($opst($3) - $sqrt(%dscrm)) / 2($2))
if (!$prop) { return %x1 %x2 }
elseif ($prop == x1) { return %x1 }
elseif ($prop == x2) { return %x2 }
} }


all help is SUPER appreciated

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom