Advertisement
electronic_steve

ccs : main

Mar 15th, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 KB | None | 0 0
  1. --[[if not shell.run("ESGraphics") then
  2. shell.run("pastebin","get","iifHYZ2v","ESGraphics")
  3. shell.run("ESGraphics")
  4.  end]]
  5.  
  6. texttable={""}
  7.  cluster={{0,0,false}}
  8.  clusterIDs={}
  9.  commands={}
  10.  commands["READY"]=function (TEXT)
  11.  cluster[#cluster+1]={TEXT[2],0}
  12.  clusterIDs[TEXT[2]]=#cluster
  13.  end
  14.   commands["NEWPOWER"]=function (TEXT)
  15.  cluster[clusterIDs[TEXT[2]]]={TEXT[2],TEXT[3]}
  16.  end
  17.  
  18.  rednet.open("left")
  19. function update()
  20. local N=1
  21.  
  22.   id,msg,dis,pro=rednet.receive(0.01)
  23.  
  24. if  id==nil then else
  25.  
  26.  for n in string.gmatch(msg, ".") do
  27.  if n=="&" then N=N+1 texttable[N]="" else texttable[#texttable]=texttable[#texttable]..n end
  28. end
  29.  
  30. commands[texttable[1]](texttable)
  31.  
  32. end
  33. print(texttable[1])
  34.  
  35. end
  36. function draw()
  37. if  id==nil then else
  38. for i=1,#cluster do
  39. print(cluster[i].." "..i) end
  40.  
  41.  
  42. end
  43. texttable=nil
  44. texttable={""}
  45. end
  46.  
  47.  while true do
  48.  update()
  49. draw()
  50. --r.systemupdate()
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement