Jump to content




Cant wrap a Wireless Modem


6 replies to this topic

#1 gfcwfzkm

  • Members
  • 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

#2 CometWolf

  • Members
  • 1,283 posts

Posted 02 March 2014 - 08:49 PM

you wrote peripheral.warp...

#3 gfcwfzkm

  • Members
  • 32 posts

Posted 02 March 2014 - 08:51 PM

is it wrong? Got it from: http://computercraft...Modem_%28API%29

#4 CometWolf

  • Members
  • 1,283 posts

Posted 02 March 2014 - 08:56 PM

"warp", "wrap". See the difference? You're even using the correct one in your post.

#5 gfcwfzkm

  • Members
  • 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?

#6 CometWolf

  • Members
  • 1,283 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]


#7 gfcwfzkm

  • Members
  • 32 posts

Posted 02 March 2014 - 10:13 PM

Thanks =)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users