This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Log only objects changes / remove storage files
#2
The only solution that I see is that you create another object for each one you want to log and then filter the input value in an event script.

Add this to Common functions:
Code:
function checkupdate(sendto, mindelta)
  -- event value
  local newvalue = event.getvalue()
  -- current object value
  local curvalue = grp.getvalue(sendto)
  -- absolute delta between event and current value
  local valdelta = math.abs(curvalue - newvalue)
  -- send if delta value is large enough
  if valdelta >= mindelta then
    grp.update(sendto, newvalue)
  end
end

Create an event script for each object where you want to log only value changes. 1/1/1 is your "virtual" object which is logged, 2 is minimum delta between current "virtual" object value which causes new value to be sent. Adjust as needed.
Code:
checkupdate('1/1/1', 2)

As for storage, do you mean script storage? In newer releases it's stored in a separate database and there's no easy way to delete some of the entries unless you know all of their names. You can only do a full clear operation.
Reply


Messages In This Thread
RE: Log only objects changes / remove storage files - by admin - 03.10.2016, 07:11

Forum Jump: