Zabaware Support Forums

What's hal having for lunch patched for 5.0

Started by lostbowyer, September 15, 2003, 11:12:33 AM

Previous topic - Next topic

lostbowyer

The what is for lunch script if not placed before the greeting routine was causing hal to go into a locked joke mode and he would ignore greetings. I've fixed the script so it will work with the 5 beta without any problems. I'm attaching another meals file which has lunch and dinner selections for the whole week, edit as you see fit.

'What's for lunch
   If InStr(1, UserSentence, " WHAT AM I HAVING FOR LUNCH ", 1) > 0 Then
      MyMealz = "lunch"
      GetResponse = ""
   End If
   If MyMealz = "lunch" And Hour(Time) > 12 Then
      MyMealz = "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 MyMealz =

"dinner"
   If MyMealz = "lunch" Or MyMealz = "dinner" Then
      RandomMealz = Int((Rnd * 10))
      BlockSave = True
      MyMealz = WeekdayName(Weekday(Date),True) & MyMealz & RandomMealz
      Timeday = Hour(Time)
      HalUserBrain = HalBrain.QABrain(MyMealz, WorkingDir & "Meals" & ".brn", UserBrainRel)
      GetResponse = GetResponse & HalUserBrain & vbCrLf
      GetResponse = HalBrain.HalFormat(GetResponse)
   End If


Download Attachment: Meals.brn
9.23 KB