Valhalla Legends Forums Archive | Visual Basic Programming | Ban Next User

AuthorMessageTime
Yegg
Im working on adding some useful commands to my bot which runs through CSB, Im trying to get my bot to be able to allow a user to check a checkbox that determines whether the command will be started or not. I want it to ban every user who joins the channel, after the command has been checked.
If anyone needs the code for my userjoins sequence, tell me.
September 7, 2004, 11:57 PM
Quarantine
[code]
'You need to have your checkbox name chkBanOnJoin
'This should go in your On Join Sub.
If chkBanOnJoin.Value = True Then
CleanSlatebot1.Send "/ban "+ Username + " On-Join Ban"
ElseIf chkBanOnJoin.Value = False Then
'
End If
[/code]
September 8, 2004, 2:10 AM
Grok
Warrior: Wrong. As has been discussed in the BotDev forum many times over the years, you should not let user-generated events cause your bot to respond with flood-penalized sequences. A user joining the channel would then cause your bot to attempt to ban it instantly. A few of those at once and your bot will flood-disconnect.

Instead, send everything to one or more queues, by priority. Let your bot manage what gets sent and when, in the queue logic and timing. This way you can implement a flood-prevention algorithm.
September 8, 2004, 3:11 AM
l2k-Shadow
Grok is right of course, however, since Yegg is making a bot with CSB, it means that he must not be a very experienced programmer and probably would not know how to make a queue and an anti-flood function.

(Sorry if this offended anyone or if I misjudged you, Yegg, I was just stating what I thought on the matter)
September 9, 2004, 7:34 PM
Quarantine
Hmm alright thanks for the info.
September 10, 2004, 12:41 AM
LivedKrad
It's just a matter of determining what usernames you feel should be banned first upon joining the channel. First you may want to have a listbox, along with a timer control. When of course you receive the "UserJoin" event, add the name (by given priority or what have you), to this listbox. The timer can be randomly fire or a set time, (queue). When this timer event is fired, simply activate code to "/ban " the top most user of the listbox, and then remove it.

[code]
(OnUser)
List1.AddItem CleanSlateBot1.Usernamer '(I think that's the property used?)

'----
Private Sub Form1_Timer1()
CleanSlateBot1.Send "/ban " & List1.List(0)
List1.RemoveItem 0
End Sub
[/code]

Possibly something to that effect. I hope that helped. Remember though, timers are done in milliseconds. Meaning 1000ms = 1 second.
September 11, 2004, 1:09 AM
Dyndrilliac
Using a collection or array would be better.

[code]Public BanQueue(100) As String[/code]

And I believe for the built in CSB OnJoin Event handler there is a locally declared username variable, that is filled in automatically.
September 14, 2004, 3:10 AM
Yegg
Ok, i got it to work with a timer, and it adds usernames to a listbox, and it every 5 seconds, bans the item at the top, but i cant seem 2 correctly remove the item, im doing lstBan.RemoveItem 0 and i tried a few other ways, but it never seems to work, i get either a runtime error or it keeps on banning the item thats in the listbox, can ne1 help me with this?
September 22, 2004, 4:58 PM
Yegg
Ok, nvm i figured it out.
September 22, 2004, 9:20 PM
CrAz3D
I do believe that collections were shown to pwn arrays

[quote author=Adron link=board=31;threadid=5914;start=15#msg51211 date=1080081238][/quote]
There is the link to Adron's test/message
September 22, 2004, 11:39 PM

Search