A very simple script to convert Celsius to Fahrenheit and Fahrenheit to Celcius
Simply paste into remotes, and type:
!F
or
!C
This script is meant for a bot. For personal use, change to
on :INPUT:: {
I was bored, so I beefed this up a little.
on *:TEXT:*:#: {
if ($1 == +convert) {
if (!%no.flood. [ $+ [ $nick ] ] ) {
if (!$2) { msg $chan ERROR $+ : Insufficient Parameters. SYNTAX $+ : +convert c/f <temperature> | halt }
if ($2 isnum) { msg $chan ERROR $+ : Insufficient Parameters. SYNTAX $+ : +convert c/f <temperature> | halt }
if ($2 isletter) { msg $chan ERROR $+ : Insufficient Parameters. SYNTAX $+ : +convert c/f <temperature> | halt }
if ($2 = f) {
if ($3 = 0) { msg $chan Converting 0 $+ $chr(176) Fahrenheit to Celsius: -17.77 $+ $chr(176) Celsius | set -u5 %no.flood. [ $+ [ $nick ] ] 1 | halt }
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 | halt }
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) Celsius
set -u5 %no.flood. [ $+ [ $nick ] ] 1
}
}
if ($2 = c) {
if ($3 = 0) { msg $chan Converting 0 $+ $chr(176) Celsius to Fahrenheit: 32 $+ $chr(176) Fahrenheit | set -u5 %no.flood. [ $+ [ $nick ] ] 1 | halt }
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 | halt }
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) Fahrenheit
set -u5 %no.flood. [ $+ [ $nick ] ] 1
}
}
}
}
}
atleast this way it returns syntax when users perform the command improperly, and checks for flooding.
Why does that look too complicated for something so simple? Oh yeah! It\'s because you like to insult people :P
Fair enough job on this one.
you might concider making a dialog, maybe with a tab system between converting from c - f or f - c, id like to see you expand this, maybe currency, all in all good job =D 4/10
If that\'s the case, then why don\'t we just make a fully-function dialog to replicate a calculator? In fact, I\'ll get right on that ;)
As for putting JUST this portion into a dialog...I could probably do that in about 5 minutes (if I had the motivation to do so).