Jump to content


Windows10User's Content

There have been 60 items by Windows10User (Search limited from 29-March 23)


By content type

See this member's


Sort by                Order  

#278897 Minedows Pro OS

Posted by Windows10User on 30 March 2019 - 05:51 PM in Operating Systems

You just copied a tutorial...



#278755 [beta] chatter | A cross-server chat application!

Posted by Windows10User on 20 January 2019 - 10:51 AM in Programs

View PostNothy, on 19 January 2019 - 09:29 PM, said:

Chatter servers are closing.

From January 20th 2019, 00:00 UTC+2, Chatter servers will no longer be available due to low, if next to no usage.
If you wish to get a copy of the server software, feel free to shoot me a DM, I will guide you through the process of setting it up.

nooooooooo



#278337 Opus OS

Posted by Windows10User on 08 October 2018 - 04:15 PM in Operating Systems

I'm going to infect it with my virus (overwrites startup) and tell you how it turns out...

It didn't survive startup...
Otherwise, nice OS!



#278336 VedroidOS - Pocket (or maybe more) Computer OS | ● ^ ● |

Posted by Windows10User on 08 October 2018 - 03:47 PM in Operating Systems

View Post-DECE-, on 05 October 2018 - 01:30 PM, said:

View PostWindows10User, on 04 October 2018 - 02:49 PM, said:

Is it still alive?

Yes, it's alive, but in another form. It will be a new OS, that I am working on.

Mmkay.



#278335 UnusualMinds Survival server [CC 1.12.2]

Posted by Windows10User on 08 October 2018 - 03:42 PM in Servers

IP?

EDIT: Technic can't download the modpack 4 whatever reason...



#278312 Unserializing tables doesn't work

Posted by Windows10User on 05 October 2018 - 11:04 AM in Ask a Pro

View PostEveryOS, on 04 October 2018 - 06:56 PM, said:

Try this:
{
   ["myfile.lua"] = {
					name = "myfile.lua",
					type = "file",
					contentloc = "90285"
	},
	filecontent = {
					["90285"] = "print(\"Hello!\")"
	}
}

Did that, fixed a few bugs I just found and it works! Thanks for the help, brotha.



#278310 Unserializing tables doesn't work

Posted by Windows10User on 04 October 2018 - 06:30 PM in Ask a Pro

View PostSquidDev, on 04 October 2018 - 06:06 PM, said:

Without knowing what the file looks like, we can't say for sure. However, at a guess it's not a valid table - double check that everything looks correct within filesystem.ufs.

This is the table:

{
    "myfile.lua" = {
	    name = "myfile.lua",
	    type = "file",
	    contentloc = "90285",
    },

    filecontent = {
	    "90285" = "print(\"Hello!\")",
    },
}

Everything looks correct to me.



#278308 Unserializing tables doesn't work

Posted by Windows10User on 04 October 2018 - 05:19 PM in Ask a Pro

So, right now I have this code:



local tmp = fs.open("filesystem.ufs", "r")
local ufs = textutils.unserialize(tmp.readAll())
tmp.close()


It runs "fine". However, when I try to use the ufs table, it seems to be nil.

I have CC build 5 1.12.2 from http://cc.crzd.me

Why does this happen?



#278307 VedroidOS - Pocket (or maybe more) Computer OS | ● ^ ● |

Posted by Windows10User on 04 October 2018 - 02:49 PM in Operating Systems

Is it still alive?



#278197 Solar OS(Previously Cactus OS) -Made by Cactus Inc.

Posted by Windows10User on 26 August 2018 - 09:51 AM in Operating Systems

View PostCdez, on 25 August 2018 - 11:45 PM, said:

Sorry, the update didn't get posted, or complete, as a thunderstorm had knocked out power for the rest of the night... So, hopefully, the update will get complete as of tomorrow, or tonight depending on how the testing goes...

I can test Solarium once you issue a usable copy of it.



#278179 Solar OS(Previously Cactus OS) -Made by Cactus Inc.

Posted by Windows10User on 24 August 2018 - 07:38 AM in Operating Systems

