• Welcome to Valhalla Legends Archive.
 

safelist problem doh

Started by BlackDeath, September 04, 2003, 04:06 PM

Previous topic - Next topic

BlackDeath

ok im trying to get all safelisted users to list in the channel when doing the command well that all works of course but the problem im having is when there is a few users left in my BreakUpUsrs like 3 out of 5 it wont list them well whatever was left in the BreakUpUsrs

well here is the code


'making sure countme = 0 before starting
CountMe = 0
For i = 1 To Main.SafeList.ListItems.Count
'this keeps adding users from safelist until (countme) hits its limit
BreakUpUsrs = BreakUpUsrs & Main.SafeList.ListItems(i).Text & ", "
'count up until limit hit
CountMe = CountMe + 1
       'if (i) doesnt = the amount if users it will goto else,
       'if (i) does = SafeList.ListItems.Count it will do whatever was left in breakupurs (but its not)
       If (i = Main.SafeList.ListItems.Count) Then
                'this checks to see if anything is left in breakupurs if,               'there is it will do its job if not it will skip it
                If (BreakUpUsrs <= "") Then
                'wait 2 sec to keep from flooding
                Main.Wait 2000
                'sending whats left in breakupurs that = less then 5
                Main.CoWz.Send BreakUpUsrs & " ÿC2[Done..]"
                'erasing breakupurs
                BreakUpUsrs = ""
                'resetting countme
                CountMe = 0
                End If
       Else
               'if countme is = 5 it will send then reset countme to             'do it over again adding rest of users from safelist
                If (CountMe = 5) Then
                'wait 2 sec to keep from flooding
                Main.Wait 2000
                'sending the broken up 5 users
                Main.CoWz.Send BreakUpUsrs & " ÿC2[More..]"
                erasing breakupurs
                BreakUpUsrs = ""
                 'resetting countme
                CountMe = 0
                End If
       End If
Next i


please help or show a better way :P

im still trying to get this on my own but help will
be very greatly apreciated

thanks,

-BlackDeath




[/edited]

ok lets say there is 7 users
jim, mike, joe, sam, josh, bob, steve

in listview

ok so the users got broken up above and then when the countme hits 5 it will send the first 5 users like so

jim, mike, joe, sam, josh,

then the countme gets reset to 0 and breakupurs  cleared to nothing and listview is still going then adds

sam, josh then here is where the problem comes in it wont send the last 2 thats left in breakupurs because countme is waiting to hit 5

Grok

Rephrase your question into actual sentences.  I cannot decipher what you are trying to do, nor the problem you are having.

In the future, indent your code.

Hazard

Capital letters and punctuation are a plus as well.

"Courage is being scared to death - but saddling up anyway." --John Wayne

Soul Taker

Just curious as to why you check if BreakUpUsrs is less than or equal to null.  Should not be able to get a string less than null as far as I know.

BlackDeath

#4
haha i feel stupid i fixed the problem thanks anyway you may delete this post

Dark-Feanor

#5
I fail to see what "BreakUpUsrs" is meant to be....
Quotefew users left in my BreakUpUsrs like 3 out of 5 it wont list them well whatever was left in the BreakUpUsrs
What might fix the problem, is putting the number of "breakupusrs" in an array or listview:

if countme = 5 or ubound(aryusers) < 5 then
'you send it.
end if

form1.breakupusrs.listems.count [instead of ubound(aryusers)]if you dont want to use an array. Here is what I think it should look like:


CountMe = 0
For i = 1 To Main.SafeList.ListItems.Count
BreakUpUsrs = BreakUpUsrs & Main.SafeList.ListItems(i).Text & ", "
CountMe = CountMe + 1
     If (i = Main.SafeList.ListItems.Count) Then
         dim aryusers() as string
         aryusers() = split(breakupusrs, ", ")
               If (if ubound(aryusers < 5) Then
                     Main.Wait 2000
                     Main.CoWz.Send BreakUpUsrs & " ÿC2[Done..]"
                      BreakUpUsrs = vbnullstring
                     CountMe = 0
               End If
       Else
               If (CountMe = 5) Then
                     Main.Wait 2000
                     Main.CoWz.Send BreakUpUsrs & " ÿC2[More..]"
                     BreakUpUsrs = vbnullstring
                     CountMe = 0
               End If
       End If
Next i

Hurray! That should work. And I cleaned up your source ;)
- Feanor[xL]
clan exile
Firebot
iago: "caps lock is like cruise control for cool"

BlackDeath

#6
thanks anyway but i guess i should have explained a bit more but i was also working on it while posting

my users was not listed in listview with username, usrname

they all had there own listitem index

thanks anyway but mine works fine and my code didnt really have those comments i added them to explain a little