mIRC Home    About    Download    Register    News    Help

Print Thread
#252246 30/03/15 02:20 AM
Joined: Sep 2014
Posts: 83
H
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

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
uhh if right $2 == % then remove % / 100

Joined: Sep 2014
Posts: 83
H
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? >.<

Joined: Sep 2014
Posts: 259
S
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.
Joined: Sep 2014
Posts: 83
H
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


Link Copied to Clipboard