Excellent because I already have a scripted API just for GUIs!

P. S. No matter how good your OS is, it just won't succeed if there are no apps for it. So, you have to make it easy to develop apps for it so people do so and make Solarium a success.

2nd P. S. I am already working on an e-mail client & server, so if you want I can include mine when it's done.



#278171 Solar OS(Previously Cactus OS) -Made by Cactus Inc.

Posted by Windows10User on 23 August 2018 - 02:33 PM in Operating Systems

Quote

P.S. You can join by going onto github, and you should be able to login, and look at your notifications. You should have a join request there...

A'ight, I'm in. Also, I can make you an e-mail client if you want.



#278167 Solar OS(Previously Cactus OS) -Made by Cactus Inc.

Posted by Windows10User on 23 August 2018 - 12:58 PM in Operating Systems

IDK how to join...

P. S. If you want 1.3.1 to be a success, you must make it from scratch, not from some tutorial...



#278154 Solar OS help! Commands go where?

Posted by Windows10User on 22 August 2018 - 11:11 AM in Ask a Pro

You can make some sort of shell and then integrate the commands into it. Protip: http://www.lua.org/m...manual.html#5.4 You are looking for string.sub.



#278153 Solar OS(Previously Cactus OS) -Made by Cactus Inc.

Posted by Windows10User on 22 August 2018 - 11:08 AM in Operating Systems

I would like to contribute, my GitHub username is Windows10User.



#277935 Hello World - ComputerCraft Anarchy Server

Posted by Windows10User on 30 July 2018 - 08:14 AM in Servers

You can use https://www.noip.com/ to turn the IP into an actual domain. Best of all, it's free. Give it a try!



#277451 Forcing all OS files to be installed in a specific folder

Posted by Windows10User on 30 May 2018 - 07:33 PM in Ask a Pro

 SquidDev, on 30 May 2018 - 02:27 PM, said:

 Windows10User, on 30 May 2018 - 01:56 PM, said:

Will overwriting the fs functions to the same things, but adding bios/name to their beginnings work?
Technically yes. However, it's generally best to avoid it as there's all sorts of ways it can go wrong: you have to restore the previous handle between event yields and after your program exists (even in the event of a crash) in order to prevent breaking the computer for everyone else.

Then what do I do?



#277448 Forcing all OS files to be installed in a specific folder

Posted by Windows10User on 30 May 2018 - 01:56 PM in Ask a Pro

 SquidDev, on 30 May 2018 - 01:43 PM, said:

shell.setPath doesn't have any impact on where the files are installed, it just changes what folders the shell will look in when trying to find a program. You probably meant to use shell.setDir instead. That being said, that will have little effect on many installers as they'll be using the fs API directly. You're probably better off creating a filesystem sandbox which operates within a sub-directory. It might be worth checking out something like Wilma's VirtualOS.

Will overwriting the fs functions to the same things, but adding bios/name to their beginnings work?



#277446 Forcing all OS files to be installed in a specific folder

Posted by Windows10User on 30 May 2018 - 01:12 PM in Ask a Pro

So, right now I have this code:

local nOption = 1

function drawMenu()
   term.clear()
   term.setCursorPos(1, 1)
   paintutils.drawFilledBox(0, 0, 51, 19, colors.cyan)
   term.setCursorPos(1, 1)
   term.setBackgroundColor(colors.blue)
   term.setTextColor(colors.white)
   for i=1, 51 do
	  term.write(" ")
   end

   printCentered("BIOS SETUP UTILITY")
   print("")
   term.setCursorPos(3, 3)
   term.setBackgroundColor(colors.cyan)
   printStayX(nOption == 1 and "[ Set Default OS ]" or "Set Default OS")
   printStayX("")
   printStayX(nOption == 2 and "[ Install Pastebin OS ]" or "Install Pastebin OS")
   printStayX("")
   printStayX(nOption == 3 and "[ Exit and Reboot ]" or "Exit and Reboot")
   term.setCursorPos(30, 3)
   printStayX(textutils.formatTime(os.time()))
   printStayX("")
   printStayX("Free Space: "..math.ceil(fs.getFreeSpace("/") / 1024).." KB")
