Advertisement
Win4Win

Coin_of_Fortune

Sep 19th, 2023 (edited)
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. module = peripheral.wrap("back")
  2. displayName = "minecraft:totem_of_undying"
  3. coinName = "xreliquary:fortune_coin"
  4. local cachedSlot
  5. local coinSlot
  6.  
  7.  
  8. local function moveTotem()
  9.     while true do
  10.         local found
  11.         if module.getEquipment().getItem(2) == nil then
  12.             for slot, meta in pairs(module.getEnder().list()) do
  13.                 if (meta.name == displayName) then
  14.                    
  15.                     cachedSlot = slot
  16.                     found = true
  17.                     break
  18.                 end
  19.             end
  20.         end
  21.         if found then
  22.             print("Totem Added")
  23.             module.getEnder().pushItems("equipment", cachedSlot)
  24.         else
  25.             cachedSlot = nil
  26.         end
  27.         sleep(0.05)
  28.     end
  29. end
  30.  
  31. local function coinOfFortune()
  32.     while true do
  33.         local found
  34.         for slot, meta in pairs(module.getInventory().list()) do
  35.             if (meta.name == coinName) then
  36.                 print(meta.name)
  37.                 for i,v in pairs(meta) do
  38.                     print(i,v)
  39.                 end
  40.                 sleep(3)
  41.                 break
  42.             end
  43.         end
  44.         if found then
  45.             --print("Totem Added")
  46.             --module.getEnder().pushItems("equipment", cachedSlot)
  47.         else
  48.             --cachedSlot = nil
  49.         end
  50.         sleep(0.05)
  51.     end
  52. end
  53.  
  54. parallel.waitForAll(moveTotem, coinOfFortune)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement