Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Michael on February 21, 2005, 02:37 PM

Title: help me plz!
Post by: Michael on February 21, 2005, 02:37 PM
        rtbAdd "clan invite recived" & vbNewLine, vbYellow
        rtbAdd StrToHex(data) & vbNewLine, vbYellow
        profileend = Mid(data, 8, Len(data))
        rtbAdd profileread & vbNewLine, vbYellow
        Dim buttonaccept As String
        buttonaccept = MsgBox("accept clan invite", vbYesNo)
        If buttonaccept = vbYes Then
        SendPacket &H6
        rtbAdd "clan invite accepted" & vbNewLine, vbYellow
        End If


When i press yes to accept the clan invite i get ipbanned, why dosent this work.
Title: Re: help me plz!
Post by: UserLoser. on February 21, 2005, 02:52 PM
Just a random guess, but sending packet 0x06 (SID_STARTVERSIONING) is totally out of place, and has nothing to do with accepting clan invitations.  Also it seems you're sending it with no data
Title: Re: help me plz!
Post by: Michael on February 21, 2005, 02:56 PM
i am so confused....
i am guessing that i dont send &H6 i sent something else and that [14:54:56] clan invite recived
[14:54:56]  FF 79 1A 00 B7 2A 03 00 00 00 57 44 43 6C 61 6E 20 44 57 00 44 57 5B 31 5D 00
is how i get the info for the clantag and all that?
Title: Re: help me plz!
Post by: Michael on February 21, 2005, 03:02 PM
        rtbAdd "clan invite recived" & vbNewLine, vbYellow
        rtbAdd StrToHex(data) & vbNewLine, vbYellow
        profileend = Mid(data, 8, Len(data))
        rtbAdd profileread & vbNewLine, vbYellow
        Dim buttonaccept As String
        buttonaccept = MsgBox("accept clan invite", vbYesNo)
        If buttonaccept = vbYes Then
        InsertBYTE &H6
        SendPacket &H76
        rtbAdd "clan invite accepted" & vbNewLine, vbYellow
        End If