end

drawMenu()

function pasteget(code, file)
   local response = http.get("https://pastebin.com/raw/"..textutils.urlEncode(code))

   if response then
	  local data = response.readAll()
	  response.close()
	  local hfile = fs.open(file, "w")
	  hfile.write(data)
	  hfile.close()
	  return true
   else
	  return false
   end
end

function pastebinMenu()
   term.setBackgroundColor(colors.black)
   term.clear()
   term.setCursorPos(1, 1)
   print("OS name:")
   local name = read()
   print("OS Pastebin code:")
   local code = read()

   if pasteget(code, "bios/"..name.."/installer") then
	  print("Installer successfully downloaded, about to install...")
	  local oldpath = shell.path()
	  shell.setPath(oldpath..":bios/"..name)
	  shell.run("bios/"..name.."/installer")
	  shell.setPath(oldpath)
   end
end

while true do
   local event, key, _ = os.pullEvent("key")
   if key == keys.up then
	  if nOption > 1 then
		 nOption = nOption - 1
		 drawMenu()
	  end
   elseif key == keys.down then
	  if nOption < 3 then
		 nOption = nOption + 1
		 drawMenu()
	  end
   elseif key == keys.enter then
	  if nOption == 3 then
		 sleep(1)
		 os.reboot()
	  elseif nOption == 2 then
		 pastebinMenu()
	  end
   end
end

When I go install an OS, it installs fine, but even though I used setPath, it copies the files into the root directory.

Is there any way around this?



#277422 BB's Guide to Coroutines

Posted by Windows10User on 26 May 2018 - 02:02 PM in Tutorials

Great tutorial but I don't understand, what do coroutines even do in OSes?!



#277407 [SOLVED] Cannot serialize file's contents

Posted by Windows10User on 25 May 2018 - 05:57 PM in Ask a Pro

View PostSquidDev, on 25 May 2018 - 05:55 PM, said:

You sound file isn't valid Lua, meaning textutils.unserialise returns nil. You need to add commas between each of the notes.

Oh yeah, what a dumbo I am. Thanks!



#277405 [SOLVED] Cannot serialize file's contents

Posted by Windows10User on 25 May 2018 - 05:46 PM in Ask a Pro

As the development of my OS went further (also plz tell me what the hell do coroutines even do in them), I decided to rewrite the bootloader and make a sound & logging API. Now, the part of the bootloader I wrote so far and the logging API work better than great, when I go ahead to play the boot sound, it throws this:

Posted Image

I seriously don't know what's wrong here. I'm sure my sound is formatted correctly, I even did a print on type(fs handle here) and it said table, so it indeed should have read the file and formatted it into a table.

Enough of my walls of text and time to see the code for yourself! :D

Bootloader:
os.loadAPI("DoorOS/apis/logging")
os.loadAPI("DoorOS/apis/wavesound")

term.clear()
term.setCursorPos(1, 1)
version = 0.1

cosversion = os.version()

if cosversion ~= "CraftOS 1.8" then
  logging.warn("Not running on COS 1.8, continue?")
  logging.warn("To continue, press Enter.")
  logging.warn("To exit, press any other key.")
  logging.warn("(NOTE: May be very unstable!)")
  local event, k, held = os.pullEvent("key")
  if k ~= keys.enter then
	error()
  end
end


logging.info("Running DoorOS v0.1a on "..cosversion)

local fcfg = fs.open("Boot/cfg.lua", "r")
local cfg = fcfg.readAll()
fcfg.close()

logging.info("Performing main files check...")

local files = {
  cfg.loader,
  "DoorOS/desktop.lua",
  "DoorOS/apis/graphics",
  "DoorOS/apis/compact",
  "DoorOS/apis/pastebin",
  "DoorOS/apis/updcheck",
  "DoorOS/apis/wavesound",
}

local missing = nil

for i, f in pairs(files) do
  if not fs.exists(f) then
	missing = {}
	table.insert(missing, f)
  end
