• Welcome to Valhalla Legends Archive.
 

Ban Next User

Started by Yegg, September 07, 2004, 06:57 PM

Previous topic - Next topic

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.

Warrior

#1

'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
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?

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.

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)
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Warrior

Hmm alright thanks for the info.
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?

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.


(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


Possibly something to that effect. I hope that helped. Remember though, timers are done in milliseconds. Meaning 1000ms = 1 second.

Dyndrilliac

Using a collection or array would be better.

Public BanQueue(100) As String

And I believe for the built in CSB OnJoin Event handler there is a locally declared username variable, that is filled in automatically.
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.

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?

Yegg

Ok, nvm i figured it out.

CrAz3D

I do believe that collections were shown to pwn arrays

Quote from: Adron on March 23, 2004, 04:33 PM
There is the link to Adron's test/message
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...