Mirage Source
OMFG I AM GNA EXPLODE - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: OMFG I AM GNA EXPLODE (/showthread.php?tid=1005)



OMFG I AM GNA EXPLODE - Coke - 12-06-2007

Read my third post.


Re: OMFG I AM GNA EXPLODE - Coke - 12-06-2007

Combobox*


Re: OMFG I AM GNA EXPLODE - Xlithan - 12-06-2007

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


Re: OMFG I AM GNA EXPLODE - Coke - 12-06-2007

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


Re: OMFG I AM GNA EXPLODE - Coke - 12-06-2007

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


Re: OMFG I AM GNA EXPLODE - Robin - 12-06-2007

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.


Re: OMFG I AM GNA EXPLODE - Coke - 12-06-2007

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


Re: OMFG I AM GNA EXPLODE - Coke - 12-06-2007

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


Re: OMFG I AM GNA EXPLODE - Robin - 12-06-2007

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


Re: OMFG I AM GNA EXPLODE - Coke - 12-06-2007

Got it working, thanks to everyone for their help :wink:.


Re: OMFG I AM GNA EXPLODE - Coke - 12-06-2007

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


Re: OMFG I AM GNA EXPLODE - Robin - 12-06-2007

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.