Updates:

Mata al pato \_O< en el canal #Traffic-Games

Calculadora

Iniciado por TerraChat, Sep 26, 2023, 09:07 AM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

TerraChat

bind pub -|- "!calc" pub:calc

set calc(version) "1.0"

proc pub:calc {nick uhost hand chan text} {
  global lastbind
 
  if {[string length [string trim [lindex $text 0]]] == 0} {
    putserv "NOTICE $nick :Ejemplo: $lastbind 19 + 75"
    return 0
  }
  regsub -all "x" $text "*" math
  regsub -all "pi" $math "3.1415926535897932" math
  if {![regexp -all {\[} $text] || ![regexp -all {\]} $text]} {
    putserv "PRIVMSG $chan :$text = [expr $math]"
    putserv "NOTICE $nick :Otro servicio mas de terrachat.cl"
  } else {
    putserv "NOTICE $nick :No fue posible completar la operación!"
  }
 
  putlog "($lastbind) $nick $uhost no $chan: $text"
 
}

putlog "=== Calculadora version$calc(version) ==="