Jump to content


Henness's Content

There have been 39 items by Henness (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#189603 Problems with openperipherals

Posted by Henness on 30 July 2014 - 09:41 PM in Ask a Pro

Okay I got it I'm partially retarded. I didn't know the chest had to be on the apiary not the computer, but now I realize that the open peripherals move items from one peripherals inventory to an adjacent inventory. Thanks for the help hilburn!



#189598 Problems with openperipherals

Posted by Henness on 30 July 2014 - 09:01 PM in Ask a Pro

Yea I was trying to use the swap stacks method but i came to the same conclusion. I also tried making a buffer chest like you said but had no luck, I'll try it again.



#189582 Problems with openperipherals

Posted by Henness on 30 July 2014 - 05:20 PM in Ask a Pro

I made this simple program for making honey but for some reason it won't move the bee's too the first and and second slot in the apiary.

http://pastebin.com/ytFz7qtS

can anyone tell be where i went wrong?



#161670 Custom Error's Using pcall()

Posted by Henness on 23 January 2014 - 05:28 AM in Ask a Pro

yea I have no idea I dont even know what a environment is. I looked is up but still doesn't make sense to me. Im just not gonna bother with shell.getRunningProgram()



#161646 Custom Error's Using pcall()

Posted by Henness on 22 January 2014 - 09:16 PM in Ask a Pro

Im not quite sure how I'm supposed to set up the environment. Im looking in shell and from what I can see shell.getRunningProgram() isn't going to work if I run a program with loadfile().

Because when you run a program with shell.run it adds the program to a new spot at the end of a table with tProgramStack[#tProgramStack + 1] = sPath then when you call shell.getRunningProgram() it just returns the last variable in the table

Unless your talking about os.run()



#161636 Custom Error's Using pcall()

Posted by Henness on 22 January 2014 - 07:32 PM in Ask a Pro

os.run() seems work for running the program but every error is returned as attempt to call boolean. Because its not storing a string in sError. (I think)

bError, sError = pcall(os.run({}, "advancedorefinder", "orefinder.save"))

Loadfile() seems to work too but if I use it then The program that it runs cant use shell.getRunningProgram() :(



#161602 Custom Error's Using pcall()

Posted by Henness on 22 January 2014 - 05:15 PM in Ask a Pro

 Bomb Bloke, on 22 January 2014 - 04:54 AM, said:

That indeed sounds a lot like what Lyqyd was saying above.

Edit: I've not played with them, so I'm not even sure they're available within ComputerCraft, but I suspect you want something along the lines of dofile() or loadfile().

Thanks Bomb, that works first time I have ever seen dofile and loadfile there isn't much info on them either. I think that the shell.run should be modified to return values :/



#161565 Wat's wrong?

Posted by Henness on 22 January 2014 - 03:20 PM in Ask a Pro

I believe this is part of your other post



#161562 Non defined string as argument

Posted by Henness on 22 January 2014 - 03:15 PM in Ask a Pro

As stated by Bab this would be what your describing.

function m(a)
 if a == "x"  then
  print("Thanks")
 end
end
local x = "x"
m(x)



#161558 Wat's wrong?

Posted by Henness on 22 January 2014 - 03:07 PM in Ask a Pro

What?

Please post more information



#161555 Crashing program

Posted by Henness on 22 January 2014 - 03:03 PM in Ask a Pro

Like Lydyd said you need to check if its a mouse click other wise its just going to check every event.

while true do
 local event, button, x, y = os.pullEventRaw()
 if event == "mouse_click" then
  if x>23 and x<26 and y==13 then
   -- code here
   break
  end
 end
end



#161481 Custom Error's Using pcall()

Posted by Henness on 22 January 2014 - 04:35 AM in Ask a Pro

I have been thinking about this all day, and just before I was about to go to bed I thought. Maybe the pcall is returning true because the shell.run is completing without errors but the part that is acualy erroring is whats inside the shell.run. Can anyone conferm this is what's happening? And if so can I put a pcall inside the shell.run or is the another way of doing it.



#161465 [Forum] Code Snippet Section

Posted by Henness on 22 January 2014 - 12:28 AM in Forum Discussion

Simple Environment Proof "turtle.forward()"
local function forward()
 while not turtle.forward() do
  if turtle.detect() then
   if not turtle.dig() then
    return false
   end
  else
   turtle.attack()
  end
 end
 return true
end

Personally I like the snippet idea :)



#161450 is it possible to execute a redstone signal when something is said in chat

Posted by Henness on 21 January 2014 - 07:53 PM in Ask a Pro

In fact MiscPeripherals has just what you were looking for its called the chat box. Although I still suggest the RIFID's from Immibis's Peripheral because then you wouldn't have to broadcast your password across a server If that's what your doing.

http://www.computerc...peripherals-33/



#161449 is it possible to execute a redstone signal when something is said in chat

Posted by Henness on 21 January 2014 - 07:48 PM in Ask a Pro

Im sure it is possible but you would need a peripheral added by a mod check this section of the forum to find one:

http://www.computerc...urtle-upgrades/

Immibis's Peripheral can make it so if you have a key card in your inventory it will open the door when you get close, it might be better for your situation.

http://www.computerc...ss-peripherals/



#161435 Custom Error's Using pcall()

Posted by Henness on 21 January 2014 - 05:20 PM in Ask a Pro

Scratch that,

only two values were returned

first was true and second was false which doesn't seem to make sense because the first value should be false and the second should be a string.



#161426 Custom Error's Using pcall()

Posted by Henness on 21 January 2014 - 04:34 PM in Ask a Pro

What's the best way to do that, I haven't used lua for a while.



#161422 Custom Error's Using pcall()

Posted by Henness on 21 January 2014 - 04:17 PM in Ask a Pro

That isn't working either and I'm fairly sure it's supposed to have the "not" because if it errors bError returns false.

it just prints false.



#161416 Custom Error's Using pcall()

Posted by Henness on 21 January 2014 - 03:46 PM in Ask a Pro

Okay so this is a basic version of what I have.
But this does not seem to be working, it doesnt print the error.

Main program:
bError, sError = pcall(shell.run, "testprogram", "variable")
if not bError then
   print(sError)
else
   -- continue
end

Test program:
error("This is an Error")



#161410 Custom Error's Using pcall()

Posted by Henness on 21 January 2014 - 02:56 PM in Ask a Pro

So would it look like this?
   if turtle.getFuelLevel() > 0 then
	    return assert(false,"Error, there must be fuel in the turtle!")
   end
or
   if turtle.getFuelLevel() > 0 then
	    assert(false,"Error, there must be fuel in the turtle!")
   end



#161396 Custom Error's Using pcall()

Posted by Henness on 21 January 2014 - 01:15 PM in Ask a Pro

I'm trying to add an error menu to my gui program so if it runs a program that results in an error then it will print the error in a new menu.

I cant seem to make a custom error message for if the program is being used wrong. I don't really know how to use pcall() can you even return a custom error message back to it?

http://pastebin.com/QpfucDe1

GUI program:
  bError, sError = pcall(shell.run, "program name", "variable")
  if not bError then
	menustate = "error menu"
  else
	menustate = "main menu"
  end

Program ran by GUI program:
   if turtle.getFuelLevel() > 0 then
	return false, "Error, there must be fuel in the turtle!"
   end
also tryed
   if turtle.getFuelLevel() > 0 then
	return "Error, there must be fuel in the turtle!"
   end



#161360 Advanced Programs: Orefinder, Tunnel.

Posted by Henness on 21 January 2014 - 05:14 AM in Turtle Programs

View Poststuffedparrot, on 20 January 2014 - 06:12 PM, said:

-snip-

I have considered updating my Tunnel program. But I personally think I need to start over with it, or at least replace a lot of the code.

But that's a lot of work, I'll add it to my list of things to do. I don't know when I'll get to it.



#161231 Help Finding a Bug in My Advanced Orefinder

Posted by Henness on 20 January 2014 - 01:06 AM in Ask a Pro

Omg I thank you so much for this lol, that's exactly what it is. I don't know why I didn't see that.



#161131 Help Finding a Bug in My Advanced Orefinder

Posted by Henness on 19 January 2014 - 12:44 AM in Ask a Pro

The bug only happens when when the turtle program is exited between the vertical holes.

Thanks for the information on the full inventory thing.



#161040 Advanced Programs: Orefinder, Tunnel.

Posted by Henness on 18 January 2014 - 11:40 AM in Turtle Programs

View PostZaflis, on 18 January 2014 - 09:18 AM, said:

-snip-

Yea It would be fairly simple but I need to modify my gui program to ask them if they want to use ender chests. Its a little more work but i'll see if I can get to work on it :P