calc

By blackvenomm666 on Nov 19, 2010

simple calculator script just type in /calculator numhere addsubtractmulthere numhere then hit enter ex multiply /calculator 4 * 4 divide /calculator 12 / 4 add /calculator 13 + 3 subtract /calculator 10 - 5 ok also have a dialog calculator under the alias one

alias calculator { .set %calc1 $1
  .set %calc2 $2
  .set %calc3 $3
echo -a $calc(%calc1 %calc2 %calc3) }

Menu Menubar,Nicklist,Channel {
  Venom calculatorsystem
  .Venomcalculatorsystem: dialog $iif($dialog(calculator.system),-v,-md calculator.system) calculator.system
}
Dialog calculator.system {
  Title "calculatorsystem"
  Size -1 -1 60 67
  Option dbu
  edit "", 1, 0 02 58 10, read
  button "1",2, 0 15 15 10 flat
  button "2",3, 15 15 15 10 flat
  button "3",4, 30 15 15 10 flat
  button "4",5, 45 15 15 10 flat
  button "5",6, 0 25 15 10 flat
  button "6",7, 15 25 15 10 flat
  button "7",8, 30 25 15 10 flat
  button "8",9, 45 25 15 10 flat
  button "9",10, 0 35 15 10 flat
  button "0",11, 15 35 15 10 flat
  button ".",12, 30 35 15 10 flat
  button "+",13, 45 35 15 10 flat
  button "-",14, 0 45 15 10 flat
  button "*",15, 15 45 15 10 flat
  button "/",16, 30 45 15 10 flat
  button "clear",17, 0 55 60 10 flat
  button "=",18, 45 45 15 10 flat
}
on *:DIALOG:calculator.system:*:*:{
  if ($devent == sclick) {
    if ($did == 2) {
      did -a calculator.system 1 1
    }
    if ($did == 3) {
      did -a calculator.system 1 2
    }
    if ($did == 4) {
      did -a calculator.system 1 3
    }
    if ($did == 5) {
      did -a calculator.system 1 4
    }
    if ($did == 6) {
      did -a calculator.system 1 5
    }
    if ($did == 7) {
      did -a calculator.system 1 6
    }
    if ($did == 8) {
      did -a calculator.system 1 7
    }
    if ($did == 9) {
      did -a calculator.system 1 8
    }
    if ($did == 10) {
      did -a calculator.system 1 9
    }
    if ($did == 11) {
      did -a calculator.system 1 0
    }
    if ($did == 12) {
      did -a calculator.system 1 .
    }
    if ($did == 13) {
      did -a calculator.system 1 +
    }
    if ($did == 14) {
      did -a calculator.system 1 -
    }
    if ($did == 15) {
      did -a calculator.system 1 *
    }
    if ($did == 16) {
      did -a calculator.system 1 /
    }
    if ($did == 17) {
      did -r calculator.system 1 
    }
    if ($did == 18) {
      if (!$did(1).text) { noop $input(please add numbers to calculate,udho,Error!) }
      else { did -a calculator.system 1 = $calc($did(1).text)
      }
    }
  }
}

Comments

Sign in to comment.
dlsocool   -  Dec 01, 2010

hahaha ^_^

 Respond  
Sorasyn   -  Nov 19, 2010

$calc($strip($1-))

 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.