Temperature Converter (C - F and F - C)

By Pepsi_Man0077 on Jan 20, 2008

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:: {

Comments

Sign in to comment.
Get_A_Fix   -  May 06, 2008

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.

 Respond  
kslice917   -  Mar 02, 2008

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).

 Respond  
Levy   -  Jan 21, 2008

Excellent Script. Great Job.

 Respond  
Korvin   -  Jan 21, 2008

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

 Respond  
jub369   -  Jan 20, 2008

i love this bot it works so good

 Respond  
jub369   -  Jan 20, 2008

its cool i swear

 Respond  
Pepsi_Man0077   -  Jan 20, 2008

I just updated it, you might like it better now.

 Respond  
jub369   -  Jan 20, 2008

its good and it works geart job

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.