Author | Message | Time |
---|---|---|
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 [code] 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 [/code] Just to test our sc and bw icons. Then i have [code] If Mid(Data, 5, 1) = Chr(1) Then Icons = Everything.Icons ListView1.ListItems.Add , , Username, , Icons End if [/code] 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! | February 7, 2005, 6:58 PM |
Spilled[DW] | 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... | February 7, 2005, 7:41 PM |
QwertyMonster | [quote author=Spilled[DW] link=topic=10462.msg98656#msg98656 date=1107805270] Have you added the image list and public'd the constants in your module for each icon? [/quote] 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. | February 7, 2005, 7:43 PM |
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. | February 7, 2005, 7:48 PM |
QwertyMonster | This might be a "dodgey" way but. I have it saying [code] If Mid(Data, 5, 1) = Chr(1) Then If strText = "VD2D" Then ListView1.ListItems.Add , , Username, , 5 End if End if [/code] 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? | February 7, 2005, 8:37 PM |
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: [code]if left(strText, 4) = "VD2D" then[/code] | February 7, 2005, 10:25 PM |
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) | February 8, 2005, 4:01 PM |
Spilled[DW] | 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. | February 8, 2005, 4:24 PM |
QwertyMonster | Woohoo, i finally got all icons working now Thanks to: tA-Kane Mostly :D Thanks to everyone who helped | February 8, 2005, 4:26 PM |
tA-Kane | You're welcome. | February 8, 2005, 9:03 PM |
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 | February 9, 2005, 5:34 PM |
OnlyMeat | [quote author=QwertyMonster link=topic=10462.msg98998#msg98998 date=1107970463] 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 [/quote] The gavel is actually a flag, the product code remains the same. | February 9, 2005, 5:52 PM |
QwertyMonster | What about Starcraft Spawn ? | February 9, 2005, 5:58 PM |
QwertyMonster | Hmm you said it stays the same, would i put [code] 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 [/code] Are any of those right, or am i totally wrong? Because NONE of them work. | February 9, 2005, 6:02 PM |
Zakath | You're approaching it COMPLETELY wrong. It is NOT a product code. The gavel information is stored in the user's FLAGS. | February 9, 2005, 6:35 PM |
Myndfyr | [quote author=QwertyMonster link=topic=10462.msg99005#msg99005 date=1107972161] Hmm you said it stays the same, would i put [code] 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 [/code] Are any of those right, or am i totally wrong? Because NONE of them work. [/quote] ROFL! First of all, do you even program? Do you know that the second parameter in the Left(string, integer) function is for "Length"? How can ANYTHING of length 4 equal a string of length 5? Second, bitwise flags are what Zak is talking about; use the binary nature of numbers in computing to store multiple true/false values. To test if flag 1 is set, for example, you would: [code] If (value And 1) <> 0 Then ' Flag 1 is set. End If [/code] | February 9, 2005, 7:36 PM |
QwertyMonster | Yeah when relooking at my code i saw i put 4, but anway that was fixed after i just posted. Hmm seem to be understand, ill do some testing. | February 9, 2005, 8:02 PM |
QwertyMonster | Umm ok i nearly there, but what about Starcraft Spawn, is that in the flags aswell ? | February 9, 2005, 8:30 PM |
UserLoser. | [quote author=QwertyMonster link=topic=10462.msg99033#msg99033 date=1107981008] Umm ok i nearly there, but what about Starcraft Spawn, is that in the flags aswell ? [/quote] No, a user's product is the first part of the user's statstring which is viewable in chat channels Edit: was thinking Starcraft Shareware, not Spawn. But anyways, IIRC it's the fifth part of statstring which contains spawn boolean value | February 9, 2005, 8:31 PM |
QwertyMonster | Oh right. Ok, i kind of got it now. But now i have another question. How would i make my bot see a name for a command to trigger Like this [code] If UCase(Username) = "QwertyMonster" then blah blah [/code] That would mean my name HAS to be QwertyMonster. What would i put so it can be anything like QweRTYMonSteR, QwertMonster like that I havent really used things like that much, help is thanks. | February 9, 2005, 8:56 PM |
Soul Taker | "EVIL_MARINE". | February 9, 2005, 9:47 PM |
QwertyMonster | Yeah, that was just an example, at first i did have "SouL TaKeR and SOUL TAKER" but then changed to evil_marine one cos it looked better, ok now its my name.. | February 9, 2005, 9:55 PM |
JoeTheOdd | UCase will NEVER == something with a lowercase letter in it. If (UCase(Username) = UCase("QuertyMonster") Then That'll work though. | February 9, 2005, 11:13 PM |
tA-Kane | [quote author=UserLoser link=topic=10462.msg99034#msg99034 date=1107981082] [quote author=QwertyMonster link=topic=10462.msg99033#msg99033 date=1107981008] Umm ok i nearly there, but what about Starcraft Spawn, is that in the flags aswell ? [/quote] No, a user's product is the first part of the user's statstring which is viewable in chat channels [/quote]UserLoser is correct, however, the product is not where the "spawn" flag is specified. It's not in the user's flags, either. The spawn flag is in the statstring. I do not remember which one, though. Consult BnetDocs. | February 10, 2005, 12:20 AM |
QwertyMonster | Thanks u lot, nearly got it working now | February 10, 2005, 8:00 AM |
QwertyMonster | [quote author=JoeTheOdd link=topic=10462.msg99080#msg99080 date=1107990821] UCase will NEVER == something with a lowercase letter in it. If (UCase(Username) = UCase("QuertyMonster") Then That'll work though. [/quote] It doesnt =[ Look, i have [code] If (UCase(Username)) = UCase("QwertyMonster") And UCase(Mid(strText, 1, 6)) = frmConfig.trigger.Text & "home " Then [/code] A msgbox comes up as QwertyMonster -> QWERTYMONSTER, Not QwertyMonster, what do i put for it to read exactly what the name is? | February 11, 2005, 6:16 PM |
KkBlazekK | [quote author=QwertyMonster link=topic=10462.msg99300#msg99300 date=1108145803] If (UCase(Username)) = UCase("QwertyMonster") And UCase(Mid(strText, 1, 6)) = frmConfig.trigger.Text & "home " Then [/quote] The home isn't upper case, so it will never match. | February 11, 2005, 9:01 PM |
QwertyMonster | oh fk i didnt see that, nice spotting :D | February 12, 2005, 4:06 PM |