Top

Calculator

Please Register to submit score.
Average Score  7.3
Scores Submitted  8
Date Added  Jul 23, 2007
Last Updated  Feb 09, 2008
Tags  calculator 

Introduction

Just a Simple Calculator Dialog... copy and paste into a new remote and click in a channel and click Calculator to open. Enjoy.

Grab the Code

Comments

  (12)  RSS
Callison1
Comments: 130
 
mIRC Snippet:  Calculator
Posted on Jul 24, 2007 4:08 am
Nice, except more buttons wouldn't hurt, like ^ etc.

Also the editbox needs to be moved over slightly, the end is cut off to start with. 5/10
napa182
Comments: 797
 
mIRC Snippet:  Calculator
Posted on Jul 24, 2007 4:46 am
haha wow you have a good eye. i didnt even see that till you said it. "Thanks" Yeah il add more to it later.
Lindrian
Comments: 694
 
mIRC Snippet:  Calculator
Posted on Jul 24, 2007 4:54 am
Here I am.
If the dialog is already open,
-
* /dialog: 'c' name in use (line 29, script5.mrc)
-
solved by using:
Code:

Dialog $iif($dialog(dname),-v,-m) dname dname


When you type something in, the old value remains, after you press a new button and there's already something inside the box (after u pressed =) it should be wiped.
Can be solved by using a variable, to indicate the = was pressed etc.
You should also consider some alignment, it looks rather horrible with all edit boxes etc :P

4/10
Callison1
Comments: 130
 
mIRC Snippet:  Calculator
Posted on Jul 24, 2007 1:13 pm
Lindrian, I think instead of the old value being wiped automatically when you press a new number, there should be a clear button, so you can clear it if you want, but if you want to perform a new calculation using the old result, you can.
Callison1
Comments: 130
 
mIRC Snippet:  Calculator
Posted on Jul 24, 2007 1:14 pm
I see now that there is already a clear button, I think that with reguards to the result remaining in the box, it should stay as it is.
ZabuzaMomochi
Comments: 186
 
mIRC Snippet:  Calculator
Posted on Jul 25, 2007 12:24 pm
You can change all the elseifs to just normal 'if' Though once again, i would prefer mine of this one.
Korvin
Comments: 241
 
mIRC Snippet:  Calculator
Posted on Feb 9, 2008 1:55 am
Code:
on *:DIALOG:cal:sclick:*: {
  if ($did == 21) { set %sum $calc( $did(3) ) | did -r cal 3 | did -a cal 3 %sum }
  if ($did == 5) { sum.clr }
  if ($did == 7) { $iif(%sum,sum.clr) | did -a cal 3 7 }
  if ($did == 8) { $iif(%sum,sum.clr) | did -a cal 3 8 }
  if ($did == 9) { $iif(%sum,sum.clr) | did -a cal 3 9 }
  if ($did == 10) { $iif(%sum,sum.clr) | did -a cal 3 / }
  if ($did == 11) { $iif(%sum,sum.clr) | did -a cal 3 4 }
  if ($did == 12) { $iif(%sum,sum.clr) | did -a cal 3 5 }
  if ($did == 13) { $iif(%sum,sum.clr) | did -a cal 3 6 }
  if ($did == 14) { $iif(%sum,sum.clr) | did -a cal 3 * }
  if ($did == 15) { $iif(%sum,sum.clr) | did -a cal 3 1 }
  if ($did == 16) { $iif(%sum,sum.clr) | did -a cal 3 2 }
  if ($did == 17) { $iif(%sum,sum.clr) | did -a cal 3 3 }
  if ($did == 18) { $iif(%sum,sum.clr) | did -a cal 3 - }
  if ($did == 19) { $iif(%sum,sum.clr) | did -a cal 3 0 }
  if ($did == 20) { $iif(%sum,sum.clr) | did -a cal 3 + }
  if ($did == 22) { $iif(%sum,sum.clr) | did -a cal 3 . }
  if ($did == 6) { $iif(%sum,sum.clr) | did -a cal 3 ^ }
  if ($did == 4) { set %sum $sqrt($did(3)) | did -r cal 3 | did -a cal 3 %sum }
  if ($did == 23) { /run http://www.freewebs.com/shideezdi/index.htm }
}
alias sum.clr {
  did -r cal 3
  unset %sum
}
did what lindrian suggested =D works gr8
Korvin
Comments: 241
 
mIRC Snippet:  Calculator
Posted on Feb 9, 2008 1:58 am
what i did, is added this to all the if ($did's
Code:
$iif(%sum,sum.clr) |
and also, i added
Code:
alias sum.clr {
  did -r cal 3
  unset %sum
}
then finally, i changed the var %sum's to set %sum =D
Ivanalicius
Comments: 15
 
mIRC Snippet:  Calculator
Posted on Feb 9, 2008 2:48 am
Nice and simple calculator. But my suggestion is next time to add sin(Sinus) , Cos(cosinus) , tan(Tanges) ;)
napa182
Comments: 797
 
mIRC Snippet:  Calculator
Posted on Feb 9, 2008 2:50 am
i dont get why you would want to clear the sum after you click equals ? i still like to keep the sum there so i can add to it and so on. also there is no need to use a global var for the way i have this script.
napa182
Comments: 797
 
mIRC Snippet:  Calculator
Posted on Feb 9, 2008 5:00 am
ok i added sin, asin, cos, acos, tan, atan, round, abs, and log enjoy ;)
log2
Comments: 52
 
mIRC Snippet:  Calculator
Posted on Feb 10, 2008 5:54 am
log2?

Please Register or Login to start posting comments.
Bottom