VERSION 5.00
Begin VB.Form frmCreateClan 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "Create Clan"
   ClientHeight    =   4815
   ClientLeft      =   45
   ClientTop       =   420
   ClientWidth     =   3975
   BeginProperty Font 
      Name            =   "Verdana"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmCreateClan.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4815
   ScaleWidth      =   3975
   StartUpPosition =   2  'CenterScreen
   Begin VB.Frame fraFind 
      Caption         =   "Step 1: Find Candidates"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   4575
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   3735
      Begin VB.CommandButton cmdFindCandidates 
         Caption         =   "Continue..."
         Height          =   375
         Left            =   2280
         TabIndex        =   7
         Top             =   4080
         Width           =   1335
      End
      Begin VB.TextBox txtTag 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   120
         MaxLength       =   4
         TabIndex        =   6
         Top             =   2280
         Width           =   975
      End
      Begin VB.TextBox txtName 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   120
         TabIndex        =   5
         Top             =   1560
         Width           =   3495
      End
      Begin VB.Label Label2 
         Caption         =   "Clan tag:"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   4
         Top             =   2040
         Width           =   1335
      End
      Begin VB.Label Label2 
         Caption         =   "Clan name:"
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   3
         Top             =   1320
         Width           =   1335
      End
      Begin VB.Label Label1 
         Caption         =   $"frmCreateClan.frx":058A
         Height          =   855
         Left            =   120
         TabIndex        =   2
         Top             =   360
         Width           =   3495
      End
   End
   Begin VB.Frame fraInvite 
      Caption         =   "Step 2: Invite Candidates"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   4575
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   3735
      Begin VB.CommandButton cmdInviteCandidates 
         Caption         =   "Continue..."
         Height          =   375
         Left            =   2280
         TabIndex        =   11
         Top             =   4080
         Width           =   1335
      End
      Begin VB.CheckBox chkAll 
         Caption         =   "Check all"
         Height          =   255
         Left            =   120
         TabIndex        =   10
         Top             =   4080
         Width           =   1335
      End
      Begin VB.ListBox lstCandidates 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   3120
         Left            =   120
         Style           =   1  'Checkbox
         TabIndex        =   8
         Top             =   840
         Width           =   3495
      End
      Begin VB.Label Label3 
         Caption         =   "Select the users you would like to invite to create the clan."
         Height          =   495
         Left            =   120
         TabIndex        =   9
         Top             =   360
         Width           =   3495
      End
   End
End
Attribute VB_Name = "frmCreateClan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public BotIndex As Integer

Private Sub chkAll_Click()
    Dim I As Integer
    For I = 0 To lstCandidates.ListCount - 1
        lstCandidates.Selected(I) = (chkAll.value = vbChecked)
    Next I
End Sub

Private Sub cmdFindCandidates_Click()
    If LenB(txtTag.text) = 0 Then MsgBox "Invalid clan tag entered!", vbExclamation: Exit Sub
    If LenB(txtName.text) = 0 Then MsgBox "Please enter a name for the clan!", vbExclamation: Exit Sub
    frmBot.Bot(BotIndex).SendClanFindCandidates txtTag.text
End Sub

Private Sub cmdInviteCandidates_Click()
    Dim CandList() As String, Count As Integer, I As Integer
    ReDim CandList(0)
    For I = 0 To lstCandidates.ListCount - 1
        If lstCandidates.Selected(I) Then
            ReDim Preserve CandList(Count)
            CandList(Count) = lstCandidates.List(I)
            Count = Count + 1
        End If
    Next I
    frmBot.Bot(BotIndex).SendClanInviteMultiple txtName.text, txtTag.text, CandList
    Unload Me
End Sub

Private Sub Form_Load()
    frmCreateClan.fraFind.Visible = True
    frmCreateClan.fraInvite.Visible = False
End Sub
