Recent posts

Pages 1 2 3 4 5 ... 10
21
Ask a Pro / Need help with NBS format bina...
Last post by pjals_but_noisy - Oct 22, 2021, 02:30 pm
im making a nbs implementation for CC/Pure Lua and its erroring, why is this happening?
here is the library i used (bitbuffer), https://github.com/Dekkonot/bitbuffer

the output goes like:
Code Select
> it4.nbs (test nbs)
< 5
< aaaa
< 256
< 0 256
<! opennbs.lua:72: attempt to index field '?' (a nil value)

and here is the code:
Code Select
local bitbuffer = require("bitbuffer")
local pretty = require("cc.pretty")

local function readStr(buffer)
local size = buffer.readInt32()
return buffer.readSetLengthString(size)
end

local function parseNbs(path)
local handle = fs.open(path, "rb")
handle.read(2)
local buffer = bitbuffer(handle.readAll())
handle.close()
local info, layers = {}, {}
info.version = buffer.readByte()
info.layers = {}
info.author = {}
info.clicks = {}
info.noteblocks = {}
print(info.version)
if info.version == 5 then
-- Header / Metadata
info.vic = buffer.readByte()
info.length = buffer.readInt16()
info.layers = buffer.readInt16()
info.name = readStr(buffer)
info.author.nbs = readStr(buffer)
info.author.original = readStr(buffer)
info.desc = readStr(buffer)
info.tempo = buffer.readInt16() / 100 -- ticks*100 -> ticks
info.autoSave = buffer.readByte()
info.asInterval = buffer.readByte()
info.ts = buffer.readByte()
info.timeSpent = buffer.readInt32() * 60 -- minutes -> seconds
info.clicks.left = buffer.readInt32()
info.clicks.right = buffer.readInt32()
info.noteblocks.added = buffer.readInt32()
info.noteblocks.removed = buffer.readInt32()
info.realname = readStr(buffer)
info.loop = buffer.readByte()
info.loopCount = buffer.readByte()
info.loopStart = buffer.readInt16()
-- Notes
local tick = 0
while true do
local jumps = buffer.readInt16()
if jumps == 0 then
print("a")
break
end
tick = tick + jumps
local layer = 0
layers[layer] = {}
layers[layer].notes = {}
print("aaaa")
while true do
local lJumps = buffer.readInt16()
if lJumps == 0 then
print(lJumps)
break
end
print(lJumps)
print(layer, layer + lJumps)
layer = layer + lJumps

local instrument = buffer.readByte()
local key = buffer.readByte()
local velocity = buffer.readByte()
local panning = buffer.readByte()
local pitch = buffer.readInt16()

layers[layer].notes[tick] = {}
layers[layer].notes[tick].instrument = instrument
layers[layer].notes[tick].key = key
layers[layer].notes[tick].velocity = velocity
layers[layer].notes[tick].panning = panning
layers[layer].notes[tick].pitch = pitch
print(layer, "a")
end
end
--Layers
for i = 1, info.layers do
pretty.print(pretty.pretty(layers))
print(i)
layers[i].name = readStr(buffer)
layers[i].lock = buffer.readByte()
layers[i].volume = buffer.readByte()
layers[i].pan = buffer.readByte()
end

return { ["info"] = info, ["layers"] = layers }
else
error("NBS file is outdated. Required version: 5. (got " .. info.version .. ")")
end
end

pretty.print(pretty.pretty(parseNbs(read())))
22
Ask a Pro / How to use radar to detect oth...
Last post by Lupus590 - Oct 20, 2021, 05:32 am
I would assume that it has a block form as well as a turtle upgrade form, but I'm not familiar with the mod so I can't say for sure.
23
Ask a Pro / How to use radar to detect oth...
Last post by MegaMind - Oct 20, 2021, 05:10 am
Quote from: Lupus590 on Oct 19, 2021, 11:44 pmWhat mod is the radar from? CC doesn't have any native ability to detect entities so some peripheral mod must be providing it, there are a few which do so knowing which specific one you are using will be helpful.
the radar is from "computronics" I saw it combined with a turtle so I assumed it was from the same mod, now I know that they work together but I still don't know what to do to make it talk with the computer.
24
Ask a Pro / How to use radar to detect oth...
Last post by Lupus590 - Oct 19, 2021, 11:44 pm
What mod is the radar from? CC doesn't have any native ability to detect entities so some peripheral mod must be providing it, there are a few which do so knowing which specific one you are using will be helpful.
25
Ask a Pro / How to use radar to detect oth...
Last post by MegaMind - Oct 19, 2021, 09:10 pm
I'm very new to this and I wanted to use a radar to detect other players and give me their distance from the radar. But I don't even know how to get the computer to interact with the radar. I tried looking for videos that could show how to do it but couldn't find any. I was told I should ask for help here, so can someone tell how do something like this or show me video that can do the same?
26
Operating Systems / Pepdroll 7 Operating system
Last post by PepdrollCZE - Oct 18, 2021, 01:52 pm
Pepdroll 7 Operating system
Standard / Server

Hi, I would like to introduce my project

  • Standard / server edition,
  • Simple control,
  • Easy file browser,
  • Sounds from "Windows XP" (must connect speaker)
  • Network file sharing, (using P7 server),
  • Basic active directory service,
  • User-friendly environment with a customizable look,
  • Sorted settings with many options,
  • Automatical update service,
  • Integrated classic cmd terminal,
  • and much more...

