What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Blocking

Blocking
Author: Message:
mozzer
New Member
*

Hacker

Posts: 2
– / Male / –
Joined: Sep 2006
O.P. Blocking
Is it possible to block someone when they send you a message and then unblock them when they close the window/a timer ends?
09-13-2006 04:58 PM
Profile E-Mail PM Web Find Quote Report
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
35 / Male / Flag
Joined: Jul 2006
RE: Blocking
This should theoreticaly work...
I don't have MP!L to test atm, but it should work fine...

code:
function OnEvent_ChatWndReceiveMessage (ChatWnd, Origin, Message, MessageKind) {
   if (/(?:\s|^)Word(?:\s|$)/i.test(Message)) {
   //This matches only whole words, to match pieces of a word too,
   //use (/Word/i.test(Message)) instead
      for (var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext()) {
      Contact = e.item()
      Contact.Blocked = true
      MsgPlus.AddTimer("Unblock" + Contact.Email, Time)
   }
}
functionOnEvent_Timer (TimerId) {
   if (/^Unblock(.+)$/.test(TimerId)) {
      Email = RegExp.$1
      var Contact = Messenger.MyContacts.GetContact(Email)
      Contact.Blocked = false
   }
}
My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
09-13-2006 05:21 PM
Profile PM Find Quote Report
mozzer
New Member
*

Hacker

Posts: 2
– / Male / –
Joined: Sep 2006
O.P. RE: Blocking
Doesn't seem to work, could you add it so that any message will be accepted and I can only be from one email address to be blocked?
09-13-2006 05:27 PM
Profile E-Mail PM Web Find Quote Report
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
35 / Male / Flag
Joined: Jul 2006
RE: Blocking
Like if someone starts talking to you?
sure... (still can't test though)

code:
var BlockedUser = "user@blocked.com"
function OnEvent_ChatWndReceiveMessage (ChatWnd, Origin, Message, MessageKind) {
   for (var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext()) {
      Contact = e.item()
      if (Contact.Email == BlockedUser) {
         Contact.Blocked = true
         MsgPlus.AddTimer("Unblock", Time)
      }
   }
}
functionOnEvent_Timer (TimerId) {
      var Contact = Messenger.MyContacts.GetContact(BlockedUser)
      Contact.Blocked = false
   }
}
My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
09-13-2006 05:38 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On