VERSION 5.00
Begin VB.Form frmGreeting 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Greeting/Farewell"
   ClientHeight    =   6360
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   5535
   Icon            =   "frmGreeting.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6360
   ScaleWidth      =   5535
   StartUpPosition =   2  'CenterScreen
   Begin VB.ListBox List2 
      BackColor       =   &H8000000F&
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   900
      ItemData        =   "frmGreeting.frx":058A
      Left            =   1320
      List            =   "frmGreeting.frx":05A9
      TabIndex        =   17
      Top             =   4680
      Width           =   4095
   End
   Begin VB.ListBox List1 
      BackColor       =   &H8000000F&
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   900
      ItemData        =   "frmGreeting.frx":06AD
      Left            =   1320
      List            =   "frmGreeting.frx":06D5
      TabIndex        =   16
      Top             =   1800
      Width           =   4095
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3000
      TabIndex        =   15
      Top             =   5880
      Width           =   1095
   End
   Begin VB.TextBox txtFarewell 
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   915
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   11
      Top             =   3720
      Width           =   4095
   End
   Begin VB.CheckBox chkFarewell 
      Height          =   255
      Left            =   1320
      TabIndex        =   10
      Top             =   3360
      Width           =   255
   End
   Begin VB.TextBox txtGreeting 
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   915
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   2
      Top             =   840
      Width           =   4095
   End
   Begin VB.CommandButton cmdSave 
      Caption         =   "Save"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4200
      TabIndex        =   1
      Top             =   5880
      Width           =   1215
   End
   Begin VB.CheckBox chkGreet 
      Height          =   255
      Left            =   1320
      TabIndex        =   0
      Top             =   480
      Width           =   255
   End
   Begin VB.Label Label6 
      Alignment       =   1  'Right Justify
      Caption         =   "(when a user enters the channel)"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   2040
      TabIndex        =   14
      Top             =   120
      Width           =   3375
   End
   Begin VB.Label Label5 
      Alignment       =   1  'Right Justify
      Caption         =   "(when a user leaves the channel)"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   2040
      TabIndex        =   13
      Top             =   3000
      Width           =   3375
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Variables:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   4
      Left            =   240
      TabIndex        =   12
      Top             =   4680
      Width           =   870
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Variables:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   3
      Left            =   240
      TabIndex        =   9
      Top             =   1800
      Width           =   870
   End
   Begin VB.Line Line2 
      X1              =   0
      X2              =   5520
      Y1              =   5760
      Y2              =   5760
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "Farewell:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   240
      Index           =   0
      Left            =   120
      TabIndex        =   8
      Top             =   3000
      Width           =   1005
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Message:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   2
      Left            =   240
      TabIndex        =   7
      Top             =   3720
      Width           =   810
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Enabled:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   1
      Left            =   240
      TabIndex        =   6
      Top             =   3360
      Width           =   750
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "Greeting:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   240
      Index           =   4
      Left            =   120
      TabIndex        =   5
      Top             =   120
      Width           =   1005
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Message:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   19
      Left            =   240
      TabIndex        =   4
      Top             =   840
      Width           =   810
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Enabled:"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   0
      Left            =   240
      TabIndex        =   3
      Top             =   480
      Width           =   750
   End
   Begin VB.Line Line1 
      X1              =   0
      X2              =   5520
      Y1              =   2880
      Y2              =   2880
   End
End
Attribute VB_Name = "frmGreeting"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public ProfileName As String
Public BotIndex As Integer

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdSave_Click()
    Dim F As String
    F = AppData & "Profiles\" & ProfileName & ".ini"
    Open F For Append As #1: Close #1
    WriteIni F, "Greeting", "Greeting", YesNo(chkGreet.value = vbChecked)
    WriteIni F, "Greeting", "Message", Replace$(txtGreeting.text, vbNewLine, vbNullString)
    WriteIni F, "Farewell", "Farewell", YesNo(chkFarewell.value = vbChecked)
    WriteIni F, "Farewell", "Message", Replace$(txtFarewell.text, vbNewLine, vbNullString)
    frmBot.Bot(BotIndex).Config.Greet = (chkGreet.value = vbChecked)
    frmBot.Bot(BotIndex).Config.GreetMessage = Replace$(txtGreeting.text, vbNewLine, vbNullString)
    frmBot.Bot(BotIndex).Config.Farewell = (chkFarewell.value = vbChecked)
    frmBot.Bot(BotIndex).Config.FarewellMessage = Replace$(txtFarewell.text, vbNewLine, vbNullString)
    Unload Me
End Sub

Public Sub ShowGreet()
    chkGreet.value = IIf(frmBot.Bot(BotIndex).Config.Greet, vbChecked, vbUnchecked)
    txtGreeting.text = frmBot.Bot(BotIndex).Config.GreetMessage
    chkFarewell.value = IIf(frmBot.Bot(BotIndex).Config.Farewell, vbChecked, vbUnchecked)
    txtFarewell.text = frmBot.Bot(BotIndex).Config.FarewellMessage
End Sub
