MCPcopy Create free account
hub / github.com/JoshuaPostel/texaform / smelt

Method smelt

python/smelter.py:45–64  ·  view source on GitHub ↗
(self, hud: HUD, output: str)

Source from the content-addressed store, hash-verified

43
44
45 def smelt(self, hud: HUD, output: str):
46 output_char = name_char_map[output]
47 (temp, _, buf_out) = self.stat()
48 previous_count = buf_out[output_char]
49 while True:
50 if hud.accumulator_charge() == 0:
51 seconds = 60
52 print(f"ACC CHARGE 0, powering off for {seconds} sec")
53 self.power_off()
54 sleep(seconds)
55 (temp, _, buf_out) = self.stat()
56 if temp < (min_smelt + 50):
57 self.power_on()
58 if temp > (max_smelt - 50):
59 self.power_off()
60 if buf_out[output_char] > previous_count:
61 self.power_off()
62 break
63 # an unluckily timed dog pick could cause this to fail
64 previous_count = buf_out[output_char]
65
66
67

Callers 1

make_smeltableFunction · 0.80

Calls 4

statMethod · 0.95
power_offMethod · 0.95
power_onMethod · 0.95
accumulator_chargeMethod · 0.80

Tested by

no test coverage detected