This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TomyLobo's profile picture

[1.4.7] [CC 1.481] CCRedbus - control Redbus devices (like Sortron) with ComputerCraft

Started by TomyLobo, 23 May 2013 - 07:00 AM
TomyLobo #1
Posted 23 May 2013 - 09:00 AM
Purpose:
Adds a "North Bridge" peripheral for ComputerCraft that can interface with RedPower's Redbus/Ribbon Cables.

Download:
0.0.6 (Beta)

Screenshots:
Spoiler
(courtesy of gamax92)

Recipes:
SpoilerNorth Bridge:
SSS
SRS
SCS
S = Clean stone
R = Redstone dust
C = Ribbon cable

Interface:
Spoilerredbus.getAddr(deviceId)
- Returns the deviceId of the device with the given id. This is kinda useless but it's in here for completeness's sake

redbus.setAddr(deviceId, value)
- Sets the deviceId of the device with the

redbus.read(deviceId, offset)
- Reads the specified offset on the specified device

redbus.write(deviceId, offset, value)
- Writes the specified value into the specified offset on the specified device

redbus.sortronProcessCommand
- (Sortron only) Processes the last command immediately, without waiting the usual 2 ticks. The Sortron might still stall on some commands.

An API that simplifies wrapping and sortron control is in the works and I'll add it as soon as I figure out how to install it and autoload it. Message me on IRC if you want the API as is.

Config:
Spoilerblock.northBridgeBlockID
- The block ID for the "North Bridge" block (default=1320)

Credits:
- Texture by Jakingtosch
- build.xml taken from OpenCCSensors

Changelog:
Spoiler0.0.6 (Beta)
- Increased hardness
- Changed texture
- Added redbus API
- Changed the orientation datavalues. I recommend re-placing every ccredbus you placed if you care about the orientation.

0.0.5 (Beta)
- First public release

Known issues:
- Tell me if you're aware of any

Source:
The source code is available at https://github.com/TomyLobo/ccredbus under the LGPLv3 (until someone makes a valid case for another license)

Hate messages:
SpoilerThings I've been called on IRC after pasting the link to this thread on #redpower:
[18:10:30] -eearslya- [Thank you for b]anning TomyLobo. You cannot believe how badly I facepalmed when I saw what he posted.
[18:54:05] -hawk777- Eearslya: The bastard just explained. He broke into the sortron to make it faster.
[19:48:26] -gruetzkopf- that is permission for modpacks, stupid
[19:48:36] -tomylobo- would you mind not insulting me?
[19:48:45] -gruetzkopf- nope, trottel [german for "moron"]
[21:04:40] -eearslya- I would like to take this time out of my day to say one thing. I think you are a scumbag. That is all.
nutcase84 #2
Posted 23 May 2013 - 11:42 AM
W O W. Awesome. But you know you could make something like this using redpower bundled cables.
TomyLobo #3
Posted 23 May 2013 - 11:53 AM
yeah, computing at the speed of sound!
xuma202 #4
Posted 23 May 2013 - 12:00 PM
Yeah awesome
PixelToast #5
Posted 23 May 2013 - 01:14 PM
amazing
not sure why people hate collaborating and making mods cross compatible
im only getting silence and circular logic from some devs
electrodude512 #6
Posted 23 May 2013 - 02:32 PM
this means i can use a sortron with CC?!?!? <downloads mod>
TomyLobo #7
Posted 23 May 2013 - 02:43 PM
yes, in fact i combined this mod with the sortron and ccnoise and now there's a horn signal whenever a certain item is missing in my ender pouch (another ender pouch)
immibis #8
Posted 23 May 2013 - 05:20 PM
Eloraam doesn't like people reverse engineering RedPower, and I wouldn't be surprised if this gets removed from the forum.
TomyLobo #9
Posted 23 May 2013 - 07:34 PM
Eloraam doesn't like people reverse engineering RedPower, and I wouldn't be surprised if this gets removed from the forum.

