• Welcome to Valhalla Legends Archive.
 

Channel Password Help [VB]

Started by Sonic, March 01, 2004, 05:17 PM

Previous topic - Next topic

Sonic

How good of an idea is this? I know it was used in many older bots..but is it still of any use? If it is I'm going to implement it.

I'm not sure how to make sure the person sends the password within 10 seconds and then ban them if they don't. I already have it set to turn it on/off/set pass/whisper user when they join. Is there a way to do this without using a listview/box? And even a timer. I had planned on just checking the password but then I realized that they could sit in there and not whisper me. Would it be better to just check if what they send either in normal text/whisper/and emote? And if that doesn't equal the password then ban them?

Eric

#1
Personally, I find channel passwords are useless except in clan channels.

Here's one way to do it:
1.) Store your password as a string.
2.) Create a timer with indexing.
3.) For every user that enters and/or requests to enter, create a new index for the timer and set it for 10 seconds; store the username in the timers Tag.
4.) If the user inputs the password, disable and unload the timer.
5.) When the timer runs out, unload the timer, and check to see if the user has inputted the password yet, if not, or if it's incorrect, ban the user and/or deny the user of entering.

Sonic

I've never used timer.index, do you have any examples?

Eli_1

Quote from: Sonic on March 01, 2004, 06:05 PM
I've never used timer.index, do you have any examples?
I'll assume your using Timer1 for this example

Set Timer1's index value to 0 at design time
Then when a user joins the channel you could do something like


Load Timer1(Timer1.UBound + 1)
With Timer1(Timer1.UBound)
    .Interval = 10000
    .Tag = Username
    .Enabled = True
End With


This is far less than you need... but it should be enough for you to get started