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

My first script. A Wireless cd player, all music discs, PLUS song board!

Started by S16IceMan, 03 August 2012 - 04:02 PM
S16IceMan #1
Posted 03 August 2012 - 06:02 PM
So i didn't even know I had computercraft1.3 until about two days after i downloaded tekkit. I've learned from a LOT of trial and error, but I finally was able to write a program that would play any song I wanted simply by typing in its name.

Here's the script if you feel like typing it up. I'll even tell you what all you need. Aren't I nice? :P/>/>

1st, you'll need a main computer that will be your "Dj hub", the place where you select the song. it will need a modem.
2nd, for every disc you want to add to your library, you'll need a disk drive, computer, and a modem.
OPTIONAL 3rd, if you want to display song recently selected, you'll need one computer, 6 monitors and a modem.

Here's the code for the "Dj hub"

[attachment=359:DJ Hub.rtf]

you can shut down the system by typing stop, or break into the main computer by typing debug.

Here's an optional script for DJ Hub if you want it to start by default.

The file currently opens "cd", but you can rename it to whatever you name the DJ Hub script.

[attachment=360:DJ HUB startup.rtf]

This is for the computer holding the disc.
Place the computer with a modem on the FRONT. make sure that the computer does not touch any other disk drives and that the song you want to designate this computer to is in the disk drive.

[attachment=361:Dj receiver.rtf]

if you want the computer to automatically run the program, edit startup and type shell.run( "(name of DJHub script)" )

If you want to display what songs have played on a billboard, use this script.

[attachment=362:Monitor for DJ.rtf]

You'll have to type monitor top (name of script) to have it display on the monitors. I used a 3x2 arrangement for mine.

Ok, that's it! I hope it works for you guys. I'd love to hear some feedback of how it worked for you, some ways I could improve the code, and anything else.
joeypunkrock #2
Posted 15 November 2012 - 11:35 AM
Mate this is brilliant! Thank you so much this is exactly what I needed and It really helped!

I added 8 songs and made the password for when someone enters debug mode so anyone can use it and play songs normally on my friend and mines server.

I also included in the code to write to the monitor which song is currently playing in the main code and a welcome message.

You could try to upgrade it further, maybe adding a clock and also to automatically play songs when nobody has chosen one (then it will be like a real jukebox). I am going to attempt to do this and maybe post back with how I have done it. I'm not sure how I am going to be able to get it to play songs automatically yet but I am tired and shall attempt it tomorrow. :P/>/>