I needed to make a slight fix to the script. It has been corrected below.
A slight addition to the script, if you ask hal what he had for lunch and it's after noontime, hal will tell you he's eaten but also tell you what he plans to eat for dinner.
'What's for lunch
If InStr(1, UserSentence, " WHAT AM I HAVING FOR LUNCH ", 1) > 0 Then MyMeal = "lunch"
GetResponse = ""
If MyMeal = "lunch" And Hour(Time) > 12 Then
MyMeal = "dinner"
GetResponse = "I've already eaten lunch, but for dinner, "
End If
If InStr(1, UserSentence, " WHAT AM I HAVING FOR DINNER ", 1) > 0 Then MyMeal = "dinner"
If MyMeal = "lunch" Or MyMeal = "dinner" Then
RandomMeal = Int((Rnd * 10))
MyMeal = WeekdayName(Weekday(Date),True) & MyMeal & RandomMeal
Timeday = Hour(Time)
HalUserBrain = HalBrain.QABrain(MyMeal, WorkingDir & "Meals" & ".brn", UserBrainRel)
GetResponse = GetResponse & HalUserBrain & TimeDay & MyMeal & vbCrLf
GetResponse = HalBrain.HalFormat(GetResponse)
End If
Here is an updated Meals.brn it has the "0" choices added. You still have to customize your food preferences but it is a complete.
Download Attachment: Meals.brn8.78 KB