Riht_2\'s Calculator Dialog

By Riht_2 on Jun 14, 2008

This is just a simple calculator dialog. You need a mouse to use it. It doesn't need a specific mIRC version as far as I can tell. It SHOULD be easy to use. Hope it helps whoever tries it!

dialog calcu {
  title "Calculator"
  size -1 -1 149 100
  option dbu
  edit , 1, 1 1 147 14, autohs, read
  button 1, 2, 86 16 20 20
  button 2, 3, 107 16 20 20
  button 3, 4, 128 16 20 20
  button 4, 5, 86 37 20 20
  button 5, 6, 107 37 20 20
  button 6, 7, 128 37 20 20
  button 7, 8, 86 58 20 20
  button 8, 9, 107 58 20 20
  button 9, 10, 128 58 20 20
  button 0, 11, 86 79 20 20
  button ., 12, 107 79 20 20
  button Clear, 13, 2 16 20 20
  button %, 14, 44 16 20 20
  button x^2, 15, 44 37 20 20
  button x^3, 16, 44 58 20 20
  button x^y, 17, 44 79 20 20
  button pi, 18, 65 16 20 20
  button /, 19, 23 79 20 20
  button *, 20, 23 58 20 20
  button +, 21, 23 16 20 20
  button -, 22, 23 37 20 20
  button =, 23, 65 37 20 20
  button Off, 24, 2 37 20 20
  button (, 25, 2 58 20 20
  button ), 26, 2 79 20 20
  button Copy, 27, 128 79 20 20
  button "Round", 28, 65 58 20 20
}

On *:Dialog:calcu:sclick:*: {
  if (%sol = Yes) { did -r calcu 1 | set %sol No }
  if ($did = 2) { did -a calcu 1 1 }
  if ($did = 3) { did -a calcu 1 2 }
  if ($did = 4) { did -a calcu 1 3 }
  if ($did = 5) { did -a calcu 1 4 }
  if ($did = 6) { did -a calcu 1 5 }
  if ($did = 7) { did -a calcu 1 6 }
  if ($did = 8) { did -a calcu 1 7 }
  if ($did = 9) { did -a calcu 1 8 }
  if ($did = 10) { did -a calcu 1 9 }
  if ($did = 11) { did -a calcu 1 0 }
  if ($did = 12) { did -a calcu 1 . }
  if ($did = 13) { did -r calcu 1 }
  if ($did = 14) { did -a calcu 1 % }
  if ($did = 15) { did -a calcu 1 ^2 }
  if ($did = 16) { did -a calcu 1 ^3 }
  if ($did = 17) { did -a calcu 1 ^ }
  if ($did = 18) { did -a calcu 1 3.14159265 }
  if ($did = 19) { did -a calcu 1 / }
  if ($did = 20) { did -a calcu 1 * }
  if ($did = 21) { did -a calcu 1 + }
  if ($did = 22) { did -a calcu 1 - }
  if ($did = 23) {
    if (%rnd = yes) { set %prob $did(1) | did -r calcu 1 | set %ans $ceil($calc(%prob)) | did -a calcu 1 %ans }
    if (%rnd != yes) { set %prob $did(1) | did -r calcu 1 | set %ans $calc(%prob) | did -a calcu 1 %ans }
    set %sol Yes
    set %rnd No
  }
  if ($did = 24) { did -r calcu 1 }
  if ($did = 25) { did -a calcu 1 ( }
  if ($did = 26) { did -a calcu 1 ) }
  if ($did = 27) { clipboard %prob = %ans }
  if ($did = 28) { set %rnd Yes }
}

menu nicklist,menu,status,query,channel {
  Calculator: calcu
}

alias calcu {
  dialog -mdia calcu calcu
}

Comments

Sign in to comment.
Riht_2   -  Jun 15, 2008

xD Makes it easier for special people to use it.

 Respond  
napa182   -  Jun 15, 2008

dialog is way too big

 Respond  
Riht_2   -  Jun 14, 2008

Thanks. I\'m kind of new to dialog, but I\'m starting to get the hang of it..

 Respond  
PuNkTuReD   -  Jun 14, 2008

ver nice man
8 from me
:)

 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.