bjornir90, on 22 May 2013 - 12:20 AM, said:
- ComputerCraft | Programmable Computers for Minecraft
- → Oct125's Content
Oct125's Content
There have been 49 items by Oct125 (Search limited from 10-February 22)
#119849 [API] Mouse and graphic api V1.6.1 beta. Easy to use GUI API with full mouse...
Posted by
Oct125
on 22 May 2013 - 04:33 PM
in
APIs and Utilities
#113226 [Solved] Problem with bundled cables
Posted by
Oct125
on 22 April 2013 - 11:20 AM
in
Ask a Pro
theoriginalbit, on 22 April 2013 - 10:54 AM, said:
Off-topic about people wanting you to translate your code
I would like to point out, that no matter the variables and functions language it should be easy to read and understand... especially since you can just look around the code to see how it is used and its values, of course this is easier if the names make sense, but don't worry about translating everything in your code, it isn't required...
Thanks to response me! I replaced
if r1 == true then cc1 = rs.getBundledOutput(lado) -- Finds what colors are currently on rs.setBundledOutput(lado, cc1 + 1) -- sets the currently on colors and the new color on else cc2 = rs.getBundledOutput(lado) -- Finds what colors are currently on rs.setBundledOutput(lado, cc2 - 1) -- sets the currently on colors and the new color on end
if r1 == true then cc1 = rs.getBundledOutput(lado) -- Finds what colors are currently on rs.setBundledOutput(lado, colors.combine(cc1, 1)) -- sets the currently on colors and the new color on else cc2 = rs.getBundledOutput(lado) -- Finds what colors are currently on rs.setBundledOutput(lado, colors.subtract(cc2, 1)) -- sets the currently on colors and the new color on end
#113209 [Solved] Problem with bundled cables
Posted by
Oct125
on 22 April 2013 - 10:39 AM
in
Ask a Pro
Spongy141, on 21 April 2013 - 07:01 PM, said:
I updated and translate my code, so, please, read it again in the first post!
#112716 [Solved] Problem with bundled cables
Posted by
Oct125
on 21 April 2013 - 11:15 AM
in
Ask a Pro
GradyTheHermit, on 20 April 2013 - 05:21 PM, said:
I would recommend if possible, abandon the api and write your code in the default computer-craft setup
Then add it back enclosed in the button function(is that what its called?)
also make sure you are using an advanced computer AND advanced monitor
you may want to try to set the colors as numbers (defined here)
or if all else fails.. you could use regular redstone wire and define the on/off for all three sides in one section of code. taking up more room and being lazy but meh
it would also help if you translated your comments in the code you wrote or at least tell me the language they are in
--also be happy i made this account to answer your question
Thanks to response my topic, i will try to replace the colors by the numbers, maybe can help, unfortunately i can't replace the bundled cable by redstone, and, the comments are in portuguese! AND i will try without the API...
#112207 A category for W.I.P. projects!
Posted by
Oct125
on 20 April 2013 - 08:03 AM
in
Forum Discussion
Obs: Work In Progress
#112202 [WIP] Util OS
Posted by
Oct125
on 20 April 2013 - 07:58 AM
in
Operating Systems
bjornir90, on 06 February 2013 - 07:10 PM, said:
HowCanIDeleteMyAccount?, on 07 February 2013 - 02:59 PM, said:
P.S : I am not trying to be a jerk, just see what he says, I want to know why he made it.
I made this, to help me in those servers!
#112179 [Solved] Problem with bundled cables
Posted by
Oct125
on 20 April 2013 - 07:33 AM
in
Ask a Pro
I'm trying to make a on/off selector using this API (to make the buttons), and a bundled cable, that go to my 3 ractors (each one using the white, orange and the yellow cable, respectively).
I code this, but, every time that i press "r", the reactors turn on and off, randomly!!!
UPDATED!! But not working, same problem...
r1 = false
r2 = false
r3 = false
lado = "front" -- lado = side ;P
function Refresh()
if r1 == true then
cc1 = rs.getBundledOutput(lado) -- Finds what colors are currently on
rs.setBundledOutput(lado, cc1 + 1) -- sets the currently on colors and the new color on
else
cc2 = rs.getBundledOutput(lado) -- Finds what colors are currently on
rs.setBundledOutput(lado, cc2 - 1) -- sets the currently on colors and the new color on
end
if r2 == true then
cc3 = rs.getBundledOutput(lado) -- Finds what colors are currently on
rs.setBundledOutput(lado, cc3 + 2) -- sets the currently on colors and the new color on
else
cc4 = rs.getBundledOutput(lado) -- Finds what colors are currently on
rs.setBundledOutput(lado, cc4 - 2) -- sets the currently on colors and the new color on
end
if r3 == true then
cc5 = rs.getBundledOutput(lado) -- Finds what colors are currently on
rs.setBundledOutput(lado, cc5 + 16) -- sets the currently on colors and the new color on
else
cc6 = rs.getBundledOutput(lado) -- Finds what colors are currently on
rs.setBundledOutput(lado, cc6 - 16) -- sets the currently on colors and the new color on
end
end
function Selection()
print("Please choose the reactors to turn on (1/2/3/all/(r)efresh:")
btnB = io.read()
if btnB == "r" then
Refresh()
end
if btnB == "1" then
print("Reator 1")
if r1 == false then
r1 = true
else
r1 = false
end
end
if btnB == "2" then
if r2 == false then
r2 = true
else
r2 = false
end
end
if btnB == "3" then
if r3 == false then
r3 = true
else
r3 = false
end
end
if btnB == "all" then
if r1 == false then
r1 = true
else
r1 = false
end
if r2 == false then
r2 = true
else
r2 = false
end
if r3 == false then
r3 = true
else
r3 = false
end
end
end
function Initialize()
term.clear()
term.setBackgroundColor(colors.white)
term.setTextColor(colors.black)
term.setCursorPos(1,1)
Selection()
sleep(0.5)
term.setCursorPos(1, 1)
Initialize()
end
Initialize()
I believe that my error is in the "Refresh" function...
Someone can help me?
Sorry for the english ...
#71685 [API] Mouse and graphic api V1.6.1 beta. Easy to use GUI API with full mouse...
Posted by
Oct125
on 10 January 2013 - 05:35 AM
in
APIs and Utilities
ArchAngel075, on 05 January 2013 - 08:58 AM, said:
I will play around with 1.5 ASAP, and I have two suggestions! :
TickBox
draws a 3x3 box where its centre is green or red, if ticked = green if not ticked = red,
setLists
i've no idea what to call them really.. but they are simply two boxes witha button between them, the boxes contain a list of things, like place names or what have you(user defined) and allow you to set if (for this example) placeA to true, placeB - D to false and then placeE to true again.. And one can quickly return what the value of a place is..
-Its like a multi-version of the tickbox, to change a places value you click its name in the box and click the button between the boxes(which in Windows can be two arrows going right/left)
ill elaborate more if needed...
The tick box will be really useful!
And Bjornir, i've made a installer in my OS that copies the API from your pastebin ok?
#70702 [LUA] Problems with a boot loader...
Posted by
Oct125
on 08 January 2013 - 05:52 AM
in
Ask a Pro
Mikk809h, on 07 January 2013 - 07:35 PM, said:
i didnt really know that it would ignore the parametres.
And the parallel: i just think that it would be easier to just make two words in the paratheses.. ::-/
sorry.
remiX, on 07 January 2013 - 09:23 PM, said:
Mikk809h, on 07 January 2013 - 07:35 PM, said:
sorry.
It is but it's really up to the coder to do what he wants
I'm busy looking it at it now and I see you call text() within text() within the parallel.waitForAny(). Will that not give a stack overflow at times, or maybe the time will run out in time..
edit: I think the problem does lie within the parallel function, where you call text() all the time. Weird that the time keeps changing seconds, maybe you should have used a for loop for the timer function.
Also, if you don't know about Tables, you should learn about them and use them a lot, they are really useful.
Check this out:
-- Made by remiX for Util OS
selection = 1
t_Options = {
{ text = "Util OS 0.1 BETA", handler = function() shell.run(".Util/os") end },
{ text = os.version(), handler = function() term.setBackgroundColour(colours.black) term.setTextColour(colours.white) term.setCursorPos(1, 1) term.clear() end }
}
function printMain()
term.setBackgroundColour(colours.black)
term.setTextColour(colours.white)
term.clear()
term.setCursorPos(1, 2)
print(" +------------------Boot Loader------------------+ ")
print(" | | ")
print(" +-----------------------------------------------+ ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" +-----------------------------------------------+ ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" +-----------------------------------------------+ ")
end
function timer()
for i = 5, 1, -1 do
term.setBackgroundColour(colours.black)
term.setCursorPos(6, 16)
write("Booting in " .. i)
sleep(1)
end
return
end
function text()
while true do
for op = 1, #t_Options do
term.setCursorPos(7, op + 5)
if op == selection then term.setBackgroundColour(colours.lightGrey) else term.setBackgroundColour(colours.black) end
write(t_Options[op].text)
end
local _, key = os.pullEvent("key")
if key == keys.down and selection < #t_Options then
-- Down
selection = selection + 1
elseif key == keys.up and selection > 1 then
-- Up
selection = selection - 1
elseif key == keys.enter then
t_Options[selection].handler()
return
end
end
end
printMain()
parallel.waitForAny(timer, text)
-- This is here and will only occur if the timer runs out
-- Because of the sleep(2) (so you can read what it is booting)
-- I had to put it here or else you could still use up and down keys
-- while it's booting
printMain()
term.setCursorPos(7, 5)
print("BOOTING...")
term.setCursorPos(7, 6)
write(t_Options[selection].text)
sleep(2)
t_Options[selection].handler()
Thanks! This will help a lot! I'll put your name on the credits session
And i modified the code a little to, for example, bypass the boot loader if a function in my os it is activated...
#70412 [LUA] Problems with a boot loader...
Posted by
Oct125
on 07 January 2013 - 12:18 PM
in
Ask a Pro
Mikk809h, on 07 January 2013 - 11:32 AM, said:
term.clearLine() -- Without Any arguments.
Your term.clearLine(6,14) is throwing an error, which shuts down the system, before you should know it.
and you should call your parallel.waitForAny() after the two functions :
Like :
function() -- make a name for the function. Like:
function start1() --- Do stuff end function time() timer() end parallel.waitForAny(start1, time)I think that would solve the problem
Orwell, on 07 January 2013 - 11:40 AM, said:
Mikk809h, on 07 January 2013 - 11:32 AM, said:
term.clearLine() -- Without Any arguments.
Your term.clearLine(6,14) is throwing an error, which shuts down the system, before you should know it.
and you should call your parallel.waitForAny() after the two functions :
Like :
function() -- make a name for the function. Like:
function start1() --- Do stuff end function time() timer() end parallel.waitForAny(start1, time)I think that would solve the problem
Ok!
#70381 [WIP] Util OS
Posted by
Oct125
on 07 January 2013 - 11:14 AM
in
Operating Systems
pielover88888, on 07 January 2013 - 10:46 AM, said:
all i knew is "press" and "continue" when i clicked shell, lol
Seems like the new bootloader worked...
A litte tip:
In the menu:
Desligar = shutdown
Reiniciar = reboot
Shell = Shell
After clicking you need to press any key to proceed...
#70355 [LUA] Problems with a boot loader...
Posted by
Oct125
on 07 January 2013 - 10:34 AM
in
Ask a Pro
Here's the code:
--Made by Oct125 for Util OS
selection = 1
term.clear()
term.setCursorPos(1,1)
print(" Boot Loader ")
print(" ")
print(" +---------------------------------------+ ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" | | ")
print(" +---------------------------------------+ ")
print(" | | ")
print(" | | ")
print(" +---------------------------------------+ ")
function timer()
term.setCursorPos(6,14)
print("Starting in: 4")
sleep(1)
term.setCursorPos(6,14)
print("Starting in: 3")
sleep(1)
term.setCursorPos(6,14)
print("Starting in: 2")
sleep(1)
term.setCursorPos(6,14)
print("Starting in: 1")
sleep(1)
term.setCursorPos(6,14)
term.clearLine(6,14)
print("BOOTING...")
if selection == 1 then
shell.run(".Util/os") -- boot the OS
return
else
term.clear()
term.setCursorPos(1,1)
shell.run("shell") -- boot default shell
return
end
end
function text()
if selection == 1 then -- Util OS
term.setCursorPos(6,4)
term.setBackgroundColor(colors.lightGray)
write(" ")
term.setCursorPos(6,4)
write("Util OS 0.1 BETA")
term.setCursorPos(6,5)
term.setBackgroundColor(colors.black)
write(os.version())
else -- CraftOS
term.setCursorPos(6,4)
term.setBackgroundColor(colors.black)
write(" ")
term.setCursorPos(6,4)
write("Util OS 0.1 BETA")
term.setCursorPos(6,5)
term.setBackgroundColor(colors.lightGray)
write(" ")
term.setCursorPos(6,5)
write(os.version())
term.setBackgroundColor(colors.black)
end
parallel.waitForAny(
function()
local sEvent, param = os.pullEvent("key")
if sEvent == "key" then
if param == 208 then
selection = 2
text()
elseif param == 200 then
selection = 1
tempo = 4
text()
else
text()
end
end
end,
function()
timer()
end
)
end
text()
Some one can help me?
#70331 [WIP] Util OS
Posted by
Oct125
on 07 January 2013 - 09:12 AM
in
Operating Systems
Skullblade, on 06 January 2013 - 10:01 AM, said:
Quote
pielover88888, on 06 January 2013 - 03:53 PM, said:
then ran it of course, and.. o_O where does it put the os? it won't boot the actual operating system, lol. And, yes i tried restarting the computer.
Skullblade, on 06 January 2013 - 07:22 PM, said:
pielover88888, on 07 January 2013 - 08:45 AM, said:
The os will boot automatically...
Sorry for that...
#69806 [WIP] Util OS
Posted by
Oct125
on 06 January 2013 - 06:22 AM
in
Operating Systems
PixelToast, on 06 January 2013 - 06:09 AM, said:
the door could use a darker shade under and to the right of the window part
and the light could use orange in the center and yellow on the outside
the boot screen could be animated (and disabled ) in the config menu
it gets annoying seeing a boot screen whenever i want to restart the computer
Ok! I liked your tips thanks! I'll tweak the icons
#69795 [WIP] Util OS
Posted by
Oct125
on 06 January 2013 - 06:05 AM
in
Operating Systems
#69782 [WIP] Util OS
Posted by
Oct125
on 06 January 2013 - 05:50 AM
in
Operating Systems
Util OS
V: 0.2 BETA
Hello all!
I'm working in a project called Util OS. This isn't another OS, this OS, have real and useful functions! And is totaly in user interface, no command line!
Functions and the progress:
- Boot Loader (If you active any function this will boot on Util OS automatically) - Done! Thanks to remiX
- Installer - Done!
- Lock you computer with password -Done!
- Lock a door with a password - Done!
- Lock a door with a key - Done!
- Control the lights (Turn on redstone lights at night, and turn off them at day. Automatically.) 15%
- Principal screen - Done!
- Auto updater - Done!
At startup you can choose if you want to use Util OS, or CraftOS (if you don't active any function actived). And you can return to the shell in the Principal screen.
In this OS, i'm using this awesome API:
Mouse and graphic API by Bjornir90 - http://www.computerc...ent-of-buttons/
And i created my own API inspired on the Cornichen API that creates a window. (
And here some screenshots...
Here's the boot screen, after Boot Loader:

(You can disable this in the config menu...)
And, here's the principal screen, everything is "clickable":

The boot loader, please ignore the blue points... My error ):

I'll add more screenhots...
And here is the installer, if you want to try it!
But... The OS is completely in portuguese...
I'll translate it in the final version...
You need to have HTTP API activated!
To install, type in your computer: pastebin get FkKztnmp inst
and after downloading type: inst
ChangeLog!
0.2 Beta:
- Bug fixes!
- You can choose if want the boot screen - Thanks to PixelToast
- Auto updater!
Please give-me feedback! If like the idea post here too!
Sorry for my bad English...
#65656 [API] Mouse and graphic api V1.6.1 beta. Easy to use GUI API with full mouse...
Posted by
Oct125
on 29 December 2012 - 07:43 AM
in
APIs and Utilities
#65224 [API] Mouse and graphic api V1.6.1 beta. Easy to use GUI API with full mouse...
Posted by
Oct125
on 28 December 2012 - 08:10 AM
in
APIs and Utilities
#64763 [API] Mouse and graphic api V1.6.1 beta. Easy to use GUI API with full mouse...
Posted by
Oct125
on 27 December 2012 - 08:10 AM
in
APIs and Utilities
Error: gui:240: attempt to compare __lt on nil and number
#64418 [Solved] Search for a name in a table
Posted by
Oct125
on 26 December 2012 - 09:50 AM
in
Ask a Pro
Cozzimoto, on 26 December 2012 - 09:41 AM, said:
EDIT
another thing that may be very fun to do is if the client sends back a failed message meaning the password didnt match what you sent you can have it send a redstone signal thats hiding under the users feet to drop them into lava or some sort of way to kill them saying they are not allowed, or a safer way would keep track of how many attemps and if the failed attempts equals lets say 3 then drop them. >=)
remiX, on 26 December 2012 - 09:44 AM, said:
Save the names and passwords of everyone to a file.
Your file system can be like so:
.OS (main directory) .users (directory for all users) Oct125 (users)
To check if the user is valid, you use repeat to check every line of the file:
write("Username: ")
userName = read()
if fs.exists(".OS/.users/" .. userName) then
-- code if the user exists
-- now enter password, etc
else
-- user does not exist
end
Well, that's a good idea, i'll think about it...
- ComputerCraft | Programmable Computers for Minecraft
- → Oct125's Content


