mIRC Home    About    Download    Register    News    Help

Print Thread
how to set for only number... #248942 07/11/14 02:33 AM
Joined: Sep 2014
Posts: 83
H
HappyFappy Offline OP
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
Code:
ON *:TEXT:*!calc*:#:{ 
  set %nulle $2 * 0.000025
  msg # Total: %nulle BTC!
}


That is what I have....

my question is how to set so that it see's $2 as a number, and if anything else, it just messages "use a number"

like:

!calc 1000
returns: Total: 0.025btc

and
!calc taco
returns: Please Use a Number

Re: how to set for only number... [Re: HappyFappy] #248943 07/11/14 02:48 AM
Joined: Oct 2009
Posts: 24
Scakk Offline
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2009
Posts: 24
Code:
ON *:TEXT:*!calc*:#:{ 
  if ($2 isnum) { 
    set %nulle $2 * 0.000025
    msg # Total: %nulle BTC!
  }
  else { msg # Please Use a Number }
}

Re: how to set for only number... [Re: Scakk] #248944 07/11/14 02:49 AM
Joined: Sep 2014
Posts: 83
H
HappyFappy Offline OP
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
thank you