thats my code now and i still get ipbanned
Title: Re: help me plz!
Post by: Michael on February 21, 2005, 03:07 PM
opps :(
ok
        rtbAdd "clan invite recived" & vbNewLine, vbYellow
        rtbAdd StrToHex(data) & vbNewLine, vbYellow
        profileend = Mid(data, 8, Len(data))
        rtbAdd profileread & vbNewLine, vbYellow
        Dim buttonaccept As String
        buttonaccept = MsgBox("accept clan invite", vbYesNo)
        If buttonaccept = vbYes Then
        InsertBYTE &H6
        SendPacket &H79
        rtbAdd "clan invite accepted" & vbNewLine, vbYellow
        End If

dosent accept but does disconnect me but i don't get ip banned :D i still need more help :(
Title: Re: help me plz!
Post by: QwertyMonster on February 21, 2005, 03:11 PM
Quote from: QwertyMonster on February 21, 2005, 03:06 PM
Get rid of ur &H6, and just put &H79 then try


I can still see a &H6 in there ^_^
Title: Re: help me plz!
Post by: Michael on February 21, 2005, 03:14 PM
Still don't work but from what i have gathered you need to send insertbyte &H6 as the accept but i think you need other data.
Title: Re: help me plz!
Post by: QwertyMonster on February 21, 2005, 03:16 PM
Oh ok, i havent done much work on clan invites ect...

Try searching the forum, or www.google.com  :P

Well atleast i stopped you from getting ipbanned  ;D
Title: Re: help me plz!
Post by: Michael on February 21, 2005, 03:31 PM
can someone show me how to phrase the data and reply correctly please?
Title: Re: help me plz!
Post by: UserLoser. on February 21, 2005, 04:30 PM
Quote from: -MichaeL- on February 21, 2005, 03:02 PM
        rtbAdd "clan invite recived" & vbNewLine, vbYellow
        rtbAdd StrToHex(data) & vbNewLine, vbYellow
        profileend = Mid(data, 8, Len(data))
        rtbAdd profileread & vbNewLine, vbYellow
        Dim buttonaccept As String
        buttonaccept = MsgBox("accept clan invite", vbYesNo)
        If buttonaccept = vbYes Then
        InsertBYTE &H6
        SendPacket &H76
        rtbAdd "clan invite accepted" & vbNewLine, vbYellow
        End If

thats my code now and i still get ipbanned

0x76 id is used to quit a clan... and there's no client->server message for it.  This is on BnetDocs like you even told me & pasted the format used on AIM...

http://bnetdocs.valhallalegends.com/content.php?Section=m&Code=378
Title: Re: help me plz!
Post by: Michael on February 21, 2005, 04:49 PM
        rtbAdd "clan invite recived" & vbNewLine, vbYellow
        rtbAdd ToHex(data) & vbNewLine, vbYellow
        rtbAdd GetWORD(Mid(data, 5, 2)) & vbNewLine, vbYellow
        rtbAdd HexToStr(data) & vbNewLine, vbYellow
        Dim buttonaccept As String
        buttonaccept = MsgBox("accept clan invite", vbYesNo)
        If buttonaccept = vbYes Then
        InsertBYTE &H6
        SendPacket &H79
        rtbAdd "clan invite accepted" & vbNewLine, vbYellow
        End If


Fixed that little bug but i still need to no how to turn the data into the info i need.

i am guessing that i need something like

insertDWord cookie (i dont no how to find out what the cookie is from the data)
insertDWord clantag (dont understand how to get it out of the data tho.)
insertNTString person_inviting (dont no how to get this either)
insertBYTE &H6
sendpacket &H79

would be how to do it. can someone help me phrase the data into that?

So how can i get the info needed from FF 79 1A 00 B7 2A 03 00 00 00 57 44 43 6C 61 6E 20 44 57 00 44 57 5B 31 5D 00?
Title: Re: help me plz!
Post by: UserLoser. on February 21, 2005, 04:55 PM
All that is in the packet you received...
Title: Re: help me plz!
Post by: Michael on February 21, 2005, 05:13 PM
Quote from: UserLoser on February 21, 2005, 04:55 PM
All that is in the packet you received...
How can i turn that into the info tho... :(
Title: Re: help me plz!
Post by: Blaze on February 21, 2005, 05:19 PM
Read bnetdocs on receiving that packet..
Title: Re: help me plz!
Post by: Michael on February 21, 2005, 05:21 PM
(DWORD)       Cookie
(DWORD)       Clan Tag
(STRING)     Clan Name
(STRING)     Inviting Leader
Ya but how do i make the data come out into works and stuff?
Title: Re: help me plz!
Post by: Hdx on February 21, 2005, 05:44 PM
Cookie = GetDWORD(Mid(data, 5, 4))
Gets the Cookie. DWORD = 4 Bytes

ClanTag = Replace(StrReverse(Mid(Data, 9, 4)), Chr(&H0), vbNullstring)
Clan tag = DWORD,  In lamence terms a reversed string, that is padded on the right with Chr(&H0) to make it 4 chrs in length.

ClanName = Mid(Data, 13, instr(Mid(Data, 13), Chr(&H0))
A Null terminated string.

Invitor = mid(Data, 14 + Len(ClanName))
Invitor = Left(Invitor, Len(Invitor) - 1)

The vary last string in the packet, and its null terminated so the Left() takes off the last Null chr.

Umm I wrote this in about 15 seconds and it isnt tested.
~-~(HDX)~-~

Title: Re: help me plz!
Post by: Michael on February 21, 2005, 07:33 PM
       
        Case &H79
        Dim clantag As String
        Dim cookie As String
        Dim Invitor As String
        Dim clanname As String
cookie = GetDWORD(Mid(data, 5, 4))
rtbAdd cookie & vbNewLine, vbYellow
clantag = Replace(Mid(data, 9, 4), Chr(&H0), vbNullString)
clantag = StrReverse(clantag)
rtbAdd clantag & vbNewLine, vbYellow
clanname = Mid(data, 13)
rtbAdd clanname & vbNewLine, vbYellow
Invitor = Mid(data, 15)
rtbAdd Invitor & vbNewLine, vbYellow

        Dim buttonaccept As String
        buttonaccept = MsgBox("accept clan invite", vbYesNo)
        If buttonaccept = vbYes Then
        InsertDWORD GetDWORD(Mid(data, 5, 4))
        InsertDWORD GetDWORD(Replace(Mid(data, 9, 4), Chr(&H0), vbNullString))
        InsertNTString ""
        InsertNTString Invitor
        InsertBYTE &H6
        SendPacket &H79
        rtbAdd "clan invite accepted" & vbNewLine, vbYellow
        End If

This is what i have come up with but it dosent work.i have tried many different
also this is what it shows me in the rtbchat as response

[19:37:54] <MiKe[Vc]@USWest> `invite mike1[vc]
[19:38:03] <MiKe@USWest> `invite mike1[vc]
[19:38:04] 139940
[19:38:04] vc
[19:38:04] vc[19:38:04] [19:38:04] clan invite accepted
[19:38:04] <1[Vc]Ops> Successfully sent invite to mike1[vc]
Title: Re: help me plz!
Post by: Michael on February 21, 2005, 09:20 PM

Case &H79
          Dim cTag As Long, Cookie As Long, Invitor As String, cName As String
          Cookie = GetDWORD(Mid(data, 5, 4))
           
          cTag = GetDWORD(Mid(data, 9, 4))
          data = Mid(data, 13)
          cName = Split(data & Chr(&H0), Chr(&H0))(0)
          Invitor = Split(data & Chr(&H0) & Chr(&H0), Chr(&H0))(1)
        rtbAdd Cookie & vbNewLine, vbYellow
        rtbAdd Invitor & vbNewLine, vbYellow
        rtbAdd cTag & vbNewLine, vbYellow
              InsertDWORD Cookie
              InsertDWORD cTag
              InsertNTString Invitor
              InsertBYTE IIf(MsgBox("accept clan invite", vbYesNo) = vbYes, &H6, &H4)
              SendPacket &H79
              rtbAdd "clan invite accepted" & vbNewLine, vbYellow

Thx to hdx for alot of help! and part of the code :D