mIRC Home    About    Download    Register    News    Help

Print Thread
Help w/ calculating.... #252246 30/03/15 02:20 AM
Joined: Sep 2014
Posts: 83
H
HappyFappy Offline OP
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
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

Re: Help w/ calculating.... [Re: HappyFappy] #252247 30/03/15 02:28 AM
Joined: Jun 2014
Posts: 248
B
Belhifet Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
uhh if right $2 == % then remove % / 100

Re: Help w/ calculating.... [Re: Belhifet] #252248 30/03/15 02:39 AM
Joined: Sep 2014
Posts: 83
H
HappyFappy Offline OP
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
Originally Posted By: Belhifet
uhh if right $2 == % then remove % / 100



how would this show? >.<

Re: Help w/ calculating.... [Re: HappyFappy] #252254 30/03/15 08:40 AM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
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.
Re: Help w/ calculating.... [Re: Sakana] #252256 30/03/15 01:25 PM
Joined: Sep 2014
Posts: 83
H
HappyFappy Offline OP
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
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