Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OMFG I AM GNA EXPLODE
#1
Read my third post.
Reply
#2
Combobox*
Reply
#3
Code:
Dim i As Integer
    For i = 0 To List1.ListCount
        List2.AddItem List1.List(i)
    Next i

Same for combo box as well as listbox
Reply
#4
Argh basicaly i have an opt control that says private message player: then a combobox that gets the online list, so you can just select who to talk to and keep in pm with them. However, whenever anyone logs in/out it updates the online list and the combobox with their name is goes blank obviously as its cleared and filled with new info... this is frustrating as hell as you have to select the person you were talking to again.. its stupid.

Code:
' ::::::::::::::::::::::::::
' :: Get Online List ::
' ::::::::::::::::::::::::::
If LCase(Parse(0)) = "onlinelist" Then
frmOnline.lstOnline.Clear
frmMainGame.txtplayername.Clear
frmMainGame.Refresh

n = 2
z = Val(Parse(1))
For X = n To (z + 1)
frmOnline.lstOnline.AddItem Trim(Parse(n))
frmMainGame.txtplayername.AddItem Trim(Parse(n))
frmMainGame.Refresh
n = n + 2
Next X
Exit Sub
End If

thats the code that sends the online information to the box.. i am completely stuck, i need the box to update but i want it to keep the playername selected IF they are still online...

spent 2 hours trying allsorts to try and figure this out any solution is welcome...

Foxy

edit: oh txtplayername is the combobox, bad naming i know but it was originaly a textbox till i thought this idea would be better.... -.-
Reply
#5
I got half way... storing the .text in a string called Q... unsure how to now find out the index of them though o.0

xD
Reply
#6
Code:
dim i, combothing as long
dim rofl as boolean
for i = 1 to combobox.listindex
Do until ROFL = true
if combobox.w/e = STOREDTEXT then
combothingy = i
rofl = true
loop
next

Not too sure on how to get the line of text for a certain index in the combobox though :\

I'll look it up if Dave or anyone doesn't know.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#7
me and robin ended up with:

Code:
' ::::::::::::::::::::::::::
' :: Get Online List ::
' ::::::::::::::::::::::::::
If LCase(Parse(0)) = "onlinelist" Then
Q = frmMainGame.txtplayername.Text
frmOnline.lstOnline.Clear
frmMainGame.txtplayername.Clear
frmMainGame.Refresh



n = 2
z = Val(Parse(1))
For X = n To (z + 1)
frmOnline.lstOnline.AddItem Trim(Parse(n))
frmMainGame.txtplayername.AddItem Trim(Parse(n))
frmMainGame.Refresh
n = n + 2
Next X

Dim r, combothing As Long
Dim rofl As Boolean
For r = 1 To frmMainGame.txtplayername.ListIndex
Do Until rofl = True
If frmMainGame.txtplayername.Text = Q Then
combothing = r
rofl = True
End If
Loop
Next

its not searching through the combobox though, just need the last piece of the jigsaw? xP
Reply
#8
Alright dave i think this is one for you or Verrigan xD

Code:
' ::::::::::::::::::::::::::
' :: Get Online List ::
' ::::::::::::::::::::::::::
If LCase(Parse(0)) = "onlinelist" Then
Q = frmMainGame.cmbPlayerName.Text
frmOnline.lstOnline.Clear
frmMainGame.cmbPlayerName.Clear
frmMainGame.Refresh

n = 2
z = Val(Parse(1))
For X = n To (z + 1)
frmOnline.lstOnline.AddItem Trim(Parse(n))
frmMainGame.cmbPlayerName.AddItem Trim(Parse(n))
frmMainGame.Refresh
n = n + 2
Next X

Dim r, combothing As Long
Dim rofl As Boolean
For r = 1 To frmMainGame.cmbPlayerName.ListCount
Do Until rofl = True Or r = frmMainGame.cmbPlayerName.ListCount
frmMainGame.cmbPlayerName.ListIndex = frmMainGame.cmbPlayerName.ListIndex + 1
If frmMainGame.cmbPlayerName.Text = Q Then
combothing = r
rofl = True
End If
DoEvents
Loop
Next

When players log-in it keeps your pm buddy selected, but when they logout it doesent...

o.o
Reply
#9
I'm utterly lost lol.

I dunno why it doesn't do it when you log off...

Well, I got you so far lol xD
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#10
Got it working, thanks to everyone for their help :wink:.
Reply
#11
alright i have found a single bug, basicaly if your whispering to a player then they leave it crashes due to it cant find their name...

unsure as to how to word the fix..

heres the code:

Code:
' ::::::::::::::::::::::::::
' :: Get Online List ::
' ::::::::::::::::::::::::::
If LCase(Parse(0)) = "onlinelist" Then
If frmMainGame.cmbPlayerName.Text = "" Then

Q = frmMainGame.cmbPlayerName.Text
frmOnline.lstOnline.Clear
frmMainGame.cmbPlayerName.Clear
frmMainGame.Refresh

n = 2
z = Val(Parse(1))
For X = n To (z + 1)
frmOnline.lstOnline.AddItem Trim(Parse(n))
frmMainGame.cmbPlayerName.AddItem Trim(Parse(n))
frmMainGame.Refresh
n = n + 2
Next X

Exit Sub
Else

Q = frmMainGame.cmbPlayerName.Text
frmOnline.lstOnline.Clear
frmMainGame.cmbPlayerName.Clear
frmMainGame.Refresh

n = 2
z = Val(Parse(1))
For X = n To (z + 1)
frmOnline.lstOnline.AddItem Trim(Parse(n))
frmMainGame.cmbPlayerName.AddItem Trim(Parse(n))
frmMainGame.Refresh
n = n + 2
Next X

Dim r, combothing As Long
Dim rofl As Boolean
For r = 1 To frmMainGame.cmbPlayerName.ListCount
Do Until rofl = True Or r = frmMainGame.cmbPlayerName.ListCount
frmMainGame.cmbPlayerName.ListIndex = frmMainGame.cmbPlayerName.ListIndex + 1
If frmMainGame.cmbPlayerName.Text = Q Then
combothing = r
rofl = True
End If
DoEvents
Loop
Next
End If

btw the code seems twice as long as it needs to be, but this way when people leave it keeps it.. its a bloody wierd way of doing it but oh well xD
Reply
#12
Code:
If findplayer(r) = false then
exit sub
end if

Not sure about the true syntax for "findplayer" but that should if you set it up correctly.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)