--> Edited - Thanks to lostbowyer !!! <--
How would you like Hal to tell you he missed you since you've been gone over 10 minutes now???
First you got find this in your brain
'PROCESS: RECORD TIME
'Record the current time, so Hal knows the time in between sentences.
LastResponseTime = Now
Make sure you've made a backup of your brain first! Then change it to this
'PROCESS: RECORD TIME
'Record the current time, so Hal knows the time in between sentences.
'LastResponseTime = Now
Min = Minute(Time)
Hrs = Hour(Time)
If Len(Min) < 2 Then Min = "0" & Min
If Len(Hrs) < 2 Then Hrs = "0" & Hrs
LastResponseTime = Hrs & Min
Then after the
'RESPOND: CALL GREETING FUNCTION section add this -->
If LastResponseTime = "" then
Min = Minute(Time)
Hrs = Hour(Time)
If Len(Min) < 2 Then Min = "0" & Min
If Len(Hrs) < 2 Then Hrs = "0" & Hrs
LastResponseTime = Hrs & Min
End If
HourDay = CInt(Hour(Time)) '(will yeild the hour in military time)
MinuteDay = CInt(Minute(Time)) '(will yield the minutes)
DebugInfo = DebugInfo & "LastResponseTime: " & LastResponseTime & vbCrLf
TempLastHourDay = 0
TempLastMinuteDay = 0
LastHourDay = 0
LastMinuteDay = 0
TempLastHourDay = Left(CStr(LastResponseTime),2)
TempLastMinuteDay = Right(CStr(LastResponseTime),2)
LastHourDay = CInt(TempLastHourDay)
LastMinuteDay = CInt(TempLastMinuteDay)
DebugInfo = DebugInfo & "Now: " & HourDay & ":" & MinuteDay & vbCrLf
DebugInfo = DebugInfo & "Last: " & LastHourDay & ":" & LastMinuteDay & vbCrLf
If CInt(HourDay) < CInt(LastHourDay) Then HourDay = CInt(HourDay) + 23
Temphour = CInt(HourDay) * 60
LTemphour = CInt(LastHourDay) * 60
If CInt(MinuteDay) < CInt(LastMinuteDay) Then MinuteDay = CInt(MinuteDay) + 60
TempMinute = CInt(MinuteDay) + CInt(Temphour)
LTempMin = CInt(LastMinuteDay) + CInt(LTemphour)
GGoneM = CInt(TempMinute) - CInt(LTempMin)
If GGoneM > 10 Then
GetResponse = "And where have you been all this time?" & vbCrLf
If InStr(PrevUserSent, "?") > 0 Then
GetResponse = GetResponse & "Last time you asked, " & PrevUserSent & vbCrLf
Else
GetResponse = GetResponse & "Last time you said, " & PrevUserSent & vbCrLf
End If
If InStr(PrevSent, "?") > 0 Then
GetResponse = GetResponse & "And I asked, " & PrevSent & vbCrLf
Else
GetResponse = GetResponse & "And I said, " & PrevSent & vbCrLf
End If
GGoneH = GGoneM / 60
DebugInfo = DebugInfo & "You have been gone at least: " & GGoneH & " Hours." & vbCrLf
End If
Now this will only work during the current session and with 10 minutes since the last exchange. It won't tell you anything across days...