• Welcome to Valhalla Legends Archive.
 

User access for Commands

Started by ObJeCtiVe, June 09, 2003, 07:36 PM

Previous topic - Next topic

ObJeCtiVe

Hi, im new here, and I need some help... I need help on VB, I am making a bot, pure Ops control, I need some help with The accesses
I would want to make a bot with only 2 access ranks, Master and Leader. and I have No clue where to start. and How to make the commands only work for Master, and the rest for leader. Anythiing will help.

RhiNo

Quote from: ObJeCtiVe on June 09, 2003, 07:36 PM
Hi, im new here, and I need some help... I need help on VB, I am making a bot, pure Ops control, I need some help with The accesses
I would want to make a bot with only 2 access ranks, Master and Leader. and I have No clue where to start. and How to make the commands only work for Master, and the rest for leader. Anythiing will help.

just a suggesetion get the book Visual Basic 6 for windows by harold davis pretty easy to learn from and shows u database controls its a great help for beginers and for refrence. or look online for tutorials/refrences

ObJeCtiVe

Yeah thanks, i got that part down
But not i got another prob,
I have Flood protection and so on
But the only time it will work is when its activated befor the flooding happens, IE Im in the channel and then a flood comes and i turn on flood proection, it dont ban, but if i reconnect and turn it on befor the next one comes in it works. any ideas for this?

WiLD

Just a though, do you have a queue? if so try clear queue, it might be trying to ban the first floodbot but since its not on it moves to the seconds and so on, this will cause it to try and ban the ones that arnt online.... just a though
=_=  &&  g0dFraY  &&  -=Templar=-  @USWest

Eternal

#4
Quote from: ObJeCtiVe on June 11, 2003, 06:53 PM
Yeah thanks, i got that part down
But not i got another prob,
I have Flood protection and so on
But the only time it will work is when its activated befor the flooding happens, IE Im in the channel and then a flood comes and i turn on flood proection, it dont ban, but if i reconnect and turn it on befor the next one comes in it works. any ideas for this?

Sounds like something in your code is not activating flood protection properly. It's hard to comment without seeing it. All I can really say is read it line by line and see exactly what it is doing. Look at it when you turn on and off the protection and what happens when a user joins the channel (which may be calling a separate function).
^-----silly Brit
-----------------------------
www.brimd.com

UnkNOwN..MaN.

well first of all you gana have to put this in da moddel.  you gana have to make a AccessList.ini (config) thing that will go where ur bot goes and put htis code in a model

Function RetrieveAccess(appname As String, key As String) As String
Dim sFile As String
Dim sDefault As String
Dim lSize As Integer
Dim L As Long
Dim sUser As String
sUser = Space$(128)
lSize = Len(sUser)
sFile = App.Path & "\AccessList.ini" 'ini is config settings
sDefault = ""
L = GetPrivateProfileString(appname, key, sDefault, sUser, lSize, sFile)
sUser = Mid(sUser, 1, InStr(sUser, Chr(0)) - 1)
RetrieveAccess = sUser
End Function

then your gana have to make cmds have like a "access=m then" for cmds for master access and so on and so on, i'm to lazy t type it all up. cya

UserLoser

#6
You could do something with flags/numbers [for access], and a listview to hold the database in, here's a simple example...

Make a LoadDatabase() sub like this...


Public Sub LoadDatabase()
Open app.path & "\Database.txt" for Input as #1
    Do Until EOF(1)
         Line Input #1, strTemp
              Splt() = Split(strTemp, " ")
                   With SomeListview
                        .ListItems.Add , , Splt(0) 'Username
                        .ListItems(.ListItems.Count).Tag = Splt(1) 'User's Flags
                   End With
    Loop
Close #1
End Sub


That would load the database into a listview, assuming that the database is stored in <name> <flags> format in Database.txt

For commands, you could do something like this....


Sub ProcessCommand(ByVal Username as String, ByVal Message as String)
For I = 1 to SomeListView.ListItems.Count
    If LCase(SomeListView.ListItems(I).text) = LCase(Username) Then Found = True: Exit For
Next I
If Not Found Then Exit Sub

BlahBlahBlah command code here...

End Sub