I Translated this from mIRC, so it's easy to see the resemblance in the codes.
mIRC Snippet
on *:TEXT:*:#: {
if ($1 == !convert) {
if (!%no.flood. [ $+ [ $nick ] ]) {
if (!$2) { msg $chan ERROR $+ : Insufficient Parameters. SYNTAX $+ : !convert c/f <temperature> | return }
if ($2 isnum) { msg $chan ERROR $+ : Insufficient Parameters. SYNTAX $+ : !convert c/f <temperature> | return }
if ($2 == f) {
if ($3 == 0) { msg $chan Converting 0 $+ $chr(176) Fahrenheit to Celsius: -17.77 $+ $chr(176) $+ C | set -u5 %no.flood. [ $+ [ $nick ] ] 1 | return }
if (!$3) { msg $chan $nick $+ , I need a temperature to convert. }
if ($3 isletter) { msg $chan Converting $3 $+ : You're an Idiot? | set -u5 %no.flood. [ $+ [ $nick ] ] 1 | return }
if ($3 isnum) {
set %t1 $calc($3 - 32)
set %temp $calc(%t1 * 0.55555555555555555555555555555556)
msg $chan Converting $3 $+ $chr(176) Fahrenheit to Celsius: $round(%temp,2) $+ $chr(176) $+ C
set -u5 %no.flood. [ $+ [ $nick ] ] 1
}
}
if ($2 == c) {
if ($3 == 0) { msg $chan Converting 0 $+ $chr(176) Celsius to Fahrenheit: 32 $+ $chr(176) $+ F | set -u5 %no.flood. [ $+ [ $nick ] ] 1 | return }
if (!$3) { msg $chan $nick $+ , I need a temperature to convert. }
if ($3 isletter) { msg $chan Converting $3 $+ : You're an Idiot? | set -u5 %no.flood. [ $+ [ $nick ] ] 1 | return }
if ($3 isnum) {
set %t1 $calc($3 * 1.8)
set %temp $calc(%t1 + 32)
msg $chan Converting $3 $+ $chr(176) Celsius to Fahrenheit: $round(%temp,2) $+ $chr(176) $+ F
set -u5 %no.flood. [ $+ [ $nick ] ] 1
}
}
}
}
}
Enjoy either ;)