Jump to content


A2020's Content

There have been 3 items by A2020 (Search limited from 25-September 20)


By content type

See this member's

Sort by                Order  

#255830 Access to 1.10 version

Posted by A2020 on 09 July 2016 - 03:08 PM in Ask a Pro

I believe I heard that some pack out there is using a 1.10 version of ComputerCraft, however, I can't find that on the download or in the beta testing.

Would it be possible to have access to it?

What are the rules for the 1.10 version been included in ModPacks?



#243698 Send "Order" via Wireless modem and output redstone signal just once

Posted by A2020 on 20 January 2016 - 12:05 AM in Ask a Pro

Thanks a lot, gonna try it.

I used the sleep to prevent this http://www.computerc...thout-yielding/ but I didn't realize it needs to be sleep(0)

Thanks once again for the help.



#243686 Send "Order" via Wireless modem and output redstone signal just once

Posted by A2020 on 19 January 2016 - 10:46 PM in Ask a Pro

Hi guys, I'm new to the forum, and kinda new with LUA and Computercraft in general (familiarized with other languages)

I have a problem. I have 2 Computers with modems and the idea is that Computer one sends an order to computer 2 via wireless modem, I need Computer 2 (There will be many others listening too) to output a redstone signal if the order sent matches what its waiting for to be true.

Here is what I have so far (Totally raw code) the idea will be making it more complex and with a GUI on an interface, but I'm testing so far.

Computer 1:

local modem = peripheral.wrap("top")
local orderChannel = 55
modem.open(orderChannel)
modem.transmit(orderChannel, orderChannel, "TTT")
sleep(1.5)
modem.transmit(orderChannel, orderChannel, "Clear")

Computer 2:

local modem = peripheral.wrap("top")
local orderChannel = 55
local terminal = "TTT"
modem.open(orderChannel)
local messageArguments = {os.pullEvent("modem_message")}
while true do

if terminal==messageArguments[5] then
redstone.setOutput("back", true)
sleep(1)
redstone.setOutput("back", false)
print("We receive 1 order")
else
redstone.setOutput("back", false)
end
sleep(0.1)
end


I'm almost sure that my error is on Computer 2, where I check for the argument to be true and even when I sleep on computer 1 and send a different message, that if statement on computer 2 remains true and that's why the redstone signal keep active.

How should I fix this?

Thanks a lot.