Jump to content


oxygencraft's Content

There have been 37 items by oxygencraft (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#240552 NodeQuarry - A Cheap, Scalable, Web-Based Turtle Quarry

Posted by oxygencraft on 15 December 2015 - 10:04 AM in Turtle Programs

View Postapemanzilla, on 13 December 2015 - 03:48 AM, said:

View Postoxygencraft, on 13 December 2015 - 03:01 AM, said:

It is not working. The placeholder text is not turning into a web control panel.

By "will be replaced with a web control panel" I meant when I actually get around to implementing it :P

The turtle can't reach the my computer. I hosted it correctly, portforward it and I checked if the server is running and it is running.



#240353 NodeQuarry - A Cheap, Scalable, Web-Based Turtle Quarry

Posted by oxygencraft on 13 December 2015 - 03:01 AM in Turtle Programs

It is not working. The placeholder text is not turning into a web control panel.



#240029 How do i let more then 1 code block run at the same time?

Posted by oxygencraft on 10 December 2015 - 05:02 AM in Ask a Pro

What I am trying to do is make a server computer have some shutdown, reboot, change password etc AND process client requests at the same time. I don't want to have a computer just process the requests and the server option are on the client. If the server options are on the client then it could of been a security risk.



#239735 Fusion OS

Posted by oxygencraft on 06 December 2015 - 12:20 AM in Operating Systems

 DannySMc, on 05 December 2015 - 01:56 PM, said:

 oxygencraft, on 05 December 2015 - 10:18 AM, said:

I made a temp DiscoverAPI account so I can still access the things that use DiscoverAPI the temp account's name is oxygencraft2 oxygencraft was my main account's name. And I also have an error I cant report it on the OS because it crashes... The error is some thing don't work if I try to use something that does not work then it returns a value of nil, then it crashes.

Hmmm, I shall have a look in a bit, when I am home, will see if I can fix it, try and take a screenshot of the error?

Crash Screenshots are here



#239733 Discover App (Ver. 7.4) - Apps, Snippets, Cloud Storage, Chat Board, Mail, Pr...

Posted by oxygencraft on 05 December 2015 - 08:40 PM in Programs

How do I use the Discover Cloud?



#239712 Fusion OS

Posted by oxygencraft on 05 December 2015 - 10:18 AM in Operating Systems

I made a temp DiscoverAPI account so I can still access the things that use DiscoverAPI the temp account's name is oxygencraft2 oxygencraft was my main account's name. And I also have an error I cant report it on the OS because it crashes... The error is some thing don't work if I try to use something that does not work then it returns a value of nil, then it crashes.



#239708 Discover App (Ver. 7.4) - Apps, Snippets, Cloud Storage, Chat Board, Mail, Pr...

Posted by oxygencraft on 05 December 2015 - 09:03 AM in Programs

Could you delete my account off the DiscoverAPI database please, Danny.



#239686 How do i make a color UI?

Posted by oxygencraft on 04 December 2015 - 08:31 PM in Ask a Pro

I am not that confused now. All I am confused about is the x and y. Should I just play around with the y and x? And also can I paint the button colors in paint?



#239576 Touchpoint API

Posted by oxygencraft on 03 December 2015 - 04:47 AM in APIs and Utilities

Nice but i am not using this on monitors. I want to use it on computers OR you can tell me how to make buttons on a computer. I already started a topic about this the link is here.



#239575 How do i make a color UI?

Posted by oxygencraft on 03 December 2015 - 04:39 AM in Ask a Pro

View PostCloudNinja, on 02 December 2015 - 11:37 AM, said:


Snip

local event, button, x, y = os.pullEvent("mouse_click") -- pull clicks
if x >= 5 and x <= 6 and y >= 2 and y <=3 then --This checks if x is within a box of x5 to x6, and if y is no higher than 3, but no lower than 2.
print("You Clicked The Button!")
end
That's some example code.

I am still confused with the code. I need an easier way to do it.



#239506 How do i make a color UI?

Posted by oxygencraft on 02 December 2015 - 07:05 AM in Ask a Pro

View PostKingofGamesYami, on 01 December 2015 - 02:49 PM, said:

There's not any magic behind making a button, all you do is put some color & text on a certain area, then check if a mouse_click event occurs in that area.


Here's an example utilizing nothing but basic commands. Obviously this isn't the shortest, nor the easiest way of doing it. However, this is essentially what all buttons are.

Most people use button APIs either written by themselvees or by others to handle the drawing and events. I have a few APIs I use for them, usually specifying a maximum and minimum for x and y, a background color, a text color, and some text. Sometimes the color values are hard-coded, and sometimes the max values are scaled according to the length of the text. I even created a Automatically scaling Button GUI, which takes a series of strings and a couple colors to create a menu. Obviously, this is extremely limiting to anyone who might use it, but it is extremely useful if you don't want to mess with placement of buttons and such.

term.setBackgroundColor( colors.orange )
term.setCursorPos( 1, 1 )
term.write( string.rep( " ", 8 ) )
term.setCursorPos( 1, 2 )
term.write( string.rep( " ", 8 ) )
term.setCursorPos( 1, 3 )
term.write( string.rep( " ", 8 ) )
term.setTextColor( colors.blue )
term.setCursorPos( 3, 2 )
term.write( "Button" )
while true do
  local event = {os.pullEvent()}
  if event[ 1 ] == "mouse_click" and event[ 3 ] >= 1 and event[ 3 ] <= 8 and event[ 4 ] >= 1 and event[ 4 ] <= 3 then
	break
	print( "Button was clicked!" )
  end
end

I am still confused making buttons. But how do I use the API? Should I learn the function os.pullEvent()?



#239446 How do i make a color UI?

Posted by oxygencraft on 01 December 2015 - 09:04 AM in Ask a Pro

View Postvalithor, on 30 November 2015 - 10:56 PM, said:

I am actually going to recommend the paintutils api as it is easier to use when you are first starting. Which can be found here

Little example for drawing:
paintutils.drawBox(1,1,10,5,colors.blue) --# draws a blue box from the coordinates x = 1 to x = 10, and y = 1 to y = 5

To set up a button you will essentially just be telling the computer to listen for click events, and then checking to see if the coordinates returned by the event is within the area the button is drawn to.
example for a button (Example is set up to listen for the "button" we drew in the drawing example:
while true do --# repeating forever
  local event, button, x, y = os.pullEvent("mouse_click") --# telling the computer to listen for mouse click events, button will equal which mouse button is pressed, x is the x coord, and y is the y coord
  if x>=1 and x<=10 and y>=1 and y<=5 then
	--# our button was pressed, so do stuff
	paintutils.drawBox(1,1,10,5,2^math.random(0,15)) --# this is just for you to be able to visually see the button do something when pressed, this will randomly change the color of the button when it is pressed
  end
end

Hope this helps :P

I am still confused how to make buttons.

View PostLupus590, on 01 December 2015 - 08:19 AM, said:

You can make a file in CC paint and then have your program load and draw it to the screen using painutils (if this is what you are asking)

But can I print text without messing up the colors?



#239437 How do i make a color UI?

Posted by oxygencraft on 01 December 2015 - 05:46 AM in Ask a Pro

View Postvalithor, on 30 November 2015 - 10:56 PM, said:

I am actually going to recommend the paintutils api as it is easier to use when you are first starting. Which can be found here

Little example for drawing:
paintutils.drawBox(1,1,10,5,colors.blue) --# draws a blue box from the coordinates x = 1 to x = 10, and y = 1 to y = 5

Could you give me a better example for drawing colors. And can I use the program paint to draw the colors?



#239412 How do i make a color UI?

Posted by oxygencraft on 30 November 2015 - 09:41 PM in Ask a Pro

View PostLupus590, on 30 November 2015 - 10:52 AM, said:

First you need a compatible screen, if the computer is gold then you are good to go. (Normal computers/monitors don't have coloured screens)
You can use a gold monitor with a normal computer, just make sure that you are drawing to the monitor

Second you need to know the functions to use, look at the term api on the wiki you want to use the settextcolor and setbackgroundcolor functions.

Finally, the colors API pass to the settextcolour functions

I know these functions but i want some actual code. I also have an advanced computer.



#239348 How do i make a color UI?

Posted by oxygencraft on 30 November 2015 - 08:07 AM in Ask a Pro

I never did this before and I want some help with it. I want to have colored text, buttons etc.



#239249 NexCore Network V3 [MC: 1.7.10][CC: 1.75][BungeeCord][Thermos]

Posted by oxygencraft on 29 November 2015 - 09:57 AM in Servers

This is a unbanned request.
Time banned: Around about 8:30 or 8:40 on 11/29/2015 the time zone is (UTC+10:00) Canberra, Melbourne, Sydney
Reason for banned: Spamming
Reason why i want to get unbanned: I love this moded server i mean i love it to death. I could not find any moded server so i found this server. I want to play around your old base a bit, i do own it. I will never ever spam again i promise ok. And i like programming useful thing too on this server. I would love to come back to this server and play again.



#238968 Fusion OS

Posted by oxygencraft on 26 November 2015 - 08:40 AM in Operating Systems

View PostDannySMc, on 19 November 2015 - 09:07 AM, said:

View Postoxygencraft, on 19 November 2015 - 05:38 AM, said:

View PostDannySMc, on 19 November 2015 - 12:26 AM, said:

View Postoxygencraft, on 18 November 2015 - 05:14 AM, said:

I cant register its saying problem with adding user. HELP!!!

I am not sure about this one as I used this earlier today, I shall look into this, can you make sure that your HTTP whitelist is set to * or has dannysmc.com in there.

Well the HTTP whitelist is set to *.

Hmm interesting, well the login thing works with the app store

So is the Fusion OS accounts are on the DiscoverAPI?



#238962 [Programming Error Or Bug] My Program Crashes When Clicking On The Redstone B...

Posted by oxygencraft on 26 November 2015 - 05:07 AM in Ask a Pro

View PostBomb Bloke, on 25 November 2015 - 09:21 AM, said:

When a computer/turtle starts running code, ComputerCraft starts a ten second timer. If that code doesn't yield before that timer ends then ComputerCraft will either crash the script or the whole computer (depending on the nature of the functions your script is calling). After each yield, any other systems waiting to run code may do so, then after they've all yielded, processing continues with a new time limit.

The reason why is that running your code chews up valuable server processing power, and so it shouldn't be able to monopolise it. In fact, only ONE CC device can run code at a time: While one is doing something, none of the others can do anything until it yields.

Whether or not it takes more than ten seconds for your code to execute has a little to do with the power of the Minecraft server it's running on, and a lot to do with how often you allow your code to yield. Pulling events (eg getting typed characters or checking timers) triggers a yield, and many commands (eg turtle movements, sleeping, or getting text input from the user) have to pull events to work anyway. Basically, anything that triggers a pause is pulling an event in order to do it, and in order to pull an event the code yields.

In your code, you're not yielding at all. You're checking your redstone input once, and then either spamming messages or not, depending on what single result you got.

It looks like you were going for something like this:

rednet.open("bottom")

while true do
	if redstone.getInput("left") then
		rednet.send(16, "OPEN")
	else
		rednet.send(16, "CLOSE")  -- I guess?
	end

	os.pullEvent("redstone")  -- Yield until a redstone state change occurs.
end

Ok i tested this and pressing the button lots of times wont do anything. And sending an open request will auto close after 8 seconds. But i guess you want all the computers code.

Door exit button code:

redstoneinput = redstone.getInput("left")
rednet.open("bottom")
while true do
   if redstoneinput == true then
		  rednet.send(16, "OPEN")
		  end
		 
		  os.pullEvent("redstone")
end

Door's main lock:

-- Simple Door Lock
-- Created by DannySMc
-- Version 1.2
-- Platform: Lua Virtual Machine
-- Security Method
oldEvent = os.pullEvent
os.pullEvent = os.pullEventRaw
-- Check for API
os.loadAPI("uapi")
rednet.open("bottom")
-- Installer for Configuration File
if fs.exists(".uLockConf") == false then
  uapi.cs()
  print("Running Installer...")
  sleep(0.5)
  term.setCursorPos(1,3)
  term.write("Redstone output side: ")
  strSide = read()
  term.setCursorPos(1,5)
  term.write("Redstone pulse time: ")
  strPulse = tonumber(read())
  term.setCursorPos(1,7)
  term.write("Terminal Label: ")
  strName = read()
  term.setCursorPos(1,9)
  term.write("Password for unlock: ")
  strPassword = read("*")
  term.setCursorPos(1,11)
  print("What is the name this program is saved as?")
  term.setCursorPos(1,12)
  term.write("Program Name: ")
  strProgName = read()
 
  strPassword = uapi.checksum(strPassword, 1000)
 
  -- Create Configuration File
  uapi.saveConfig({['progName']=strProgName, ['terminalName']=strName, ['redSide']=strSide, ['redPulse']=strPulse, ['lockPassword']=strPassword}, ".uLockConf")
 
  -- Startup File
  term.setCursorPos(1,14)
  print("Do you wish to create a startup file?")
  term.setCursorPos(1,15)
  repeat
  term.write("YES/NO: ")
  startupAnswer = read()
  until ((startupAnswer == "YES") or (startupAnswer == "NO"))
 
  if startupAnswer == "YES" then
    startFile = fs.open("startup", "w")
    startFile.writeLine('os.loadAPI("uapi")')
    startFile.writeLine('config = uapi.loadConfig(".uLockConf")')
    startFile.writeLine("shell.run(config.progName)")
    startFile.close()
    print("Install Complete!")
    sleep(0.5)
  else
    print("Install Complete!")
    sleep(0.5)
  end
 
  print("Rebooting the terminal...")
  sleep(1)
  os.reboot()
end
-- Load Configuration File
config = uapi.loadConfig(".uLockConf")
-- Password Lock Program
uapi.cs()
uapi.drawBox(1, 51, 1, 5, " ", "white", "cyan")
uapi.drawBox(2, 51, 2, 3, " ", "white", "cyan")
uapi.drawBox(3, 51, 3, 1, " ", "white", "cyan")
uapi.printC(config.terminalName, 3, false, "white", "cyan")
uapi.drawBox(1, 51, 19, 1, " ", "white", "cyan")
uapi.printC("Password Lock (Ver 1.2) -> Created By DannySMc", 19, false, "white", "cyan")
uapi.resetCol()
term.setCursorPos(1, 10)
term.write(">	 Password: ")
password = read("*")
password = uapi.checksum(password, 1000)
if password == config.lockPassword then
  term.setCursorPos(1,11)
  print(">	 Password Correct!")
  rednet.send(16, "OPEN")
  sleep(0.5)
  os.reboot()
else
  term.setCursorPos(1,11)
  print(">	 Password Incorrect!")
  sleep(1.5)
  os.reboot()
end

Door server code:

rednet.open("front")
local function open()
  rs.setOutput("top", true)
  sleep(0.75)
  rs.setOutput("right", true)
  sleep(0.75)
  rs.setOutput("bottom", true)
  sleep(0.75)
  rs.setOutput("left", true)
  sleep(0.75)
  rs.setOutput("left", false)
end
local function close()
  rs.setOutput("bottom", false)
  sleep(0.75)
  rs.setOutput("right", false)
  sleep(0.75)
  rs.setOutput("top", false)
end
while true do
  local args = { os.pullEvent("rednet_message") }
  if args[3] == "OPEN" then
  print(args[2]..": "..args[3])
    open()
    sleep(8)
    close()
  end
end

And that's all the code.



#238885 [Programming Error Or Bug] My Program Crashes When Clicking On The Redstone B...

Posted by oxygencraft on 25 November 2015 - 08:38 AM in Ask a Pro

What i am trying to do is make a computer to send a request to the door server to open the door. Pressing the button once wont open the door and does not send the request. But when i press the button until the computer sends the request and the server door opens the door, my program crashes says peripheral:74: Too long without yielding. I don't know if this is a Computercraft bug or programming error my code is down below:

redstoneinput = redstone.getInput("left")
rednet.open("bottom")
while true do
   if redstoneinput == true then
	  rednet.send(16, "OPEN")
	  end
end



#238656 Discover App (Ver. 7.4) - Apps, Snippets, Cloud Storage, Chat Board, Mail, Pr...

Posted by oxygencraft on 22 November 2015 - 04:55 AM in Programs

View PostDannySMc, on 20 November 2015 - 06:42 PM, said:

View Postoxygencraft, on 20 November 2015 - 11:06 AM, said:

View PostDannySMc, on 20 November 2015 - 07:37 AM, said:

View Postoxygencraft, on 20 November 2015 - 04:41 AM, said:

View PostDannySMc, on 19 November 2015 - 01:38 PM, said:

View Postoxygencraft, on 19 November 2015 - 10:55 AM, said:

View PostDannySMc, on 19 November 2015 - 09:07 AM, said:

View Postoxygencraft, on 19 November 2015 - 05:34 AM, said:

View PostDannySMc, on 18 November 2015 - 11:57 PM, said:

View Postoxygencraft, on 18 November 2015 - 08:28 AM, said:

Crashes when registering for an account its said:

store:634: store:1824: attempt to index ? (a nil value)

I shall delete your account then

Upon testing, it works fine for me?

It does not work for me. If you could register for me then the username is my forum name and you assign me with a temp password then pm me with the temp password and i will change it as soon as i login and then set the email address for the account.

Have you downloaded the new version?

I have downloaded the new version. But when you type your details and press the register button it returns a value of nil then crashes. You need to type in real details NOT fake ones.

The reason you can't register is because you already have an account, please login instead of clicking register.

It said could not verify could not verify credentials. I must of forgot my password because i don't play moded Minecraft so often.

Then go delete my account.

How about you ask nicely.

Delete my account please, Danny.



#238498 Discover App (Ver. 7.4) - Apps, Snippets, Cloud Storage, Chat Board, Mail, Pr...

Posted by oxygencraft on 20 November 2015 - 11:06 AM in Programs

View PostDannySMc, on 20 November 2015 - 07:37 AM, said:

View Postoxygencraft, on 20 November 2015 - 04:41 AM, said:

View PostDannySMc, on 19 November 2015 - 01:38 PM, said:

View Postoxygencraft, on 19 November 2015 - 10:55 AM, said:

View PostDannySMc, on 19 November 2015 - 09:07 AM, said:

View Postoxygencraft, on 19 November 2015 - 05:34 AM, said:

View PostDannySMc, on 18 November 2015 - 11:57 PM, said:

View Postoxygencraft, on 18 November 2015 - 08:28 AM, said:

Crashes when registering for an account its said:

store:634: store:1824: attempt to index ? (a nil value)

I shall delete your account then

Upon testing, it works fine for me?

It does not work for me. If you could register for me then the username is my forum name and you assign me with a temp password then pm me with the temp password and i will change it as soon as i login and then set the email address for the account.

Have you downloaded the new version?

I have downloaded the new version. But when you type your details and press the register button it returns a value of nil then crashes. You need to type in real details NOT fake ones.

The reason you can't register is because you already have an account, please login instead of clicking register.

It said could not verify could not verify credentials. I must of forgot my password because i don't play moded Minecraft so often.

Then go delete my account.



#238478 How to: Create a MySQL Database Login

Posted by oxygencraft on 20 November 2015 - 04:49 AM in Tutorials

View PostDannySMc, on 19 November 2015 - 09:55 PM, said:

View Postoxygencraft, on 19 November 2015 - 09:45 PM, said:

View PostDannySMc, on 19 November 2015 - 01:37 PM, said:

View Postoxygencraft, on 19 November 2015 - 10:34 AM, said:

View PostDannySMc, on 19 November 2015 - 09:09 AM, said:

View Postoxygencraft, on 19 November 2015 - 06:52 AM, said:

How do i setup the MySQL tables?

Have you got a database? so you will need some kind of web server with php installed and a sql database.

I got a MySQL server up and running, i made a database but I don't know how do I setup the tables.

Do you have a backend? like phpmyadmin? if not you will need to set up via command line.

I have PHPMyAdmin.

Well login and simply click create table...? I would suggest doing a tutorial on how to use phpmyadmin...

Well I don't know what columns to setup and stuff like that.



#238476 Discover App (Ver. 7.4) - Apps, Snippets, Cloud Storage, Chat Board, Mail, Pr...

Posted by oxygencraft on 20 November 2015 - 04:41 AM in Programs

View PostDannySMc, on 19 November 2015 - 01:38 PM, said:

View Postoxygencraft, on 19 November 2015 - 10:55 AM, said:

View PostDannySMc, on 19 November 2015 - 09:07 AM, said:

View Postoxygencraft, on 19 November 2015 - 05:34 AM, said:

View PostDannySMc, on 18 November 2015 - 11:57 PM, said:

View Postoxygencraft, on 18 November 2015 - 08:28 AM, said:

Crashes when registering for an account its said:

store:634: store:1824: attempt to index ? (a nil value)

Upon testing, it works fine for me?

It does not work for me. If you could register for me then the username is my forum name and you assign me with a temp password then pm me with the temp password and i will change it as soon as i login and then set the email address for the account.

Have you downloaded the new version?

I have downloaded the new version. But when you type your details and press the register button it returns a value of nil then crashes. You need to type in real details NOT fake ones.

The reason you can't register is because you already have an account, please login instead of clicking register.

It said could not verify could not verify credentials. I must of forgot my password because i don't play moded Minecraft so often.



#238433 How to: Create a MySQL Database Login

Posted by oxygencraft on 19 November 2015 - 09:45 PM in Tutorials

View PostDannySMc, on 19 November 2015 - 01:37 PM, said:

View Postoxygencraft, on 19 November 2015 - 10:34 AM, said:

View PostDannySMc, on 19 November 2015 - 09:09 AM, said:

View Postoxygencraft, on 19 November 2015 - 06:52 AM, said:

How do i setup the MySQL tables?

Have you got a database? so you will need some kind of web server with php installed and a sql database.

I got a MySQL server up and running, i made a database but I don't know how do I setup the tables.

Do you have a backend? like phpmyadmin? if not you will need to set up via command line.

I have PHPMyAdmin.



#238392 Discover App (Ver. 7.4) - Apps, Snippets, Cloud Storage, Chat Board, Mail, Pr...

Posted by oxygencraft on 19 November 2015 - 10:55 AM in Programs

View PostDannySMc, on 19 November 2015 - 09:07 AM, said:

View Postoxygencraft, on 19 November 2015 - 05:34 AM, said:

View PostDannySMc, on 18 November 2015 - 11:57 PM, said:

View Postoxygencraft, on 18 November 2015 - 08:28 AM, said:

Crashes when registering for an account its said:

store:634: store:1824: attempt to index ? (a nil value)

Upon testing, it works fine for me?

It does not work for me. If you could register for me then the username is my forum name and you assign me with a temp password then pm me with the temp password and i will change it as soon as i login and then set the email address for the account.

Have you downloaded the new version?

I have downloaded the new version. But when you type your details and press the register button it returns a value of nil then crashes. You need to type in real details NOT fake ones.