I don't know exactly if you had posted all your code or not but you can try something like this, I wrote out some functions and remodified a few things, maybe you can work with it.
Rem PLUGIN: PLUGINAREA7
'Variables declared with Dim at the script level are available to all procedures within the script.
Dim LastIdleResponse, AutoChatStatus, IdleUserName, IdleComputerName, WinDirD, Blank
'Our Functions:
LastIdleResponse = LIR() 'Now
IdleUserName = IUN(UserName) 'User's Name
IdleComputerName = ICN(ComputerName) 'Computer Name
Blank = RIV() 'Reset Internal Variable.
WinDirD = IdleWD(IdleXDir) 'Custom Directory
REM PLUGIN: MINUTE_TIMER
If LastIdleResponse <> 0 Then
AutoChatStatus = AutoChatStatus + 1
If autochatstatus = 5 Then
IdleResponse = "Test Number 1 The Auto chat count is = " & autochatstatus & vbCrLf
IdleResponse2 = "Test Number 1 The Auto chat count is = " & autochatstatus & vbCrLf
HalMenu.HalCommand "<SPEAK>" & IdleResponse & "</SPEAK>"
HalBrain.AppendFile WinDirD & "AutoChat_Log.txt", Trim(IdleResponse2)
End If
Rem PLUGIN: FUNCTIONS
'Function: Custom Directory
Function IdleWD(IdleXDir)
IdleXDir = "D:\Ultra Hal Assistant 6\"
IdleWD = IdleXDir
End Function
'Function: Now, 'L_ast I_dle R_esponse'
Function LIR()
LIR = Now
End Function
'Function: User's Name, 'I_dle U_ser N_ame'
Function IUN(UserName)
IUN = UserName
End Function
'Function: Computer's Name, I_dle C_omputers N_ame
Function ICN(ComputerName)
ICN = ComputerName
End Function
'Function: R_eset I_nternal V_ariable
Function RIV()
RIV = ""
End Function
Hint: When posting Directories in this forum use double back slashes so the back slashes will show in your post, Single Back Slashes are filtered out.
Jerry[8D]