• Welcome to Valhalla Legends Archive.
 

Trouble :(

Started by QwertyMonster, February 07, 2005, 12:58 PM

Previous topic - Next topic

QwertyMonster

Hmm, yeah thats right. I have trouble!  :'(

I have been trying to add icons into my bot for a good old 4 months now. I can tell it to add icons ect.. but i cant give the proper icon.


First of all i have


Public Function Icons(ByVal Product As String) As Integer


Select Case UCase(Product)

Case "RATS" ' <-- Starcraft (STAR = RATS)
Icons = 0
Case "PXES" ' <-- Broodwar (SEXP = PXES)
  Icons = 2
Case "STAR" ' <-- Starcraft Client
  Icons = 1
Case "SEXP" ' <-- Broodwar Client
Icons = 2
End Select
'MsgBox Icons
End Function


Just to test our sc and bw icons.

Then i have
       

If Mid(Data, 5, 1) = Chr(1) Then
     
        Icons = Everything.Icons
         
         ListView1.ListItems.Add , , Username, , Icons

   End if



And it just comes up as this

Example:
                                 Op [vL] (10)
                                          Arta[vL]
                                    ^ icon should be there but isnt?


Any ideas is appreciated. Thanks in advance people!

Spilled

Have you added the image list and public'd the constants in your module for each icon? and is that all the code you have to show us because its not much to go on...

QwertyMonster

Quote from: Spilled[DW] on February 07, 2005, 01:41 PM
Have you added the image list and public'd the constants in your module for each icon?

Oops Shite, totally forgot bout that lol.

Yeah that is all the code i have. Chr(1) is requesting the Userlist @ connect, and whats point on showing chr(2) (user join) when its basically the same as chr(1).


I will public my constants in my module. Keep advanced here for updates.

Soul Taker

Having a variable and a function which is assigning values to that variable use the same name is probably not a good idea.

QwertyMonster

This might be a "dodgey" way but.

I have it saying


    If Mid(Data, 5, 1) = Chr(1) Then
          If strText = "VD2D" Then
          ListView1.ListItems.Add , , Username, , 5
       End if
           End if


Just to test D2. And it works!

But thats because D2 has no stats. Now when my strText = "RATS 0 0 0 0 0 0 0 RATS" the icon wont show. But anyway, i will fix it soon. But i would like to know wether you think its a good way or a dodgey way?

tA-Kane

Indeed, it'd be a dodgy way... as in, it won't work if the statstring contains anything other than the user's product.

Try using left() on the strtext before you compare, like so:
if left(strText, 4) = "VD2D" then
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

QwertyMonster

Ahh yeah, thanks.

I know my way is dodgey, but im finding it hard to find any other way. If it is dodgey, i will keep making it better and better :)

Keep posted here incase any more trouble :) (im sure i will haha ;D)

Spilled

As Kane said your way is a dodgey way but use this way to play around with it until you see exactly how things work and then work your way up is the best advice i can give you thats how i learned how to deal with icons.

QwertyMonster

Woohoo, i finally got all icons working now

Thanks to: tA-Kane Mostly :D

Thanks to everyone who helped

tA-Kane

Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

QwertyMonster

Ok, maybe i havent got ALL icons working yet.

Im just woundering, If Starcraft = "RATS", then what is it for Starcraft Spawn and Gavel?

Is Starcraft Spawn: SSPW ? (Just a guess:P)

If somebody could tell me, would be big help. thanks

OnlyMeat

Quote from: QwertyMonster on February 09, 2005, 11:34 AM
Ok, maybe i havent got ALL icons working yet.

Im just woundering, If Starcraft = "RATS", then what is it for Starcraft Spawn and Gavel?

Is Starcraft Spawn: SSPW ? (Just a guess:P)

If somebody could tell me, would be big help. thanks

The gavel is actually a flag, the product code remains the same.

QwertyMonster

What about Starcraft Spawn ?

QwertyMonster

Hmm you said it stays the same, would i put


If Left(Strtext, 4) = "GAVEL" then
blah blah
Else
If Left(Strtext, 4) = "LEVAG" then
blah blah
Else
If Left(Strtext, 4) = "ICON_GAVEL" then
blah blah
End If
End If
End if


Are any of those right, or am i totally wrong? Because NONE of them work.

Zakath

You're approaching it COMPLETELY wrong. It is NOT a product code. The gavel information is stored in the user's FLAGS.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.