This revolutionary program can turn any block into a peripheral! Wrap it like any other peripheral, and change its settings, or gather its data.
Contact your local OmegasTech representative for a FREE copy of our promotional material.[/salespitch]
Yep, this silly little API can wrap any adjacent block.
Doc:
Spoiler
block.wrap() -- Wraps the block for manipulation
block.call(string side, string function, params[not a table, please]) -- Calls a specified function on a specified side.
b.activate(boolean) -- Powers or depowers the block's redstone. Use without a parameter to toggle the current state.
b.isActive() -- Checks the status of the block.
b.pulse(int count, int slp) -- Pulses the blocks signal count times and sleeps for slp seconds.
This is mostly just a silly thing that has, at times, helped me with larger projects. It turned 10 lines into 5 in one section, for instance.
Anyway, if you find this useful, please do not hesitate to pastebin this code, or download it below.
pastebin get nwf10MdP
or
Download
Changelog:
v0.7: Added .call to the
v0.6: Added .pulse to the function list.
v0.51: Fixed 1 error (Thanks Eric)
v0.5: Initial release.
Planned Features (if I find the time):
– Fix .call (There's some issues I'm working out, but it should work normally anyway)
– events (coroutines are kicking me you know where)
– installer (Probably in 1.0)
– setPower(int) and getPower()
Happy Coding!
PS. All you potential naysayers: I thought it was funny.