mIRC Home    About    Download    Register    News    Help

Print Thread
#252246 30/03/15 02:20 AM
H
HappyFappy
HappyFappy
H
this is what I have:
Code:
ON *:TEXT:!calc*:#roflmao:{ 
    if ($3 == -) {
      Set %num $2 - $4
      timer1 1 2 msg # %num
      halt
    }
    if ($3 == +) { 
      Set %num $2 + $4
      timer1 1 2 msg # %num
      halt
    }
    if ($3 == *) { 
      Set %num $2 * $4
      timer1 1 2 msg # %num
      halt
    }
    if ($3 == /) { 
      Set %num $2 / $4
      timer1 1 2 msg # %num
      halt
    }
    if ($3 == of) { 
      Set %num $2 ? $4
      timer1 1 2 msg # %num
      halt
    }
}

how can I set this to accept percentage?
like: !calc 13% of 1025

B
Belhifet
Belhifet
B
uhh if right $2 == % then remove % / 100

H
HappyFappy
HappyFappy
H
Originally Posted By: Belhifet
uhh if right $2 == % then remove % / 100



how would this show? >.<

S
Sakana
Sakana
S
This should work
Code:
if ($3 == of) { 
      %a $remove($2,$chr(37))
      %a $calc(%a / 100)
      .timer 1 2 msg # $calc($4 * %a) 
      halt
    }

Last edited by Sakana; 30/03/15 08:41 AM.
H
HappyFappy
HappyFappy
H
Originally Posted By: Sakana
This should work
Code:
if ($3 == of) { 
      %a $remove($2,$chr(37))
      %a $calc(%a / 100)
      .timer 1 2 msg # $calc($4 * %a) 
      halt
    }

Thank you smile


Link Copied to Clipboard