Valhalla Legends Forums Archive | Battle.net Bot Development | Event: Flags_Change ( 0xF )

AuthorMessageTime
BaDDBLooD
Private Sub ChatBot_OnFlags(ByVal username As String, ByVal Flags As Long, ByVal message As String, ByVal Ping As Long)

[code]

Dim Bot As New clsBnetBot

If (BNFLAGS_OP And Flags) = BNFLAGS_OP Then
frmMain.lstChannel.ListItems.Remove frmMain.lstChannel.FindItem(username).Index
With frmMain.lstChannel
.ListItems.Add 1, , username, , Bot.GetIconCode(message, Flags)
.ListItems(1).ListSubItems.Add , , , Bot.GetPingCode(Ping, Flags)
.ListItems(1).ToolTipText = username & " [ " & Ping & " ms ] " & Flags & " Moderator"
End With
If BType.Joins = True Then
AddChat vbGreen, username & " [ " & Ping & " ms ] " & Flags & " Flags Has acquired operator status."
Else: End If
End If

For X = 1 To frmMain.lstChannel.ListItems.Count
If frmMain.lstChannel.ListItems.Item(X).text = username Then
With frmMain.lstChannel
.ListItems.Item(X).SmallIcon = Bot.GetIconCode(message, Flags)
End With
End If
Next X

End Sub

[/code]

i tested this code, and when my War3 ops rejoined, i had 2 in the userlist, with no operator icon.

Any help would be apreciated, if you need further code.. just ask!

Note: the GetIconCode does work, because i can see the Names in the listview before this event fires!
April 3, 2004, 11:32 PM
Newby
Check your OnUser sub. That may be the problem.
April 3, 2004, 11:39 PM
BaDDBLooD
[code]

Private Sub ChatBot_OnUser(ByVal username As String, ByVal Flags As Long, ByVal message As String, ByVal Ping As Long)

Dim Bot As New clsBnetBot, ParsedString As String
Call ParseStatString(message, ParsedString)

If Flags = "2" Then
With frmMain.lstChannel
.ListItems.Add 1, , username, , Bot.GetIconCode(message, Flags)
.ListItems(1).ListSubItems.Add , , , Bot.GetPingCode(Ping, Flags)
.ListItems(1).ToolTipText = username & " [ " & Ping & " ms ] " & Flags & " Moderator"
End With
Else
With frmMain.lstChannel
.ListItems.Add , , username, , Bot.GetIconCode(message, Flags)
.ListItems(.ListItems.Count).ListSubItems.Add , , , Bot.GetPingCode(Ping, Flags)
.ListItems(.ListItems.Count).ToolTipText = ParsedString & " [ " & Ping & " ms ] " & Flags
End With
End If

frmMain.txtChannelInfo = BType.CurrentChannel & " ( " & frmMain.lstChannel.ListItems.Count & " )"

End Sub

[/code]

merry christmas to you all ;)

EDIT: i still need help ;)~
April 3, 2004, 11:43 PM
Newby
Does that mean you fixed it? Or does that mean you still need help? :P
April 3, 2004, 11:47 PM
Null
How about your write your own "GetIconCode" sub and dont use the public eth bot one. Just for starters...
April 4, 2004, 12:00 AM
BaDDBLooD
i did make my own!
April 4, 2004, 12:01 AM
Null
Icidentally you used the same naming convention as Ethbot , interesting. The icon's that arnt showing what product was/is the user on? have you loaded that image into your image list?
April 4, 2004, 12:05 AM
BaDDBLooD
i can post my geticon code if you want me to

the icon is loaded in my image list, it's warcraft III, i will try it with Other icon's to see if it makes a difference ;O

EDIT: Nm no i can't my cdkey is in use =\
April 4, 2004, 12:12 AM
ChR0NiC
Actually I believe BaDDBLooD is using a convention from either Dr Bot or Soup Bot which may have originally come from Eth.
April 4, 2004, 12:51 AM
Myndfyr
Back to the topic, ahem...

The reason it's happenning is that Blizzard sends two events for a Warcraft 3 user, either gaining ops in a clan channel, changing the icon in the channel, getting the tag in a clan channel, or levelling in a clan channel. They are EVENT_JOIN and then EVENT_SHOW.