Then it's still available on my homepage and github. I'll probably reopen the topic I had on the minecraft forums, too.
It'd still be better to have this on here where it belongs, though. It's a peripheral made for ComputerCraft, after all.
PixelToast #10
Posted 24 May 2013 - 12:23 AM
will always support this, still not sure why this would get removed
ElvishJerricco #11
Posted 25 May 2013 - 05:55 PM
Technically you're not modifying redpower at all. Eloraam would be pissed to find this, but you're not doing anything illegal by any definition.
Mandrake Fernflower #12
Posted 25 May 2013 - 07:06 PM
+1 for breaking the 4th wall. Also I have a few choice words for gruetzkopf.
TomyLobo #13
Posted 25 May 2013 - 07:41 PM
breaking the 4th wall? you'll have to explain how that metaphor applies here :)/>
H4X0RZ #14
Posted 25 May 2013 - 08:01 PM
gruetzkopf is german right?

So, answer in german. :P/>/>/>

Something like this:
Original:
Wer in einem Glashaus sitzt sollte nicht mit Steinen werfen. Du wirfst mit ganzen Felsbrocken!

english translation (It's a metaphor):
don't offend anyone if it also applies to you. And it APPLIES to you!

^^
TomyLobo #15
Posted 25 May 2013 - 08:04 PM
You realize I'm German too? :)/>/>

and the point of the "hate messages" section wasn't to get replies but to show off the rather limited range of negative responses I got.
H4X0RZ #16
Posted 25 May 2013 - 08:07 PM
You realize I'm German too? :)/>/>/>

and the point of the "hate messages" section wasn't to get replies but to show off the rather limited range of negative responses I got.
Oh, sorry :D/>
TomyLobo #17
Posted 26 May 2013 - 07:52 PM
Getting close to bundling the API with the mod. Just need dan's permission because of the way I'm doing it.
JustPingo #18
Posted 27 May 2013 - 11:38 AM
Why so many hatred ? xD

Awesome ! I was looking for somthing like this since a long time !
+ 1
TomyLobo #19
Posted 03 June 2013 - 03:11 PM
0.0.6 (Beta)
- Increased hardness
- Changed texture
- Added redbus API
- Changed the orientation datavalues. I recommend re-placing every ccredbus you placed if you care about the orientation.
TomyLobo #20
Posted 03 June 2013 - 03:18 PM
Improved the texture's compression, for a slightly decreased download size.
TomyLobo #21
Posted 03 June 2013 - 03:37 PM
fixed the link. oops.
natedogith1 #22
Posted 09 June 2013 - 03:14 AM
might I request some functions and events so that redpower computers can talk to the peripheral? Probably events for read/write and a function that sets and gets the values that can be read(cause you can't(as far as I'm aware) call a function directly without doing weird things like somehow grabbing the lua function and compiling it into java); actually, looking at your speaker mod, you could perhaps add an option similar to how you did the functions for sound generation for the read/write(though I'm not sure if this would ever be useful)
TomyLobo #23
Posted 09 June 2013 - 10:43 AM
Adding such a feature would force me to use RPC.
Avoiding RPC was the reason why I made this peripheral.
What's your use case anyway?
MaHuJa #24
Posted 10 June 2013 - 12:21 PM
I, for one, would like to see the reverse in some form.

One of the reasons to use RPC rather than CC is that it maintains a consistent state through reloads. Something which is not possible in CC, and (official line) will not be. Approximating it is hard, too.
Plus, it behaves more like a computer, and is far kinder to the server. (It has memory limits!)
TomyLobo #25
Posted 10 June 2013 - 12:43 PM
I had no trouble saving state to a file each time that state changes :)/>

I would highly doubt that statement about it being kinder to the server.
Of course, CC has the potential of being more of a strain on the server, simply because RPC is resource-limited and CC is (almost) not.

