So this will probably be a very nub question, but I'm struggling with it.
I'm building a system to manage my Mekanism Induction Matrix and the Mekanism Reactor that keeps it running.
Managing the reactor isn't a problem. But what I'm trying to do is count the flow of energy into and out of my induction matrix in RF/t. Except I'm having a real hassle figuring out how to count the number of ticks since I last checked.
Currently I have a table that is storing and updated each cycle through the app. There is a pause of about 5 seconds in between where the event handler just listens with an event.pull(5), then we go through and update everything again.
m{} is the matrix currently being looked at.
cEnergyStored is the current energy stored in the matrix, being compared to m.energyStored which was saved in the last cycle.
cTime = os.time(), and m.energyTime is the value of os.time() last time around.
I thought I'd go with traditional energy values. So energy over time.
So I'm looking at something along the lines of ...
This is multiplied by 0.4 because Mekanism uses Joules and I'm wanting RF.
Problem is, this is miles off the mark. Looking at the wiki, it says time in "in game seconds" (which means nothing to me. I'm assuming that means the 24000 ticks per day) and to get ticks multiply os.time() by ((1000/60/60) - 6000) but this throws the numbers off even further (1000/60/60 may as well be 0 for this purpose.) The closest I can get to a "near" mark of what is actually going through according to the induction matrix UI itself is to multiply by 1.4 instead of 0.4. But even that is still significantly off as to be useless.
So question.... I'm new to this and still trying to figure out this math, but how do I calculate the ticks since the last time I checked?
os.time() doesn't appear to give me the number of ticks as it did in that other mod I gave up on. os.clock() and os.date() are not even close to useful for this purpose.
Sorry if this is very noob. I was expecting os.time() to just present number of ticks since some arbitrary point. (eg, world creation, or daily dawn)
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.
So this will probably be a very nub question, but I'm struggling with it.
I'm building a system to manage my Mekanism Induction Matrix and the Mekanism Reactor that keeps it running.
Managing the reactor isn't a problem. But what I'm trying to do is count the flow of energy into and out of my induction matrix in RF/t. Except I'm having a real hassle figuring out how to count the number of ticks since I last checked.
Currently I have a table that is storing and updated each cycle through the app. There is a pause of about 5 seconds in between where the event handler just listens with an event.pull(5), then we go through and update everything again.
m{} is the matrix currently being looked at.
cEnergyStored is the current energy stored in the matrix, being compared to m.energyStored which was saved in the last cycle.
cTime = os.time(), and m.energyTime is the value of os.time() last time around.
I thought I'd go with traditional energy values. So energy over time.
So I'm looking at something along the lines of ...
This is multiplied by 0.4 because Mekanism uses Joules and I'm wanting RF.
Problem is, this is miles off the mark. Looking at the wiki, it says time in "in game seconds" (which means nothing to me. I'm assuming that means the 24000 ticks per day) and to get ticks multiply os.time() by ((1000/60/60) - 6000) but this throws the numbers off even further (1000/60/60 may as well be 0 for this purpose.) The closest I can get to a "near" mark of what is actually going through according to the induction matrix UI itself is to multiply by 1.4 instead of 0.4. But even that is still significantly off as to be useless.
So question.... I'm new to this and still trying to figure out this math, but how do I calculate the ticks since the last time I checked?
os.time() doesn't appear to give me the number of ticks as it did in that other mod I gave up on. os.clock() and os.date() are not even close to useful for this purpose.
Sorry if this is very noob. I was expecting os.time() to just present number of ticks since some arbitrary point. (eg, world creation, or daily dawn)
Link to post
Share on other sites