Valhalla Legends Forums Archive | Battle.net Bot Development | Need some help

AuthorMessageTime
TooLZ
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;

[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[/code]
December 27, 2004, 4:12 PM
hismajesty
You're missing some declares.
December 27, 2004, 6:38 PM
R.a.B.B.i.T
You're also using a form-based [listview] system instead of class-based [array].
December 28, 2004, 5:05 AM
Myndfyr
[quote author=R.a.B.B.i.T link=topic=10028.msg93693#msg93693 date=1104210333]
You're also using a form-based [listview] system instead of class-based [array].
[/quote]

Not good programming practice; I know VB doesn't encourage GOOD programming, but you should keep your data and your presentation separate, not intertwined.
December 28, 2004, 8:59 AM
Dyndrilliac
[quote author=TooLZ link=topic=10028.msg93632#msg93632 date=1104163973]
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;

[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[/code]
[/quote]

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.
December 28, 2004, 10:18 AM
Quarantine
I wrote a some code for a UserDB though not complete try using Search
December 28, 2004, 4:37 PM

Search