de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Couple of newbie scripting questions
PostPosted: Sat Oct 19, 2019 6:08 pm 
Offline
Regular
Hi just starting out in trying to write a script and have come across a few issues.

How do I ensure that the script knows I have started a new instruction a hard return doesn't seem to always do it?


Is there a function I can use to display a epoch/unix timestamp variable to display in dd:hh:mm format or do I need to script it longhand?

I'm having issues with "nesting" math type things that keeps throwing errors so am having to write line afterline to do it - is there a heirachy of bracket types I should be using or something like that? () {} [] or ???


TIA for any help.


Top
 Profile Send private message 
 
 Re: Couple of newbie scripting questions
PostPosted: Sat Oct 19, 2019 8:19 pm 
Offline
Regular
Just to clarify its a way of displaying as HH:mm a time value that I am looking for not the current time, specifically the difference between current time and previously saved value in unix format, have found the thread that details how to get current time values.


Top
 Profile Send private message 
 
 Re: Couple of newbie scripting questions
PostPosted: Tue Oct 22, 2019 5:51 pm 
Offline
Site Admin
User avatar
Quote:
How do I ensure that the script knows I have started a new instruction a hard return doesn't seem to always do it?

I don't understand

Quote:
the difference between current time and previously saved value

Time delta : I don't know if there is an easy solution (Java API 8 are not supported). I'll do this :
Code:
def t1 =... //UNIX timestamp in seconds
def t2 =... 
def text = String.format("%02d:%02d:%02d", (int)((t2-t1)/86400), ((int)((t2-t1)/3600)%3600), ((int)((t2-t1)/60)%60))


Quote:
I'm having issues with "nesting" math type things that keeps throwing errors so am having to write line afterline to do it - is there a heirachy of bracket types I should be using or something like that? () {} [] or ???

No, only parenthesis


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.