View difference between Paste ID: baJSgMUc and Fpeg9mNf
SHOW: | | - or go back to the newest paste.
1
core = peripheral.find("weakAutomata")
2
itemName = "advancedperipherals:weak_automata_core"
3
x=0
4-
successful, message = core.feedSoul("Sheep")
4+
5
 for i = 1, 16 do
6
  local detail = turtle.getItemDetail(i)
7
  if detail and detail.name == name then
8
   return i
9
  end
10
 end
11
end
12
if not findItemSlot(itemName) then
13
 print("no weak automata core found")
14
 return
15
end
16
while findItemSlot(itemName) do
17
 success, message = core.feedSoul()
18
 while not successful do
19
  if core.getOperationCooldown("feedSoul") then
20
   while core.getOperationCooldown("feedSoul") > 0 do
21
    print("wait")
22
   end
23
  end
24
  successful, message = core.feedSoul()
25
 
26
  if successful then
27
   print(successful)
28
   print(message)
29
  else
30
   if x < 1 then
31
    print(message)
32
    x=x+1
33
   end
34
   if core.lookAtEntity then
35
    info=core.lookAtEntity()
36
    file=fs.open("entity","w")
37
    file.writeLine(textutils.serialise(info))
38
    file.close()
39
    -- print("Looking at "..textutils.serialise(info))
40
   end
41
  end
42
 end
43
end
44