VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmIdle 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "Idle Settings"
   ClientHeight    =   4200
   ClientLeft      =   45
   ClientTop       =   405
   ClientWidth     =   5415
   BeginProperty Font 
      Name            =   "Verdana"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmIdle.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4200
   ScaleWidth      =   5415
   StartUpPosition =   2  'CenterScreen
   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
      Height          =   900
      ItemData        =   "frmIdle.frx":058A
      Left            =   1320
      List            =   "frmIdle.frx":05A3
      TabIndex        =   10
      Top             =   2520
      Width           =   3975
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "Cancel"
      Height          =   375
      Left            =   2880
      TabIndex        =   9
      Top             =   3720
      Width           =   1095
   End
   Begin VB.CheckBox chkIdle 
      Height          =   255
      Left            =   1320
      TabIndex        =   8
      Top             =   480
      Width           =   255
   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            =   4080
      TabIndex        =   6
      Top             =   3720
      Width           =   1215
   End
   Begin VB.TextBox txtIdle 
      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          =   1155
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   5
      Top             =   1320
      Width           =   3975
   End
   Begin MSComctlLib.Slider sldIdle 
      Height          =   375
      Left            =   1200
      TabIndex        =   3
      Top             =   840
      Width           =   4095
      _ExtentX        =   7223
      _ExtentY        =   661
      _Version        =   393216
      LargeChange     =   1
      Min             =   1
      Max             =   60
      SelStart        =   1
      TickStyle       =   3
      Value           =   1
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Variables:"
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   1
      Left            =   240
      TabIndex        =   11
      Top             =   2520
      Width           =   870
   End
   Begin VB.Label lblIdle 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      Caption         =   "1 minute"
      Height          =   195
      Left            =   4440
      TabIndex        =   4
      Top             =   600
      Width           =   750
   End
   Begin VB.Line Line1 
      X1              =   0
      X2              =   5400
      Y1              =   3600
      Y2              =   3600
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Enabled:"
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   0
      Left            =   240
      TabIndex        =   7
      Top             =   480
      Width           =   750
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Message:"
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   19
      Left            =   240
      TabIndex        =   2
      Top             =   1320
      Width           =   810
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Interval:"
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   18
      Left            =   240
      TabIndex        =   1
      Top             =   840
      Width           =   750
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "Idle:"
      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        =   0
      Top             =   120
      Width           =   495
   End
End
Attribute VB_Name = "frmIdle"
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, "Idle", "Time", sldIdle.value
    WriteIni F, "Idle", "Idle", YesNo(chkIdle.value = vbChecked)
    WriteIni F, "Idle", "Message", Replace$(txtIdle.text, vbNewLine, vbNullString)
    
    frmBot.Bot(BotIndex).Config.IdleTime = sldIdle.value
    frmBot.Bot(BotIndex).Config.Idle = (chkIdle.value = vbChecked)
    frmBot.Bot(BotIndex).Config.IdleMessage = Replace$(txtIdle.text, vbNewLine, vbNullString)
    Unload Me
End Sub

Public Sub ShowIdle()
    sldIdle.value = frmBot.Bot(BotIndex).Config.IdleTime
    chkIdle.value = IIf(frmBot.Bot(BotIndex).Config.Idle, vbChecked, vbUnchecked)
    txtIdle.text = frmBot.Bot(BotIndex).Config.IdleMessage
    sldIdle_Scroll
End Sub

Private Sub sldIdle_Click()
    sldIdle_Scroll
End Sub

Private Sub sldIdle_Scroll()
    If sldIdle.value = 1 Then
        lblIdle = "1 minute"
    Else
        lblIdle = sldIdle.value & " minutes"
    End If
End Sub
