calculator dialog
Platform: mIRC
Published Sep 10, 2011
Updated Jun 23, 2012
to use open up the dialog through the menu
and click the buttons and click calculate
i will try and update and make it better soon
have fun ;)
$comma alias by: FiberOPtics
alias -l comma {
var %a, %b = $regsub($ticks,$$1,/\G([+-]?\d+?)(?=(?:\d{3})++(?=\.\d++$|$))/g,\1 $+ $chr(44),%a)
return %a
}
dialog calc {
title "Dialog Calculator"
size -1 -1 150 112
option dbu
box "Calculator Controls" 1, 5 5 140 60
box "Calculation/Awnser" 2, 5 67 140 38
button "1" 3, 9 14 20 10
button "2" 4, 31 14 20 10
button "3" 5, 52 14 20 10
button "4" 6, 9 26 20 10
button "5" 7, 31 26 20 10
button "6" 8, 52 26 20 10
button "7" 9, 9 38 20 10
button "8" 10, 31 38 20 10
button "9" 11, 52 38 20 10
button "0" 12, 9 50 42 10
button "k" 13, 78 14 20 10
button "m" 14, 99 14 20 10
button "b" 15, 120 14 20 10
button "." 16, 52 50 20 10
button "+" 17, 78 26 20 10
button "-" 18, 99 26 20 10
button "*" 19, 120 26 20 10
button "/" 20, 78 37 20 10
button "Clear All" 21, 99 37 41 10
edit "" 22, 10 75 130 12, autohs read multi
button "Calculate" 23, 10 89 130 10
}
menu * {
Calculator:{
dialog $iif($dialog(calc),-v,-md) calc calc
}
}
alias calc {
dialog -mt calc calc
}
on *:dialog:calc:sclick:19:{ did -a calc 22 * }
on *:dialog:calc:sclick:18:{ did -a calc 22 - }
on *:dialog:calc:sclick:9:{ did -a calc 22 7 }
on *:dialog:calc:sclick:10:{ did -a calc 22 8 }
on *:dialog:calc:sclick:11:{ did -a calc 22 9 }
on *:dialog:calc:sclick:17:{ did -a calc 22 + }
on *:dialog:calc:sclick:6:{ did -a calc 22 4 }
on *:dialog:calc:sclick:7:{ did -a calc 22 5 }
on *:dialog:calc:sclick:8:{ did -a calc 22 6 }
on *:dialog:calc:sclick:3:{ did -a calc 22 1 }
on *:dialog:calc:sclick:4:{ did -a calc 22 2 }
on *:dialog:calc:sclick:5:{ did -a calc 22 3 }
on *:dialog:calc:sclick:12:{ did -a calc 22 0 }
on *:dialog:calc:sclick:16:{ did -a calc 22 . }
on *:dialog:calc:sclick:13:{ did -a calc 22 k }
on *:dialog:calc:sclick:14:{ did -a calc 22 m }
on *:dialog:calc:sclick:15:{ did -a calc 22 b }
on *:dialog:calc:sclick:21:{ did -r calc 22 }
on *:dialog:calc:sclick:20:{ did -a calc 22 / }
on *:dialog:calc:sclick:23:{
if (!$did(22)) {
noop $input(Please specify a calculation in the edit box and click calculate,w,Warning!)
}
else {
did -ra calc 22 $comma($calc($replace($remove($did(22),$chr(44)),pi,$pi,m,000000,k,000,b,000000000)))
}
}