Project

General

Profile

[Script] Very simple calc

Added by Mr. Matt 3 months ago

A simple calculator.
Type /dcalc 6+7

alias dcalc {
  if ($window(@calc)) { clear @calc | window -a @calc }
  else { window -adBkCfe2 +t @calc $calc($window(-1).w /2 -75) $calc($window(-1).h /2 -100) 150 200 }
  if ($1) { editbox -n @calc $1- }
}
on *:INPUT:@calc: {
  if ($left($1,1) != /) && (!$ctrlenter) {
    var %:calc = $1-
    aline -pi 14 @calc %:calc
    aline -pi 4 @calc = $calc(%:calc)
    editbox @calc $calc(%:calc)
    halt
  }
}