Unified installation: "pastebin run HZYKupA5"

User manual: HERE

Enjoy ;)

I apologize for any errors in the system. The system is still evolving and it is difficult to find and tune all the bugs when software development takes a long time with long breaks. :)
27
General / CC: Restitched (Fabric) 1.17.1...
Last post by MerithTK - Oct 10, 2021, 01:39 am
https://modrinth.com/mod/cc-restitched

I am in need of people to test the mod out and find bugs.

Known Bugs So Far,
1) Iris causes Z-Fighting with non-existant texture
1.1) Shaders with Iris causes crash
28
Programs / NBS Player/Jukebox "EasyPlay"
Last post by Barnet - Oct 09, 2021, 11:34 pm
Greetings fellow nerds.

I present to you an actually easy to use noteblock studio player for CC Computers using only modems, monitors and speakers. I was looking for this for quite a while, but couldn't find anything up to date. Most NBS-Player I found were only usable with the old format. So if anyone can direct me to something well made that'd be great. Anyways... together with the nbs decoder from MysticT and some tweaking efforts of Soni from some years ago, I took on the task of making their program work again with the newer NBS versions and also make it easier to use for Pepegas like me.

Pastebin: 5vaJeT44

How to use:
  • Run the installer (5vaJeT44) -> installer
  • When you want to use a custom speaker setup (instead of the default configuration shown in the video) you need to run the "setup" command and follow the instructions. -> easyPlay setup
  • You can now put NBS files with your trusty windows explorer into the folder of your CC Computer or use the "download" command to get songs form the internet. (https://opennbs.org/songs/ for example) -> easyPlay download <url> <filename>
  • Start a song by using the "start" command. -> easyPlay start <fileName>
  • Profit

Notes:
  • The megalovania.nbs file always gets downloaded with the installation programm so you can always run that off the bat without any hassle.
  • When using a custom setup, make sure to run the "setup" command first. -> easyPlay setup <monitor> <slaves> ...
    Put the side where the monitor (or a modem connected to a monitor) at <monitor> and the side where the modems are that are connected to the speakers at <slaves> (separated by space, just like multiple arguments)
  • If you are confused by the setup command, just run it with any arguments and you'll get a step by step guide on how to get it done.
  • No songs that use custom instruments work with this program.
  • Keep in mind that this is a fairly scuffed program, since its original purpose was to play the old (version 0) NBS files on iron noteblocks from the CC Addon mod with the same name. I just smeared with my crayons a little bit through the code until it worked. So feel free to improve it and post your own version. :)

Update:
I recently updated the program and added some new features.
  • The installer is a little bit smarter now. It overrides all files that already exist instead of throwing errors. So you only need to pastebin the new installer and run that. No need to manually delete the files of older versions of this program.
  • You can now play a whole album by giving the "start" command a folder instead of just a file.
    ex.: easyPlay start songs (when "songs" is a directory that contains nbs files)
    This works recursively. So your "songs" folder can also contain more folders with more songs.
  • In addition to the album play, I also added the possibility to loop and shuffle these albums. Just provide the letters "s" for shuffle or "l" for loop as a 3rd argument when calling "easyPlay start".
    ex.: easyPlay start songs ls <- This would loop and shuffle the provided album
  • There are also some new controls. You can now skip a song by pressing the "D" key and end the program by pressing the "E" key.
29
General / Looking for Visual Studio Comp...
Last post by QuickMuffin8782 - Sep 30, 2021, 11:10 pm
Quote from: TheTinyDeskEngineer on Sep 29, 2021, 03:12 pmIn all of the time that I've played with Computercraft I've spent quite a bit of that time getting confusing problems which are hard to solve. I thought that it might be better if I use Visual Studio to create and edit Computercraft lua code. But I can't find anything useful on Google, as always. I'm using Visual Studio Community 2019.
You can also use ZeroBrane Studio. It also works with CC and is a good editor to use as it useful for compatibility with syntax highlighting for CC (w/o adding a addon for it ;)) and lua, and is useful for seeing your code in the left sidebar in a easy-to-understand UI.

Link: https://studio.zerobrane.com/download?not-this-time
30
General / Looking for Visual Studio Comp...
Last post by Lupus590 - Sep 29, 2021, 09:44 pm
Copied from the bot on the discord.
QuoteVisual Studio Code is the preferred code editor for writing ComputerCraft code. A number of extensions are available that improve CC programming:

- Lua by sumneko adds Lua autocomplete, highlighting, and error checking.
- ComputerCraft by JackMacWindows adds autocomplete for CC functions.

These have been packaged into one extension pack by Lemmmy.

In addition, the CraftOS-PC for VS Code extension by JackMacWindows adds integration with CraftOS-PC, as well as a remote terminal and file viewer for standard CC.

By default, the Lua extension will highlight ComputerCraft functions with warnings since it doesn't know they exist. This can be fixed by adding them to the settings:

1. Press Ctrl+Shift+P (Command+Shift+P on Mac), type in "Preferences: Open Settings (JSON)", and press Enter.
2. Add the text from this file to the top of the file, after the first {.
3. Close the file, and the warnings should go away.
Pages 1 2 3 4 5 ... 10