Advertisement
iPeer

Usage: /boilerheatup LP/HP size fuelheat

May 12th, 2013
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.40 KB | None | 0 0
  1. boilerheatup {
  2.   if (!$1) { echo -tg No bioler type specified, assuming HP. }
  3.   if (!$2) { echo -tg No boiler size specified, assuming 36. }
  4.   if (!$3) { echo -tg No fuel heat value specified, assuming 96,000 (Fuel). }
  5.   echo -tg This is probably going to lock up your client for a little while. If you want to bail, press CTRL + ALT + PauseBreak
  6.   var %btype = $iif($1, $v1, HP)
  7.   var %hplp_div = $iif(%btype == LP, 16, 8)
  8.   var %bsize = $iif($2, $v1, 36)
  9.   var %maxtemp = $iif(%btype == LP, 500, 1000)
  10.   var %temp = 20
  11.   var %heatstep = 0.05
  12.   var %ticks = 0
  13.   var %fuel = 0
  14.   var %fuelheat = $iif($3, $v1, 96000)
  15.   while (%temp < %maxtemp) {
  16.     var %t_fuel = $calc(((6.4 - %bsize * 0.08) / %hplp_div) * %bsize * (1 + 8 * (1 - %temp / %maxtemp)))
  17.     %fuel = $calc(%fuel + %t_fuel)
  18.     var %heatchange = %heatstep
  19.     if (%temp < $calc(0.25*%maxtemp)) {
  20.       %heatchange = $calc(%heatchange + %heatstep)
  21.     }
  22.     if (%temp < $calc(0.5*%maxtemp)) {
  23.       %heatchange = $calc(%heatchange + %heatstep)
  24.     }
  25.     if (%temp < $calc(0.75*%maxtemp)) {
  26.       %heatchange = $calc(%heatchange + %heatstep)
  27.     }
  28.     %heatchange = $calc(%heatchange / %bsize)
  29.     %temp = $calc(%temp + %heatchange)
  30.     inc %ticks
  31.   }
  32.   echo -tg Boiler was fully heated after $bytes(%ticks, b) ticks ( $+ $duration($calc(%ticks / 20),3) $+ , assuming 20TPS) using $bytes($ceil($calc(%fuel / %fuelheat)), b) buckets of fuel.
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement