Converter — File Browser

Converterv0.3 / Converterv0.3 / htn_conv.mrc

htn_conv.mrc — 3.44 KB — Download this file

; Converter v0.3 by Hjorten
; Designed for mIRC 6.03 :P

DIALOG htn_conv {
  title "Converter [/conv]"
  size -1 -1 94 61
  option dbu
  edit "", 1, 1 27 92 10
  button "Copy", 2, 39 48 16 12
  button "Close", 3, 1 48 37 12, ok
  edit "", 4, 1 37 92 10, read autohs
  combo 5, 1 2 92 50, size drop
  button "Convert", 6, 56 48 37 12
  text "Converter v0.3 by Hjorten", 7, 1 16 92 8, center
}

on *:LOAD:{
  echo -a *** Converter v0.3 by Hjorten has been loaded.
  echo -a *** Type /conv to open up the dialog.
}

on *:UNLOAD:{
  echo -a *** Converter v0.3 by Hjorten has been removed.
  echo -a *** Thanks for trying it out :).
}

alias conv { dialog -mrv htn_conv htn_conv }

alias htn_do_conv {
  if (%htnconv == F2C) { did -ra htn_conv 4 $did($dname,1).text farenheit is $calc(($did($dname,1).text - 32) / 1.8) celsius. }
  elseif (%htnconv == C2F) { did -ra htn_conv 4 $did($dname,1).text celsius is $calc(($did($dname,1).text * 1.8) + 32) farenheit. }
  elseif (%htnconv == M2F) { did -ra htn_conv 4 $did($dname,1).text meters is $calc($did($dname,1).text * 3.28084) feet. }
  elseif (%htnconv == F2M) { did -ra htn_conv 4 $did($dname,1).text feet is $calc($did($dname,1).text / 3.28084) meters. }
  elseif (%htnconv == C2I) { did -ra htn_conv 4 $did($dname,1).text centimeters is $calc($did($dname,1).text * 0.3937) inches. }
  elseif (%htnconv == I2C) { did -ra htn_conv 4 $did($dname,1).text inches is $calc($did($dname,1).text / 0.3937) centimeters. }
  elseif (%htnconv == K2P) { did -ra htn_conv 4 $did($dname,1).text kilos is $calc($did($dname,1).text * 2.20462) pounds. }
  elseif (%htnconv == P2K) { did -ra htn_conv 4 $did($dname,1).text pounds is $calc($did($dname,1).text / 2.20462) kilos. }
  elseif (%htnconv == M2KM) { did -ra htn_conv 4 $did($dname,1).text miles is $calc($did($dname,1).text / 0.62137) kilometers. }
  elseif (%htnconv == KM2M) { did -ra htn_conv 4 $did($dname,1).text kilometers is $calc($did($dname,1).text * 0.62137) miles. }
}

on *:DIALOG:htn_conv:INIT:*: {
  did -a $dname 5 Farenheit to celsius
  did -a $dname 5 Celsius to farenheit
  did -a $dname 5 Meters to feet
  did -a $dname 5 Feet to meters
  did -a $dname 5 Centimeters to inches
  did -a $dname 5 Inches to centimeters
  did -a $dname 5 Kilos to pounds
  did -a $dname 5 Pounds to kilos
  did -a $dname 5 Kilometers to miles
  did -a $dname 5 Miles to kilometers
}

on *:DIALOG:htn_conv:SCLICK:6: {
  if ($did($dname,1) !isnum) { did -ra htn_conv 4 Invalid value, try again. | return }
  elseif ($did($dname,5,1).seltext == Farenheit to celsius) { set %htnconv F2C }
  elseif ($did($dname,5,2).seltext == Celsius to farenheit) { set %htnconv C2F }
  elseif ($did($dname,5,3).seltext == Meters to feet) { set %htnconv M2F }
  elseif ($did($dname,5,4).seltext == Feet to meters) { set %htnconv F2M }
  elseif ($did($dname,5,5).seltext == Centimeters to inches) { set %htnconv C2I }
  elseif ($did($dname,5,6).seltext == Inches to centimeters) { set %htnconv I2C }
  elseif ($did($dname,5,7).seltext == Kilos to pounds) { set %htnconv K2P }
  elseif ($did($dname,5,8).seltext == Pounds to kilos) { set %htnconv P2K }
  elseif ($did($dname,5,9).seltext == Kilometers to miles) { set %htnconv KM2M }
  elseif ($did($dname,5,10).seltext == Miles to kilometers) { set %htnconv M2KM }
  htn_do_conv
}

on *:DIALOG:htn_conv:SCLICK:2: { clipboard $did($dname,4) }
on *:DIALOG:htn_conv:CLOSE:0: { dialog -x htn_conv htn_conv | unset %htnconv }

;EOF