Guest User

Retriever program

a guest
Apr 3rd, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | None | 0 0
  1. rednet.open("right")
  2.  
  3. itemList =
  4. {
  5.    [1]=
  6.       {
  7.       [1]="Stone",
  8.       [2]="Cobblestone",
  9.       [3]="Dirt",
  10.       [4]="",
  11.       [5]="",
  12.       [6]="",
  13.       [7]="",
  14.       [8]="",
  15.       [9]="",
  16.       [10]="",
  17.       [11]="",
  18.       [12]="",
  19.       [13]="",
  20.       [14]="",
  21.       [15]="",
  22.       [16]="",
  23.       },
  24.  
  25. {
  26.    [2]=
  27.       {
  28.          [1]="",
  29.       [2]="",
  30.       [3]="",
  31.       [4]="",
  32.       [5]="",
  33.       [6]="",
  34.       [7]="",
  35.       [8]="",
  36.       [9]="",
  37.       [10]="",
  38.       [11]="",
  39.       [12]="",
  40.       [13]="",
  41.       [14]="",
  42.       [15]="",
  43.       [16]="",
  44.       }
  45. }
  46. }
  47.  
  48. colorList =
  49.    {
  50.    [1]=colors.white,
  51.    [2]=colors.orange,
  52.    [3]=colors.magenta,
  53.    [4]=colors.lightBlue,
  54.    [5]=colors.yellow,
  55.    [6]=colors.lime,
  56.    [7]=colors.pink,
  57.    [8]=colors.gray,
  58.    [9]=colors.lightGray,
  59.    [10]=colors.cyan,
  60.    [11]=colors.purple,
  61.    [12]=colors.blue,
  62.    [13]=colors.brown,
  63.    [14]=colors.green,
  64.    [15]=colors.red,
  65.    [16]=colors.black,
  66.    }
  67.  
  68. sideList =
  69.    {
  70.    [1]="bottom",
  71.    [2]="top"
  72.    }
  73.  
  74.  
  75.  
  76.  
  77. while true do
  78.  
  79.    senderId, Object, distance = rednet.receive()
  80.    senderId, Amount, distance = rednet.receive()
  81.    
  82.    print("\nObject Requested: "..Object.."\nAmount: "..Amount)
  83.    sleep(0.1)
  84.  
  85.    for i = 1,2 do
  86.       for j = 1,16 do
  87.          if Object == itemList[i][j] then
  88.             for k = 1,Amount do
  89.                rs.setBundledOutput(sideList[i], colorList[j])
  90.                sleep(0.1)
  91.                rs.setBundledOutput(sideList[i], 0)
  92.                sleep(0.1)
  93.             end
  94.          end
  95.       end
  96.    end
  97. end
Advertisement
Add Comment
Please, Sign In to add comment