Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
Arketec

Endergenic Generator Control Program

Question

I’m having trouble trying to create a program that can control an RFTools endergenic generator. For those unfamiliar, this thing requires tick-perfect timing to work right. No matter what I try though, I cannot get a timer setup to run every game tick. As a timing test, I did the following:

 

 

local last = os.time()
event.timer(0.05, function() 
  local current = os.time()
  print(current - last)
  last = current
end, 1000)

-- output
--> 3.0
--> 3.0
--> 4.0
--> 3.0

 

0.05 should be a 1-tick timer, but the game ticks 3-4 times between each loop. Even if I try to reduce the interval to something lower, the game still ticks 3-4 times each loop.

Is there a way to get a consistent 1 - tick loop?

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Open computers is not fast enough to do per tick redstone signals on multiple sources. For the actual problem you have there, os.time returns minecraft seconds. It's a pretty useless metric about 0.28 ticks, I'm pretty sure the most tick accurate clock is computer.uptime() which is seconds since computer was started.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.