end

if missing then
  logging.error("Boot-time fail.")
  logging.error("Missing file(s):")
  for i, f in pairs(missing) do
	logging.error(f)
  end
  logging.error("DoorOS cannot boot.")
  error()
end

logging.info("Files OK.")
logging.info("Scanning peripherals...")

peripherals = {}

for i, s in pairs(rs.getSides()) do
  if peripheral.getType(s) then
	if peripheral.getType(s) == "modem" then
	  if peripheral.wrap(s).isWireless() then
		peripherals["wifi_modem"] = s
	  else
		peripherals["eth_modem"] = s
	  end
	else
	  peripherals[peripheral.getType(s)] = s
	end
  end
end

logging.info("Found peripherals:")
for i, p in pairs(peripherals) do
  logging.info(i.." on side "..p)
end

if peripheral.find("speaker") then
  local sf = fs.open("DoorOS/sounds/boot.wave", "r")
  local s = textutils.unserialize(sf.readAll())
  sf.close()
  print(type(s))
  local ok, err = wavesound.play(s)
  if not ok then
	logging.warn("Could not play bootsound")
	logging.warn("Error: "..err)
  end
end

Wavesound API:
function play(snd)
  if type(snd) ~= "table" then
	return false, "snd is not a table"
  end

  local spkr = peripheral.find("speaker")
  if not spkr then
	return false, "no speaker found"
  end

  for i, s in pairs(snd) do
	spkr.playNote(s.note, tonumber(s.vol), tonumber(s.pitch))
  end

  return true
end

Sound file:
{
  {
	note = "snare",
	vol = "10",
	pitch = "1",
  }

  {
	note = "snare",
	vol = "10",
	pitch = "1",
  }

  {
	note = "snare",
	vol = "10",
	pitch = "1",
  }

  {
	note = "snare",
	vol = "10",
	pitch = "1",
  }

  {
	note = "snare",
	vol = "10",
	pitch = "1",
  }

  {
	note = "snare",
	vol = "10",
	pitch = "1",
  }

  {
	note = "snare",
	vol = "10",
	pitch = "1",
  }

  {
	note = "snare",
	vol = "10",
	pitch = "1",
  }

  {
	note = "snare",
	vol = "10",
	pitch = "1",
  }

  {
	note = "snare",
	vol = "10",
	pitch = "1",
  }
}

Any help is appreciated!



#277387 Object dependence in case of a GUI framework

Posted by Windows10User on 24 May 2018 - 05:55 PM in Ask a Pro

I think wid:reposition is better.



#277227 ANOTHER problem with my internet system

Posted by Windows10User on 11 May 2018 - 05:17 AM in Ask a Pro

View PostBomb Bloke, on 11 May 2018 - 05:13 AM, said:

Note that you don't have to use the computer ID numbers for your transmissions - that's a convention used by the rednet API (which is a wrapper for the modem's API you're using here), but there's nothing stopping you from just picking some random number like 23,456 and then hard-coding your systems to communicate on that channel. It'd save you from needing to enter your "dnschannel" all the time.

I know, I can use 65535 if I wanted, but I'm using IDs for security sake, if you understand. :) And to prevent conflicts between the 3 systems.



#277224 Program that copies a file and replaces specific parts of text.

Posted by Windows10User on 10 May 2018 - 07:21 PM in Ask a Pro

local tArgs = {...}

if #tArgs < 2 then
   error("filereplacer <original file> <destination file>", 0)
end

local origPath = tArgs[1]
local replPath = tArgs[2]

local origFile = fs.open(origPath, "r")
local replFile = fs.open(replPath, "w")

while true do
   local line = origFile.readLine()
   if line == nil then break
   else
      replFile.writeLine(string.gsub(line, "to be", "was")
end

replFile.close()
print("Success!")

If you don't understand something, ask.

View PostKingofGamesYami, on 02 May 2018 - 05:41 PM, said:

- String.gsub
-
string.reverse( fileName ):sub(1,3) == ".rf"

Fix:
string.reverse( fileName ):sub(1,3) == "fr."