User Control Panel
Advertisements

HELP US, HELP YOU!

Send message to 1 socket instead of all?

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help
View unanswered posts
Author Message
Rwesterh
Newbie
Newbie


Joined: 12 Jun 2006
Posts: 3


PostPosted: Fri Nov 10, 2006 1:30 pm    Post subject: Send message to 1 socket instead of all? Reply with quote

Hello,

I have a little question.
I searched thru the boards but I did'nt got the results I wanted....
I'm using White Warrior, a bit edited, but is it possible to.. change the !shout function so I can send a message to a socket instead it goes to everyone?

I want to do this so I can fake a user in group convo's Razz

Hope someone can help me,

Greetings,
Rwesterh.

Ps. The current !shout command:

Code:

   if($msg =~ /^!shout (.*)/i){
       foreach my $id (keys %{$msn->{Socks}})      {
         next unless defined $msn->{Socks}->{$id} and $msn->{Socks}->{$id}->{Type} eq 'SB';
          $msn->{Socks}->{$id}->sendmsg("$1");
      }

}
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Sat Nov 11, 2006 5:12 pm    Post subject: Reply with quote

I'm really not going to give you any code because the answer stares you in the eyes.. look at it closely and keep reading till you get it Laughing
Back to top
Rwesterh
Newbie
Newbie


Joined: 12 Jun 2006
Posts: 3


PostPosted: Sat Nov 18, 2006 11:26 pm    Post subject: Reply with quote

I kept reading it until I got a headache.

Code:

   if($msg =~ /^!shout (.*) - (.*)/i){
 $msn->{Socks}->{$id}->{Type} eq 'SB';
          $msn->{Socks}->{$1}->sendmsg("$2");
}


Something like this should work? (Don't got the bot here in the area...)
Because I don't know what 'SB' is...
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Nov 20, 2006 4:22 am    Post subject: Reply with quote

'SB' is 'SwitchBoard', the name of the particular MSN server that handles conversations between individual users. For each convo, MSN.pm (or more specifically, MSN::SwitchBoard) opens a new socket to the SB server for this conversation.

Your MSN connection involves several connections, one to the Notification server for example which sends notifications such as buddies signing on and off, and several connections to the SwitchBoard server for each conversation. Therefore, the code checks if the socket is to an SB so that it knows this is a conversation socket, before continuing.

Your code would work, assuming you know the socket fileno of the particular SB conversation you want. If you got the number wrong and it didn't exist under $msn->{Socks}->{$1}, your script would crash "Can't call method sendmsg on undefined object" so you'll want to do some sanity checking in there.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Rwesterh
Newbie
Newbie


Joined: 12 Jun 2006
Posts: 3


PostPosted: Tue Nov 21, 2006 6:09 pm    Post subject: Reply with quote

Cer wrote:
'SB' is 'SwitchBoard', the name of the particular MSN server that handles conversations between individual users. For each convo, MSN.pm (or more specifically, MSN::SwitchBoard) opens a new socket to the SB server for this conversation.

Your MSN connection involves several connections, one to the Notification server for example which sends notifications such as buddies signing on and off, and several connections to the SwitchBoard server for each conversation. Therefore, the code checks if the socket is to an SB so that it knows this is a conversation socket, before continuing.

Your code would work, assuming you know the socket fileno of the particular SB conversation you want. If you got the number wrong and it didn't exist under $msn->{Socks}->{$1}, your script would crash "Can't call method sendmsg on undefined object" so you'll want to do some sanity checking in there.


Ahh.. Thanks for the info! Very Happy
As for the script, I first take a look in the window of the bot ans then write the message.
Anyways, thanks for all the help Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group