• Welcome to Valhalla Legends Archive.
 

Removing things from a listbox

Started by Blaze, May 18, 2004, 07:34 AM

Previous topic - Next topic

Blaze

Private Sub QueTimer_Timer()

Dim RemoveItem As String
If Que.ListCount = "0" Then
QueTimer.Interval = QueTimer.Interval - 300
End If

If Que.ListCount =>1 Then
Main.CleanSlateBot1.Send Que.List(0)
Que.RemoveItem Que.List(0)
QueTimer.Interval = QueTimer.Interval + 300
End If

If QueTimer.Interval < 1000 Then
QueTimer.Interval = 1000
End If

If QueTimer.Interval > 15000 Then
QueTimer.Interval = 15000
End If

If Que.ListCount > 30 Then
AddChat "Queue Cleared" & vbNewLine, vbRed
Que.Clear
End If
End Sub


That is my code for my que timer and its being evil. I really don't know how to use listboxs because I never use them... It keeps giving me an error on this line...


Que.RemoveItem Que.List(0)
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Insecure

If you posted this on the vb section you might get more responces but...

As far as I know for a listbox to remove it you need to que.remove (i).

(If I am wrong I am sorry...pain pills are fun to have because I can't remember much)

Eli_1

#2
que.Remove takes in an integer as it's parameter, and your giving it a string.

Try

que.Remove 0



On a side note, your TAB key is dieing for some attention. :(

BinaryzL

Unfixed code but "formatted".

Private Sub QueTimer_Timer()
Dim RemoveItem As String
   
   If Que.ListCount = "0" Then
       QueTimer.Interval = QueTimer.Interval - 300
   End If
   
   If Que.ListCount >= 1 Then
       Main.CleanSlateBot1.Send Que.List(0)
       Que.RemoveItem Que.List(0)
       QueTimer.Interval = QueTimer.Interval + 300
   End If
   
   If QueTimer.Interval < 1000 Then
       QueTimer.Interval = 1000
   End If
   
   If QueTimer.Interval > 15000 Then
       QueTimer.Interval = 15000
   End If
   
   If Que.ListCount > 30 Then
       AddChat "Queue Cleared" & vbNewLine, vbRed
       Que.Clear
   End If
End Sub

Blaze

#4
Quote from: Eli_1 on May 18, 2004, 09:48 AM
On a side note, your TAB key is dieing for some attention. :(

Actually I removed the tab space entries when adding my code here...


I think my code is working because its been saying hello all day without getting kicked...
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

FuzZ

Quote from: Blaze on May 18, 2004, 02:39 PM
Quote from: Eli_1 on May 18, 2004, 09:48 AM
On a side note, your TAB key is dieing for some attention. :(

Actually I removed the tab space entries when adding my code here...


I think my code is working because its been saying hello all day without getting kicked...
sure you're not muted? :P

Blaze

Yes because my my other bot picked up all the chating...

Now I have to find a way to make it display the text when it is sent rather then when it is typed and entered...
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Eli_1

Quote from: Blaze on May 18, 2004, 06:58 PM
Yes because my my other bot picked up all the chating...

Now I have to find a way to make it display the text when it is sent rather then when it is typed and entered...

You might be able to use Socket_SendComplete(), then again you might not...

MyndFyre

off-topic....

Mahaha, the first thing I thought of when I saw the title was....


ListBox1.Remove(things)


8)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Lenny

You should really use arrays to store your queue, especially if you're not displaying the listbox....

Also, the queue also depends on the size of the message, not just how many messages in an interval...

Quote
Now I have to find a way to make it display the text when it is sent rather then when it is typed and entered...

That's just a matter of how you send text, the Send function should both add the text to the display and actually send the data to battle.net...This function would be called every time the queue function has passed....
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.