Having read a few topics regarding changing a time property via a soft remote, I realise that I need a script that when run increases/decreases the time value accordingly.
Having zero knowledge of VB, can someone give me an example of a script that will take the time value from a property, increase it by 10 min and then update the same property? From there I expect I'll be able to figure out how to decrease and change the hours. The time property would be hours and minutes only.
Thanks in advance
James
Script manipulation of time
James,
This should get you started.
This should get you started.
Code: Select all
'Get the Time and Date from the property
szTheTime = GetPropertyValue( "Inc Time Script.Test Time" )
' Add 10 minutes to the time
szAdjustedDate = DateAdd( "n", 10, szTheTime )
' Format up the Property value as HouseBot needs it
szNormalized = "Year=" & datepart("yyyy",szAdjustedDate ) & ",Month=" & datepart("m",szAdjustedDate ) & ",Day=" & datepart("d",szAdjustedDate ) & ",Hour=" & datepart("h",szAdjustedDate ) & ",Minute=" & datepart("n",szAdjustedDate )
' Set the Property with the new time.
SetPropertyValue "Inc Time Script.Test Time", szNormalized
Scott
James,
Are you using the exact same script that I used, or is it a bit different? If it's different, please send it to me at support@cebotics.com, so I can look into it.
Also, when HouseBot crashes it creates a dump file that contains diagnostic info. Please look in your \HouseBot\Dump directory and send the latest dump file to me at support@cebotics.com.
Are you using the exact same script that I used, or is it a bit different? If it's different, please send it to me at support@cebotics.com, so I can look into it.
Also, when HouseBot crashes it creates a dump file that contains diagnostic info. Please look in your \HouseBot\Dump directory and send the latest dump file to me at support@cebotics.com.
Scott