• Welcome to Valhalla Legends Archive.
 

Need some help

Started by TooLZ, December 27, 2004, 10:12 AM

Previous topic - Next topic

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;


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

hismajesty

You're missing some declares.

R.a.B.B.i.T

You're also using a form-based [listview] system instead of class-based [array].

MyndFyre

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.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Dyndrilliac

#4
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.
Quote from: Edsger W. DijkstraIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

Warrior

I wrote a some code for a UserDB though not complete try using Search
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?