Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: ColT on September 24, 2004, 10:30 PM

Title: Help
Post by: ColT on September 24, 2004, 10:30 PM
Can someone help me make a database/access, and how to make commands. Thanks. Btw: This is in Visual Basic.
Title: Re:Help
Post by: Spht on September 24, 2004, 10:41 PM
Quote from: ColT on September 24, 2004, 10:30 PM
Can someone help me make a database/access, and how to make commands. Thanks. Btw: This is in Visual Basic.

You might want to search Google first, to get started.  What you're asking sounds pretty general and non-botdev-specific.  If you have a specific question later on, then feel free to ask.
Title: Re:Help
Post by: ColT on September 24, 2004, 10:46 PM
Ok. Thanks by the way Spht.
Title: Re:Help
Post by: MyndFyre on September 26, 2004, 08:35 AM
Quote from: titan0060 on September 26, 2004, 06:36 AM
a pretty good way to learn about access lists and stuff is to look at other people sources.

Goto this site and look under downloads.  I'm download admin there and there are like 70 sources u can look at.
http://bnetweb.com

No, a good way to learn about access lists is to think about how you want to structure yours, then apply your knowledge into creating one from scratch.  Looking at other's sources is an efficient way of encouraging oneself to copy them and then not understanding them later.
Title: Re: Help
Post by: Michael on September 28, 2004, 06:34 PM
ya, i would suggest something simple,  make a file put name access then make a code that opens the file and checks for user access.
example

public access as string
public sub loaddb(user as string)
dim info as string
dim split() as string
open app.path & "/database.txt" for input as #1
input #1, info
split(lcase(info), " ", 1)
if split(0) = lcase(name) then
access = lcase(split(1))
end if
close #1
end sub

Title: Re: Help
Post by: Minux on September 28, 2004, 07:04 PM
Quote from: -MichaeL- on September 28, 2004, 06:34 PM
ya, i would suggest something simple,  make a file put name access then make a code that opens the file and checks for user access.
example

public access as string
public sub loaddb(user as string)
dim info as string
dim split() as string
open app.path & "/database.txt" for input as #1
input #1, info
split(lcase(info), " ", 1)
if split(0) = lcase(name) then
access = lcase(split(1))
end if
close #1
end sub



Nah, use a function with a loop inside. For example


Public Function CheckAccess(Username As String, byRef Access As Integer)

Close #1

Dim Temp As String

Access = 0

Open App.Path & "/database.txt" For Input As #1

Do While Not EOF(1)

Input #1, Temp

If LCase(Split(Temp, " ")(0)) = LCase(Username) Then
Access = Split(Temp, " ")(1)
Exit Function
End If

Loop

Close #1

End Function


And when you call the function just do something along these lines.


CheckAccess(strUsername As String, strAccess As String)

And strAccess will obtain the value of the user's access if found, otherwise it will be 0.
Title: Re: Help
Post by: Michael on September 29, 2004, 03:54 PM
Whoops forgot the loop he sorry about that. hope i helped tho.