But if you compare efficiency, you have an emulated CPU on one side and LuaJ, which compiles to java bytecode, which the Hotspot JVM JITs to native code if it's run a lot.
I hope it's clear to you, which one is more efficient :)/>

EDIT: using the CC peripheral interface to attach peripherals to non-CC stuff would probably violate the license
immibis #26
Posted 11 June 2013 - 09:24 AM
I think CC interpets Lua… also, why care about CC's license but not RP's?
TomyLobo #27
Posted 11 June 2013 - 09:31 AM
ComputerCraft uses LuaJ, which is a "Lightweight, fast, Java-centric Lua interpreter written for JME and JSE, with string, table, package, math, io, os, debug, coroutine &amp; luajava libraries, JSR-223 bindings, all metatags, weak tables and unique direct lua-to-java-bytecode compiling." (http://sourceforge.net/projects/luaj/)
Why I care about the CC license? for one, because I'm posting this on computercraft forums :)/>
The CC devs have also never been unreasonable, unavailable or just outright assholes, while eloraam has been all of that.
Xfel #28
Posted 12 June 2013 - 04:52 AM
Though it is true that LuaJ is CAPABLE of direct lua-to-java-bytecode compilation, it is not used in CC as far as I know.
TomyLobo #29
Posted 12 June 2013 - 06:39 AM
You can see that it is used if you take a look at the ComputerCraft zip file in any zip-capable tool
immibis #30
Posted 13 June 2013 - 01:00 AM
You can see that it is used if you take a look at the ComputerCraft zip file in any zip-capable tool
How can you see that?
TomyLobo #31
Posted 13 June 2013 - 03:38 AM
By assuming that they wouldn't bundle it if they didn't use it :)/>
Galactica4 #32
Posted 18 July 2013 - 03:35 AM
Can someone explain why eloraam would be annoyed to find this?

SIDE NOTE: BRING REDPOWER TO 1.6.2 ALREADY GOD DAMMIT
TomyLobo #33
Posted 18 July 2013 - 08:20 AM
I dunno, ask the people on #redpower on espernet

Be warned though, they might ban you :D/>
ElvishJerricco #34
Posted 18 July 2013 - 09:26 AM
By assuming that they wouldn't bundle it if they didn't use it :)/>

Just because the files are there doesn't mean they're being used. Lots of forge hooks aren't used by CC, so why have them included when CC is the only mod installed? Point being that Dan isn't gonna take the time to remove the files from package, especially not since you typically aren't supposed to mess with the file structure of someone else's API.


Can someone explain why eloraam would be annoyed to find this?

SIDE NOTE: BRING REDPOWER TO 1.6.2 ALREADY GOD DAMMIT

Eloraam is a very private modder. She does not like people lurking through her code, especially since she's not obligated to keep it the same for future versions. She's had a power conversion mod taken down entirely because it included Bluetricity.
immibis #35
Posted 18 July 2013 - 08:59 PM
Galactica4: Eloraam forbids reverse engineering of RP2, like most closed-source licenses.
TomyLobo #36
Posted 18 July 2013 - 10:35 PM
Eloraam can't enforce that reverse engineering for the purpose of interoperability against any EU citizen (which includes me)

So if she takes down my mod, she'll have to do other things to convince people to do so.
I have a few in mind, but I'm not gonna detail them here for several reasons.
Cloudy #37
Posted 19 July 2013 - 12:43 AM
PORT TO 1.6.2 PLEASE!!111one
immibis #38
Posted 19 July 2013 - 01:34 AM
Btw, after my converter mod, Eloraam threatened to stop modding if anyome did that again.
TomyLobo #39
Posted 19 July 2013 - 01:59 AM
that would be one of the items on my list of ways in which she could convince people to do her bidding
Britaliope #40
Posted 19 December 2013 - 02:55 PM
For people who waht download this awesome and seen download links are broken, i've sucessful recompile it using github (after 12 hours of hard work :blink:/> ). Waiting an update of download links, i've upload it on mediafire. Link : CCredbus-0.0.6.jar .