You have to check your EVENT_SHOW (that is, the User event) to make it check your list to see if the user you are changing is already in the channel. If so, update that user. Otherwise, add it.
April 4, 2004, 1:04 AM
FuzZ
I didn't read these posts, this is how I do mine.
[code]
Private Sub Event_Flags(strUser As String, strFlag As Long, strStatString As String, ping As Long)
Dim p As String
Dim N&
If (strFlag And FLAGS_OP) = FLAGS_OP Then
p = Trim$(StrReverse(Left$(strStatString, 4)))
Select Case p
Case CHAT: N = ICON_CHAT
Case DRTL: N = ICON_DRTL
Case DSHR: N = ICON_DSHR
Case W2BN: N = ICON_W2BN
Case STAR: N = ICON_STAR
Case JSTR: N = ICON_JSTR
Case SSHR: N = ICON_SSHR
Case SEXP: N = ICON_SEXP
Case D2DV: N = ICON_D2DV
Case D2XP: N = ICON_D2XP
Case WAR3: N = ICON_WAR3
Case W3XP: N = ICON_W3XP
Case Else: N = ICON_UNKNOWN
End Select
End If
If (strFlag And FLAGS_OP) = FLAGS_OP Then: N = ICON_OP
If (strFlag And FLAGS_BLIZZ) = FLAGS_BLIZZ Then: N = ICON_BLIZZ
If (strFlag And FLAGS_SPKR) = FLAGS_SPKR Then: N = ICON_SPEAKER
If (strFlag And FLAGS_SYSOP) = FLAGS_SYSOP Then: N = ICON_SYSOP
If strUser <> BNet.CUser Then
If (strFlag And FLAGS_SQUELCH) = FLAGS_SQUELCH Then: N = ICON_SQUELCH
End If
If (strFlag And FLAGS_GLASSES) = FLAGS_GLASSES Then: N = ICON_SPECTATOR
If (strFlag And FLAGS_GFPLAYER) = FLAGS_GFPLAYER Then: N = ICON_GFP
If N = ICON_UNKNOWN Then
Open App.Path & "\Unknown.txt" For Append As #1
Print #1, strUser & " " & strStatString & " " & strFlag & " " & ping
Close #1
End If
If N = ICON_OP Then
If LCase$(strUser) = LCase$(BNet.CUser) Then
AddChat frmBNet.rtbChat, vbYellow, "You are now operator for this channel."
Else
AddChat frmBNet.rtbChat, vbYellow, strUser & " is now operator for this channel."
End If
End If
EditNick strUser, N
AddChat frmBNet.rtbChat, vbYellow, "User: " & strUser & " Flags: " & strFlag & " strStatString: " & statstring & " Ping: " & ping
End Sub
[/code]

EditNick:
[code]
Public Sub EditNick(ByVal strName$, lngIcon&)
With frmBNet.lstNicks
Dim aIX
aIX = .FindItem(strName).Index
.ListItems(aIX).Icon = lngIcon
.ListItems(aIX).SmallIcon = lngIcon
End With
End Sub
[/code]

these are based off from AssBot
April 4, 2004, 1:14 AM
Myndfyr
[quote author=FuzZ link=board=17;threadid=6146;start=0#msg53417 date=1081041249]
these are based off from AssBot
[/quote]

Does that mean you copied it?
April 4, 2004, 6:43 PM
Eli_1
Why are you all constantly accusing people of copying code...
April 4, 2004, 7:02 PM
BaDDBLooD
[quote author=ChR0NiC link=board=17;threadid=6146;start=0#msg53409 date=1081039891]
Actually I believe BaDDBLooD is using a convention from either Dr Bot or Soup Bot which may have originally come from Eth.
[/quote]

i wrote the code for every event, although i did not create the code for my 0xF. Shadowed gave me the parsing into events function. ( Although i could right my own now that i am more advanced than i was )

admin, please delete posts like this.

edit: including this post

April 4, 2004, 7:02 PM
Archangel
[quote author=BaDDBLooD link=board=17;threadid=6146;start=0#msg53438 date=1081105357]
[quote author=ChR0NiC link=board=17;threadid=6146;start=0#msg53409 date=1081039891]
Actually I believe BaDDBLooD is using a convention from either Dr Bot or Soup Bot which may have originally come from Eth.
[/quote]

i wrote the code for every event, although i did not create the code for my 0xF. Shadowed gave me the parsing into events function. ( Although i could right my own now that i am more advanced than i was )

admin, please delete posts like this.

edit: including this post


[/quote]

Wow is just an opinion, i think people can give opinions about stuff, why would u want a admin to delete this post?
April 4, 2004, 7:06 PM
BaDDBLooD
cause i am trying to get help, and as long as these posts exist; They will sidetrack everyone from what the post is even about?
April 4, 2004, 7:30 PM
Myndfyr
Did you read my reply? I answered your question about how to handle the issue.
April 4, 2004, 9:18 PM
BaDDBLooD
[quote author=Myndfyre link=board=17;threadid=6146;start=15#msg53456 date=1081113515]
Did you read my reply? I answered your question about how to handle the issue.
[/quote]

it happens on warcraft II as well.
April 4, 2004, 9:43 PM
Myndfyr
[quote author=BaDDBLooD link=board=17;threadid=6146;start=15#msg53458 date=1081115024]
[quote author=Myndfyre link=board=17;threadid=6146;start=15#msg53456 date=1081113515]
Did you read my reply? I answered your question about how to handle the issue.
[/quote]

it happens on warcraft II as well.
[/quote]

So have you tried to implement my solution? If it happens the same way, then it should work on any game that it happens to you for.
April 4, 2004, 11:16 PM
BaDDBLooD
no, i have not tried it yet
April 5, 2004, 12:38 AM

Search