Advertisement
GauHelldragon

GauRailControl v0.2

Apr 16th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. rednet.open("right")
  2. rether = peripheral.wrap("left")
  3.  
  4. local Archi,BW,Gau = 601,611,621
  5.  
  6. while true do
  7.   event, ID,message, distance = os.pullEvent("rednet_message")
  8.   if ( string.sub(message,1,4) == "rail" ) then
  9.      value = tonumber(string.sub(message,5))
  10.      rether.setFreq(Archi)
  11.      if ( bit.band(value, 1) == 0 ) then rether.set(false) else rether.set(true) end
  12.      rether.setFreq(BW)
  13.      if ( bit.band(value, 2) == 0 ) then rether.set(false) else rether.set(true) end
  14.      rether.setFreq(Gau)
  15.      if ( bit.band(value, 4) == 0 ) then rether.set(false) else rether.set(true) end
  16.   end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement