Jump to content


Zukamimozu's Content

There have been 4 items by Zukamimozu (Search limited from 10-February 22)


By content type

See this member's

Sort by                Order  

#196019 Attempt to call Nil - Melee Turtle

Posted by Zukamimozu on 12 October 2014 - 08:37 PM in Ask a Pro

The exact error code is: startup:1: attempt to call nil
The Computercraft version is 1.63
Just checked, it's typed correctly.

Just tried
while true do
if turtle.getItemCount(1) >= 2 then
turtle.turnRight()
turtle.drop(2)
turtle.turnLeft()
else
turtle.attack()
sleep(0.5)
end
end
and now it says: startup:2: attempt to call nil

EDIT: Okay, not quite sure what happened but just broke the turtle and placed it back down and it works now?
Thanks for the quick responses anyways :)



#196011 Attempt to call Nil - Melee Turtle

Posted by Zukamimozu on 12 October 2014 - 08:19 PM in Ask a Pro

So I have a melee turtle set up in this mob farm. Anyways I've been trying for the past 20 minutes trying to figure out why this isn't working...

My code right now is set up so it puts the drops into a chest, and that's the part that isn't working...

local count = turtle.getItemCount(1)
while true do
if count >= 2 then
turtle.turnRight()
turtle.drop(2)
turtle.turnLeft()
else
turtle.attack()
sleep(0.5)
end
end

It's attempting to call nil in line 1... It was working earlier then I changed some stuff and don't remember what I had previously.



#195911 Rednet Problem - rednet:87: Expected number

Posted by Zukamimozu on 11 October 2014 - 11:13 PM in Ask a Pro

Thank you so much! Didn't know about the string thing, it works now.



#195903 Rednet Problem - rednet:87: Expected number

Posted by Zukamimozu on 11 October 2014 - 10:15 PM in Ask a Pro

So I'm pretty new to Computer Craft and I'm trying to set up a system to open and close doors with the wireless pocket computer. I have a computer that receives the signal and will open/close the doors. On the pocket Computer I have
term.clear()
term.setCursorPos(1,1)
print("Receiver ID: ")
local receiver = read()
term.clear()
term.setCursorPos(1,1)
print("Message: ")
local message = read()
rednet.send(receiver,message)
term.clear()
term.setCursorPos(1,1)
print("Message Sent")
sleep(1.5)
term.clear()
term.setCursorPos(1,1)
So it works fine until I get to the point where I send the message part of the code. Once I hit enter on the message part it says rednet:87: Expected number

I don't know how to fix this. Any help would be nice! Thanks.