32 posts
Posted 02 March 2014 - 08:48 PM
Hi,
when i try to wrap a monitor, i get the error:
MinerControl.lua:5: attemp to call nil
http://pastebin.com/ZfAKV2tF:(/>
It only fails when im using the modem at the back
1281 posts
Posted 02 March 2014 - 08:49 PM
you wrote peripheral.warp…
32 posts
Posted 02 March 2014 - 08:51 PM
1281 posts
Posted 02 March 2014 - 08:56 PM
"warp", "wrap". See the difference? You're even using the correct one in your post.
32 posts
Posted 02 March 2014 - 09:01 PM
(facepalm) thanks.
By the way, got a little question…
in the code im 'waiting' to receive a message from the Wireless-Modem.
That means the program is "stopped" until it get something. But how can i break this too? like by using a 1 second-timer?
1281 posts
Posted 02 March 2014 - 09:10 PM
local timeOut = os.startTimer(timeGoesHere) --this will fire an event in the given time, with the id it returns.
local tEvent = {os.pullEvent()}
if tEvent[1] == "modem_message" then
--message code here
elseif tEvent[1] == "timer" and tEvent[2] == timeOut then
--timeout code here
end
Im guessing you don't know how tables work, so i'll just put this here aswell.
event = tEvent[1]
side = tEvent[2]
freqency = tEvent[3]
replyFrequency = tEvent[4]
message = tEvent[5]
distance = tEvent[6]
32 posts
Posted 02 March 2014 - 10:13 PM
Thanks =)