Script CalculateBattery ()
var
string backannounce
var
string announce
var
int tickcount
var
string tickcountConvert
var
string tickcountupdatestring
var
int tickcountupdate
var
int calc1
var
int calc2
var
int calc3
var
int countupdate
var
string user1
var
String user2
Var
String Path1
Var
String Path2
Var
String Path
let path1 = ("c:\\\\users\\\\")
let Path2 = ("\\\\desktop\\\\uptime.txt")
let user1 = GetJAWSSettingsDirectory ()
let User2 = StringSegment (user1, "\\", 3)
let path = path1+user2+path2
let backannounce = "This PC has been up for,"
let announce = "hours."
let tickcount = GetTickCount ()
let  calc1 = (3600000)
let calc2 = tickcount/calc1
let tickcountConvert = IntToString (calc2)
FileExists (path)
if 1
then let tickcountupdate = ReadStringFromFile (path)
delay (1)
DeleteFile (path)
delay (1)
else 0
EndIf
let calc3 = calc2+TickCountUpdate
let TickCountUpdateString = IntToString (calc3)
WriteFileFromString (tickcountupdatestring, (path))
SayString (backannounce+TickCountUpdateString+announce)
EndScript

Object Function ObjectCreate (string S_Object)
Var
Object o_return
Let o_return =CreateObjectEx (s_object, True)
;SayString ("first")
If !o_return Then
Let o_return =CreateObjectEx(s_object, False)
;SayString ("second")
EndIf
If !o_return Then
Let o_return =GetObject(s_object)
;SayString ("third")
EndIf
Return o_return
EndFunction
String Function ReadStringFromFile (string S_File)
Var
Object Null,
Object o_system,
Object o_file,
String s_return
Let o_system =ObjectCreate("Scripting.FilesystemObject")
Let o_file =o_system.OpenTextFile(s_file, 1, 0)
Let s_return =o_file.ReadAll()
o_file.close()
Let o_file =Null
Let o_system =Null
Return s_return
EndFunction
Int Function WriteFileFromString (string S_Text, string S_File)
Var
Object Null,
Object o_system,
Object o_file
Let o_system =ObjectCreate("Scripting.FilesystemObject")
Let o_file =o_system.CreateTextFile(s_file, 1, 0)
o_file.write(s_text)
o_file.close()
Let o_file =Null
Let o_system =Null
EndFunction
Int Function AppendStringToFile (string S_Text, string S_File)
; *** this function *ONLY* appends to already existing files. use 
; WriteFileFromString to create the file
; each append adds to the previous record without line breaks etc
Var
Object Null,
Object o_system,
Object o_file
Let o_system =ObjectCreate("Scripting.FilesystemObject")
Let o_file =o_system.OpenTextFile (s_file, 8, 0)
o_file.write (s_text)
o_file.close()
Let o_file =Null
Let o_system =Null
EndFunction