Yahoo Bot: Receive PM Codes

Some of you who had read my previous post on this link, had posted request to me to post the receive PM codes. Here are the codes:

procedure TfrmMain.YMSGSockRead(Sender: TObject; Socket: TCustomWinSocket);
var
yahoo_id,
msg,
RecData,
i: integer;
begin
RecData := RecData + YMSGSock.Socket.ReceiveText;
If MidStr(RecData, 12, 1) = #$55 then begin
//Response from Yahoo Server that you are online
end
else If MidStr(RecData, 12, 1) = #6 then  begin
yahoo_id := copy(RecData,pos(‘4À€’,RecData),length(RecData));
yahoo_id := StringReplace(yahoo_id,’4À€’,”,[rfReplaceAll]);
yahoo_id := copy(yahoo_id,1,pos(‘À€’,yahoo_id)-1);
yahoo_id := StringReplace(yahoo_id,’À€’,”,[rfReplaceAll]);

msg := copy(RecData,pos(’14À€’,RecData),length(RecData));
msg := StringReplace(msg,’14À€’,”,[rfReplaceAll]);
msg := copy(msg,1,pos(‘À€’,msg)-1);
msg := StringReplace(msg,’À€’,”,[]);
if pos(”,msg)+1,length(msg));
msg := StringReplace(msg,”,”,[rfReplaceAll]);
end;
//delete unreadable char
i:=0;
repeat
if copy(msg,1,2) = #$1B'[‘ then
msg := copy(msg,pos(‘m’,msg)+1,length(msg));
inc(i);
until (pos(#$1B'[‘,msg) = 0) or (i >=100);
msg := StringReplace(msg,’‎​’,”,[rfReplaceAll]);
//done, you have capture PM sender in yahoo_id param, and the message in msg param
end;
end;

Advertisements

One thought on “Yahoo Bot: Receive PM Codes

Komentar, pertanyaan, sanggahan

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s