/calc

By ch1zra on Mar 16, 2005

Simplicity rules 'em all. I'm pretty sure someone has done this by now, so if someone did it, I apologize. Usage is simple. just type anywhere "/calc YOUR OPERATION" supports 4 basic operations (+-/). Eg " /calc (4+5)5/3". And so on :]

alias calc {
  if ($1- != $null) {
    echo -a [/Calc] > Calculating :4 $1- 
    echo -a [/Calc] > Result is :4 $calc($1-) 
  }
  else echo -a [/Calc] : No parameters given. Halting.
}

Comments

Sign in to comment.
xplo   -  Sep 25, 2008

hippie crack LMAO

 Respond  
napalm`   -  Sep 24, 2008

Just got home, and I tested my previously posted calc alias that supposedly don't work.

Results:

/calc (1 + 2) * 2

Gave:

[05:31p] * [/calc] (1 + 2) * 2 = 6

//echo -a Calc: $calc(2 + 2)

Gave:

Calc: 4

I don't know what kind of Hippie Crack you're on, my stuff always works.

 Respond  
Jonesy44   -  Sep 24, 2008

$0 = string length. so if $0 = 0, no words entered.

 Respond  
WannaKnow   -  Sep 24, 2008

Napalm that dont work i think $0 always return 0 if you typ /calc

I think it need to be $1

 Respond  
napalm`   -  Sep 24, 2008

This is untested, am typing it up at work.

alias calc {
  if (!$0) return
  elseif ($isid) return $calc($1-)
  else echo $color(info) -at * [/calc] $1- = $calc($1-)
}

Upon finally testing the above code I shortened it to one line.

alias calc if ($0) echo $color(info) -at * [/calc] $1- = $calc($1-)
 Respond  
^Neptune   -  Sep 24, 2008

Remotes. ALT+R

 Respond  
Hobbz   -  Sep 24, 2008

Again, Were Do I Put This? :P

/me Is a n00b

 Respond  
Darkwarrior26   -  Apr 03, 2007

genius!

 Respond  
ZabuzaMomochi   -  Dec 16, 2006

ya, im too lazy to do //echo -a $calc(78383783*83748394) myself lol, so this helps a lot.

 Respond  
Soxide   -  Aug 29, 2006

very simple, but could be realy usefull ^_^

 Respond  
xDaeMoN   -  Mar 22, 2005

hehe =p

 Respond  
ch1zra   -  Mar 22, 2005

oh... naaah.. :P looks nicer with that minus :D

 Respond  
xDaeMoN   -  Mar 21, 2005

Actually what I meant is this part. Sorry I wasn\'t clear. \"($1- != $null)\". You could also use \"($1)\".

 Respond  
ch1zra   -  Mar 21, 2005

I used the $1- cause you can use spaces...

 Respond  
xDaeMoN   -  Mar 16, 2005

You could just say $1 instead of $1-. Nonetheless, not bad.

 Respond  
supergeo   -  Mar 16, 2005

yes log\'s dialog calculator is really nice...it\'s in the addons section just so everyone knows.

 Respond  
DarthReven   -  Mar 16, 2005

very simplified code

 Respond  
ch1zra   -  Mar 16, 2005

if you don\'t like this one, you can always use log2\'s dialog based calculator :D

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.