Jump to content


Xhisor's Content

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


By content type

See this member's


Sort by                Order  

#32088 Nice little house [Updated]

Posted by Xhisor on 15 September 2012 - 08:37 PM in Turtle Programs

*bump*



#32087 [Programming][Menu] Making a border

Posted by Xhisor on 15 September 2012 - 08:32 PM in Ask a Pro

View PostEmTeaKay, on 15 September 2012 - 07:23 PM, said:

How do I make a menu border? So it would appear like this:

+----------+
| [1] |
| 2 |
| 3 |
+----------+

Also, here is my current code:
function clear()
term.clear()
term.setCursorPos(1,1)
end
function one()
sleep(.5)
clear()
print("Hello")
end
function two()
sleep(.5)
clear()
print("Hey")
end
function three()
sleep(.5)
clear()
print("Hi")
end
local menuOptions = {"1", "2", "3"}
local termX, termY = term.getSize()
local selected = 1
function centerText(text, termY)
term.setCursorPos(termX/2-#text/2,termY)
term.write(text)
return true
end
function start()
while true do
term.clear()
for i,v in ipairs(menuOptions) do
  if i == selected then
	   centerText("["..v.."]", i)
else
	centerText(v,i)
end
   end
   local id, key = os.pullEvent()
   if key == 208 and selected < #menuOptions then
	selected = selected + 1
   elseif key == 200 and selected > 1 then
	selected = selected - 1
   elseif key == 28 then
	return selected
   end
end
end
x = start()
print()
if selected == 1 then
one()
end
if selected == 2 then
two()
end
if selected == 3 then
three()
end
http://www.computerc...__fromsearch__1
Look through that thread, lots of good menu systems!



#29135 Countdown Timer help

Posted by Xhisor on 01 September 2012 - 10:25 PM in Ask a Pro

while true do --Loops the program
sleep(10200) --Sleeps for 2h50m
rs.setOutput("back", true) --Activates the back
sleep(300) --Stay activated for 5m
rs.setOutput("back", false) --Deactivates the back
end
There you go!



#29127 Why does this not work

Posted by Xhisor on 01 September 2012 - 10:11 PM in Ask a Pro

LUA is case sensitive!



#29125 [Answered] Need help with clock

Posted by Xhisor on 01 September 2012 - 10:09 PM in Ask a Pro

View PostMatrixmage, on 01 September 2012 - 10:08 PM, said:

add "term.clear" to clear the screen

Edit: ninja'd xD
MOHAHAHAHAHAHA! :)/>



#29120 [Answered] Need help with clock

Posted by Xhisor on 01 September 2012 - 10:07 PM in Ask a Pro

View PostExtraRandom, on 01 September 2012 - 10:04 PM, said:

Hi there, I am making a Clock (Minecraft in game time not real life) for my server and i have a way to find the time and printing it but i want it to replace what it wrote instead of writing more and more, i hope this makes sense.

heres the code if you need it

function infiniteLoop()
while true do

local time = os.time()
time = textutils.formatTime(time, false)
print(time)
sleep(0.8)

end
end

infiniteLoop()
function infiniteLoop()
while true do
local time = os.time()
time = textutils.formatTime(time, false)
term.clear()
term.setCursorPos(1,1)
print(time)
sleep(0.8)
end
end
infiniteLoop()
There you go!



#29117 I don't know why this doesn't work?

Posted by Xhisor on 01 September 2012 - 10:01 PM in Turtle Programs

View Postaileron565, on 31 August 2012 - 10:43 PM, said:

This is for a 13x15 tree farm.
Can someone please help me?
I am new to this.
Thx.
Spoiler
LUA is case sensitive.



#27255 How to Edit post titles like this <

Posted by Xhisor on 18 August 2012 - 08:51 PM in Tutorials

May I ask why you posted this?



#24237 Have The Option To Code The Rom For Each Computer in-Game

Posted by Xhisor on 07 August 2012 - 11:30 AM in Suggestions

There should be an option to create a custom OS, put it in the LUA folder and then change the boot priority. In that way you will always have the original to fall back on during failures or hackers!



#24144 Have The Option To Code The Rom For Each Computer in-Game

Posted by Xhisor on 06 August 2012 - 11:13 PM in Suggestions

C:Users*USERNAME*AppDataRoaming.techniclaunchertekkitmodsComputerCraftluarom
There you go, knock yourself out!



#24057 A quick guide through menu making

Posted by Xhisor on 06 August 2012 - 04:04 PM in Tutorials

View PostBigSHinyToys, on 02 August 2012 - 04:16 PM, said:

well seeing as I have released programs with this menu Open Source I am throwing down. You may recognize it from some of my progs (probably not)
Spoiler
This menu will display on the screen from where ever the cursor is last at.
Oh i've been looking for a good way to make a nice menu, can i use (and modify) your menu in my turtle program? You will get credited of course!



#23950 Advanced function replacement

