Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boilerheatup {
- if (!$1) { echo -tg No bioler type specified, assuming HP. }
- if (!$2) { echo -tg No boiler size specified, assuming 36. }
- if (!$3) { echo -tg No fuel heat value specified, assuming 96,000 (Fuel). }
- echo -tg This is probably going to lock up your client for a little while. If you want to bail, press CTRL + ALT + PauseBreak
- var %btype = $iif($1, $v1, HP)
- var %hplp_div = $iif(%btype == LP, 16, 8)
- var %bsize = $iif($2, $v1, 36)
- var %maxtemp = $iif(%btype == LP, 500, 1000)
- var %temp = 20
- var %heatstep = 0.05
- var %ticks = 0
- var %fuel = 0
- var %fuelheat = $iif($3, $v1, 96000)
- while (%temp < %maxtemp) {
- var %t_fuel = $calc(((6.4 - %bsize * 0.08) / %hplp_div) * %bsize * (1 + 8 * (1 - %temp / %maxtemp)))
- %fuel = $calc(%fuel + %t_fuel)
- var %heatchange = %heatstep
- if (%temp < $calc(0.25*%maxtemp)) {
- %heatchange = $calc(%heatchange + %heatstep)
- }
- if (%temp < $calc(0.5*%maxtemp)) {
- %heatchange = $calc(%heatchange + %heatstep)
- }
- if (%temp < $calc(0.75*%maxtemp)) {
- %heatchange = $calc(%heatchange + %heatstep)
- }
- %heatchange = $calc(%heatchange / %bsize)
- %temp = $calc(%temp + %heatchange)
- inc %ticks
- }
- 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.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement