I'm trying to build a command database
I have a forum called frmUSERDATABASE where it reads off a listview
but I can't see to get vaccess to work properly, the bot completely ignores it. Any input would be appreciated, here's the code;
Dim vaccess As String
Dim vname As String
n = frmUSERDATABASE.UDBLISTVIEW.List(ax)
Dim string2() As String
string2 = Split(n, " ")
vaccess = string2(1)
vname = string2(2)
If LCase(Username) = vname And AntiF < 3 Then
AntiF = AntiF + 1
End If
If vaccess > 9 Then ' access 10 +
If Message = frmSettings.txtbottrigger & "ver" Then
Send "TEST"
End If
End If
You're missing some declares.
You're also using a form-based [listview] system instead of class-based [array].
Quote from: R.a.B.B.i.T on December 27, 2004, 11:05 PM
You're also using a form-based [listview] system instead of class-based [array].
Not good programming practice; I know VB doesn't encourage GOOD programming, but you should keep your data and your presentation separate, not intertwined.
Quote from: TooLZ on December 27, 2004, 10:12 AM
I'm trying to build a command database
I have a forum called frmUSERDATABASE where it reads off a listview
but I can't see to get vaccess to work properly, the bot completely ignores it. Any input would be appreciated, here's the code;
Dim vaccess As String
Dim vname As String
n = frmUSERDATABASE.UDBLISTVIEW.List(ax)
Dim string2() As String
string2 = Split(n, " ")
vaccess = string2(1)
vname = string2(2)
If LCase(Username) = vname And AntiF < 3 Then
AntiF = AntiF + 1
End If
If vaccess > 9 Then ' access 10 +
If Message = frmSettings.txtbottrigger & "ver" Then
Send "TEST"
End If
End If
Don't use strings in mathematical expressions/equations. If you absolutely must, make the string completely numerical (so it passes true on the IsNumeric() function), and then convert it to the proper format. Since it appears that you want to use a small Integer, use CInt().
Use "Option Explicit" and the top of every parent object (form, module, class, etc) to avoid not declaring variables.
You should create a user-defined type, and then create an array of that type and use it as your userlist.
Also, when doing the command parsing, use Select Case to iterate through the commands.
I wrote a some code for a UserDB though not complete try using Search