Setup Performance Query

Dieses Thema im Forum "Community Talk" wurde erstellt von i_Matt, 12. Mai 2020.

  1. i_Matt

    i_Matt Member

    Beiträge:
    3
    Zustimmungen:
    0
    Ortszeit:
    12:26
    Hey!

    I'm currently trying to automate emeralds by slaughtering innocent villagers in the masses. An issue I ran into was that the smeltry has to have some material in to massacre the villagers for their emeralds. So I wrote a Computer Craft program which checks if there's more than an emerald gem in the smeltry before allowing a liquid translocator to extract.

    Here's my code, can someone confirm that this wont have too much of a performance impact on the server
    Code:
    smeltry = peripheral.wrap("back")
    while true do
      smeltryTank = smeltry.getTankInfo()
      emeraldAmount = smeltryTank[1]["contents"]["amount"] / 640
      if emeraldAmount > 1 then
    	rs.setOutput("bottom", false)
      else
    	rs.setOutput("bottom", true)
      end
      sleep(0.05)
    end
     
    Zuletzt bearbeitet: 12. Mai 2020
  2. Sandstroem

    Sandstroem Well-Known Member

    Beiträge:
    1.529
    Zustimmungen:
    821
    Ortszeit:
    13:26
    I don't know how well computer craft is coded, but I would assume that someone who builds a Lua parser into mc knows how to code.

    I would increase that sleep. There is no point to check things each tick, make it a second or even more.
     
  3. i_Matt

    i_Matt Member

    Beiträge:
    3
    Zustimmungen:
    0
    Ortszeit:
    12:26
    it's needed so the translocator is turned off before the smeltry is emptied because I need a small amount of molten emerald left in there to kill the villagers, I guess I could up the amount stored in the smeltry at once so the translocator takes longer to transfer it and then increase the sleep
     
  4. Sandstroem

    Sandstroem Well-Known Member

    Beiträge:
    1.529
    Zustimmungen:
    821
    Ortszeit:
    13:26
    Why not leave a different liquid in there that doesn't get pulled?
     
  5. i_Matt

    i_Matt Member

    Beiträge:
    3
    Zustimmungen:
    0
    Ortszeit:
    12:26
    That's a much better idea that way the computer isn't needed, cheers mate
     
  6. BlazeFTB

    BlazeFTB Well-Known Member

    Beiträge:
    127
    Zustimmungen:
    26
    Ortszeit:
    07:26
    Thats what i always do when building murder factory's, I use 1 iron nuget and make sure it is always at the bottom in the controller by using fluid filters.
     

Diese Seite empfehlen