Posted by Xhisor on 06 August 2012 - 08:27 AM in Tutorials

I lost it after the second code, brb going to learn some more LUA.



#23949 [Turtle] Replacement for `go` utility

Posted by Xhisor on 06 August 2012 - 08:23 AM in Turtle Programs

Isn't this just a
["f"] = turtle.forward()
(But with more lines, of course!)



#23783 Nice little house [Updated]

Posted by Xhisor on 05 August 2012 - 09:20 PM in Turtle Programs

Well , as I said I'm stuck on version 1.3 so I am not able to do that... Yet!



#23761 Help with laying program

Posted by Xhisor on 05 August 2012 - 07:41 PM in Ask a Pro

The code should look like this
turtle.up()
while true do
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.select(1)
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.select(1)
end



#23754 [Lua] [Error] Simple Login System

Posted by Xhisor on 05 August 2012 - 07:11 PM in Ask a Pro

Thats because you wrote "elsif" on row 37 and not "elseif". You also have to add a third end and then greet() after that.



#23726 [Lua] [Error] Simple Login System

Posted by Xhisor on 05 August 2012 - 05:09 PM in Ask a Pro

Make sure you have == and not = on all the lines you get "then expected".



#23724 [Lua] [Error] Simple Login System

Posted by Xhisor on 05 August 2012 - 05:01 PM in Ask a Pro

No, no, no! The options menu should be coded like this!
function optionsMenu()
print(" =====================")
print(" || Options Menu ||")
print(" =====================")
print(" || 1 Reboot ||")
print(" || 2 Shutdown ||")
print(" || 3 Admin Mode ||")
print(" || 4 Back to login||")
print(" =====================")
write("-")
local event, input2 = os.pullEvent("char")
if input2 == "1" then
  print("Rebooting...")
  sleep(3)
  os.reboot()
elseif input2 == "2" then
  print("Powering down...")
  sleep(3)
  os.shutdown()
elseif input2 == "3" then
  print("Admin Mode")
elseif input2 == "4" then
    term.clear()
    term.setCursorPos(1,1)
    greet()
end
end



#23710 Login To Use Computer Startup

Posted by Xhisor on 05 August 2012 - 04:03 PM in Programs

View Postodd_kid, on 05 August 2012 - 03:54 PM, said:

Well I do most of my programming on a friends tekkit server so i just install it with floppys when someone wants it. But if you know how to mak a installer file, please do share. i would love to know.
You'll need a disk drive, a computer and a floppy disk.
Place the computer you have the program on and the disk drive beside each other and place the floppy disk in the disk drive. Write
cp startup disk/startup
and there you go! Now use the disk drive and the floppy to copy the program to any computer you want using
cp disk/startup startup
.



#23704 Login To Use Computer Startup

Posted by Xhisor on 05 August 2012 - 03:39 PM in Programs

View PostLeonardoas111, on 05 August 2012 - 02:20 PM, said:

Just make a floppy disk with a installer
But what if he wants to use it as an autostarting program on every computer?
Every time I script something I use Notepad++ and just save the file in
Spoiler
, in that way it gets harder to bypass and you wont have to run aroud with disk drives and floppys.



#23703 Nice little house [Updated]

Posted by Xhisor on 05 August 2012 - 03:33 PM in Turtle Programs

View Postacters124, on 05 August 2012 - 02:07 PM, said:

I never said it had to be 1 block high. @[email protected]
No, but when you use the turte.placeDown() you have to be (atleast) one block high! :P/>
But what version of CC are you using?



#23685 Nice little house [Updated]

Posted by Xhisor on 05 August 2012 - 12:53 PM in Turtle Programs

View Postacters124, on 05 August 2012 - 12:39 PM, said:

you sure you cant use turtle.Placeblock()? or similar?
I tried to use both turtle.place() and turtle.placeDown() (when i was one block high) but it just returned false.



#23681 Looking for some friends to play on my server

Posted by Xhisor on 05 August 2012 - 12:33 PM in General

View PostD3matt, on 03 August 2012 - 04:46 PM, said:

And I hate tekkit haters. Sorry.
+1



#23677 Nice little house [Updated]

Posted by Xhisor on 05 August 2012 - 12:18 PM in Turtle Programs

View Postacters124, on 05 August 2012 - 12:16 PM, said:

oh yeah a door too!
thanks for reminding. xD
use turtle.place and the door will be facing the turtle.(same as beds I think)
Damn it! Since I use CC in tekkit I have to wait for the next patch (the current version in tekkit is 1.3)...



#23674 Nice little house [Updated]

Posted by Xhisor on 05 August 2012 - 12:00 PM in Turtle Programs

View Postacters124, on 05 August 2012 - 12:15 AM, said:

includes a bed a basement 2 large chests and on top of it all it'll be mah first program! :P/>
Huh, when I first did the code you couldn't place beds or doors with the turtle, I've got to check it out!