• Welcome to Valhalla Legends Archive.
 

How Would I make a Command Queue?

Started by TriCk, May 26, 2003, 01:48 AM

Previous topic - Next topic

TriCk

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.

TriCk

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.

TriCk

is SendQueue transferrable to CSB ?

______

#5
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.

TriCk

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 ...

______

#7
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.

TriCk

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

TriCk

Would where CleanSlateBot1.Send "/ban " etc....

Be

CleanSlateBot1.Send LQueMsg.AddItem   then something here i dont know what though ....   :-X

TriCk

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.

TriCk

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