How would i make a working command queue?
Like when Channel LockDown is on sometimes my bot will flood out from banning username too many times, with this thought i would also like to know how to smartban like if someone joins 9 times ban once.... but i'd like queue first.
I've asked this question a few times but noone has given me much help with it... i need to know how to add them to a queue to be banned and send them every couple of seconds instead of like 10 at a time when my bot fails to ban a flood or mass joins...
sigh....im just gonna shut up now.
The thing is ive looked over most of the other ones... and they use Winsocks
And im using csb...
so some of the stuff doesnt work...
Most of the time it doesnt matter.
is SendQueue transferrable to CSB ?
http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=999
go there i gave some code
just change the list view into a list box and change listitsms(i).text to .list(i)
and Remove(i) when removing them and it should work.
Edit: it should give you an idea of how to do this.
OK 1 question what was easy to fix ???
And something about sending more than 1... Thats not what i want i want it to wait ...
Make a list box name lquemsg
make a timer named que1 give it an interval of 1800
Private Sub Que1_Timer()
Dim quetick1 As Integer
Dim queinterval1 As Integer
queinterval1 = 1800
If LQueMsg.ListCount >= 1 Then
quetick1 = quetick1 + 1
If quetick1 >= queinterval1 Then
Send LQueMsg.List(0), True 'cleanslatebot1.send LQueMsg.List(0)
LQueMsg.RemoveItem (0)
quetick1 = 0
End If
End If
End Sub
thats how i que them when a command is issued like !ver
Lquemsg.additem "version"
but so far as i know of this is not a good way of queueing messages becasues it slower but i dont care it works fine for me.
So i'll need two timers and to Call it in a command like this ban code ...
If Username = Form2.txtMaster Then
If Left((LCase(Message)), 5) = (Form2.txtTrigger.Text & "ban ") Then
Dim bannedname As String
banned2name = Right(Message, (Len(Message) - 5))
Text1.Text = Text1.Text + 1
Dim banCount As String
banCount = Text1.Text
If ProtectedUsers.IsOnList(Username) = True Then
'Don't Ban
Else
'Ban
CleanSlateBot1.Send "/ban " & banned2name & " Jew #" & banCount
End If
End If
End If
Where would it go ???
instead of saying cleanslatebot use Lquemsg.additem "/ban " & banned2name & " Jew #" & banCount
and i said u only need 1 timer for my lquemsg
Would where CleanSlateBot1.Send "/ban " etc....
Be
CleanSlateBot1.Send LQueMsg.AddItem then something here i dont know what though .... :-X
oh that last post was sent before i read ur last one...
ummm
but then how does the Que1_Timer() send the Item ??
under this
Private Sub Que1_Timer()
Dim quetick1 As Integer
Dim queinterval1 As Integer
queinterval1 = 1800
If LQueMsg.ListCount >= 1 Then
quetick1 = quetick1 + 1
If quetick1 >= queinterval1 Then
cleanslatebot1.send LQueMsg.List(0)
LQueMsg.RemoveItem (0)
quetick1 = 0
End If
End If
End Sub
and on your !ban code replace cleanslatebot with lquemsg.additem "ban " etc.
ok..
Its triggering an error on this...
CleanSlateBot1.Send LQueMsg.List(0), True
Quote from: TriCk on May 26, 2003, 02:25 AM
ok..
Its triggering an error on this...
CleanSlateBot1.Send LQueMsg.List(0), True
of course get rid of ,true
i did that ...
but i was wondering if i use & in commands will it still add it all to the list ??
if you mean like
lquemsg.additem "you are " & username & "using " & product
then yes
Ummm
Its enqueueing the commands
But
CleanSlateBot is not sending them....
i made the ListBox visible and its adding them to queue but its not actually sending through csb...
what do u have under Private Sub Que1_Timer()
Private Sub Que1_Timer()
Dim quetick1 As Integer
Dim queinterval1 As Integer
queinterval1 = 1800
If LQueMsg.ListCount >= 1 Then
quetick1 = quetick1 + 1
If quetick1 >= queinterval1 Then
CleanSlateBot1.Send LQueMsg.List(0)
LQueMsg.RemoveItem (0)
quetick1 = 0
End If
End If
End Sub
And ____ do u have AIM or MSN so i dont have to be waiting ages for a reply ...?
2 things 1 did u set the que interval in its proerties to 1800?
2nd put
if cleanslatebot.connected then 'added
If LQueMsg.ListCount >= 1 Then
quetick1 = quetick1 + 1
If quetick1 >= queinterval1 Then
cleanslatebot1.send LQueMsg.List(0)
LQueMsg.RemoveItem (0)
quetick1 = 0
End If
End If
Endif ' added
End Sub
Edit: put this right above cleanslatebot.send
Addtext vbBlue, txtName.Text & ": ", vbWhite, LQueMsg.List(0)
so you can see it
txtname.text is my username on logon change it to whatever fits.
First thing its not removing them...
And its not banning them...
And i just read some of the comments on the other post u gave me earlier it says u used a ListView... I'm using a listbox... should i change to listview ??
Then the way your checking the user is prob somewhat off, this code works fine. for cleanslate bot and winsocks.
' you 5's seem they should be 4's if u have only 1 letter trigger
If Username = Form2.txtMaster Then
If Left((LCase(Message)), 5) = (Form2.txtTrigger.Text & "ban ") Then
Dim bannedname As String
banned2name = Right(Message, (Len(Message) - 5))
Text1.Text = Text1.Text + 1
Dim banCount As String
banCount = Text1.Text
If ProtectedUsers.IsOnList(Username) = True Then
'Don't Ban
Else
'Ban
lquemsg.additem "/ban " & banned2name & " Jew #" & banCount ' this has been added, this hsould work if it worked for cleanslatebot
End If
End If
End If
hmm on ur form2.txtmaster you dont have form2txtmaster.text
shouldnt bancount be dim'ed as an integer?
well they're 5's because i made it "$ban " the space is there because i havent added if User types.. "$ban" then nothin happens coz "$ban" on its own causes the bot to crash ... ??? and it still doesnt work >:(
nvm about the 4's your right about the 5 i missed the space...
the only thing i could see wrong with this is that
If Username = Form2.txtMaster Then
make it
If lcase(Username) = lcase(Form2.txtMaster) Then
nvm i found the problem....
CleanSlateBot1.Send LQueMsg.List(1)
LQueMsg.RemoveItem (0)
u gave me
CleanSlateBot1.Send LQueMsg.List(0)
LQueMsg.RemoveItem (0)
I only just realised that then because i know for a fact that List(0) would select the Zero on the List... which there is none 1 selected Item 1 and RemoveItem(0) removes Item(1)
Thanks ____ for all the help
PS: We got a Very Hot Topic hehe ;D
Later...
-TriCk
np ;D
______ ****
i been callin u ____ soz :P
use the [ code ] tag plz.