Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: PaiD on August 04, 2005, 02:49 AM

Title: [Delphi] BNLS Connecting
Post by: PaiD on August 04, 2005, 02:49 AM
I am tring to connect to BNLS via Delphi. I am tring to send the verbyte request


procedure TfrmMain.BNLSConnect(Sender: TObject);
begin
  AddC(clWhite,'Connected To BNLS');
  Buffer := #1;
  SendBNLS($10);
end;



procedure TfrmMain.SendBNLS(PacketID : Byte);
//(WORD)      Message Length, including this header
//(BYTE)      Message ID
//(VOID)      Message Data
var
  Len: Word;
begin
  Len := Length(Buffer) + 1;

  frmMain.BNLS.SendStream(Chr(Len) + PacketID + Buffer);
end;

When ever I try to compile I get an error telling me
[Error] UMain.pas(86): E2008 Incompatible types and highlights frmMain.BNLS.SendStream(Chr(Len) + PacketID + Buffer);

The declares are

Len: Word;
PacketID : Byte;
Buffer: WideString;

Any1 know how I can get this to work?

Edit: Spelling
Title: Re: [Delphi] BNLS Connecting
Post by: MyndFyre on August 04, 2005, 01:25 PM
Out of curiousity, are you the one using Delphi 2005?  Isn't that developed for .NET?
Title: Re: [Delphi] BNLS Connecting
Post by: PaiD on August 04, 2005, 01:49 PM
Yea I am using 2005 and you dont need to develop for .Net
Title: Re: [Delphi] BNLS Connecting
Post by: R.a.B.B.i.T on August 04, 2005, 11:45 PM
A word is 2 bytes *cough*.  You are trying to make an ASCII char out of a 2 byte value.  :X
Title: Re: [Delphi] BNLS Connecting
Post by: PaiD on August 05, 2005, 12:22 AM
that isnt my problem I dont think. SendStream() wants a TString
Title: Re: [Delphi] BNLS Connecting
Post by: Kp on August 05, 2005, 08:52 PM
Quote from: rabbit on August 04, 2005, 11:45 PMA word is 2 bytes *cough*.  You are trying to make an ASCII char out of a 2 byte value.  :X

Actually, a word's size depends on the host architecture.  On an x86, a word is 4 bytes.  No one wants to go back to the days of 2byte words, because those were the days of real mode.
Title: Re: [Delphi] BNLS Connecting
Post by: Warrior on August 05, 2005, 10:50 PM
Okay, let's just say a word is half a double word? Mmk.
Title: Re: [Delphi] BNLS Connecting
Post by: l)ragon on August 05, 2005, 11:35 PM
Quote from: Warrior on August 05, 2005, 10:50 PM
Okay, let's just say a word is half a double word? Mmk.

Short