[request] report feature (paying $$$) - Printable Version
-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [request] report feature (paying $$$) (/showthread.php?tid=65234)
[request] report feature (paying $$$) by icepick66 on 08-22-2006 at 11:21 AM
Hi, i run a server which has msn on it and its signed into a account 24/7,
i use this to provide help to users if their are expericeing trobble with the server, and basicly i want it so when a user types report [message],
(the message being the problem they are trying to comunicate with me)
it will msn my home pc's msn account with their email address and message of the user, and obiously when im offline it will send a offline message.
im expericend with scripts so dont bother with a menu
and im offering $5 mabey $10 if done quickly
thankyou
RE: [request] report feature (paying $$$) by saralk on 08-22-2006 at 12:32 PM
icepick66.
I have almost finished it. PM me for details.
RE: [request] report feature (paying $$$) by Felu on 08-22-2006 at 12:37 PM
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
if (Origin != Messenger.MyName){
var e = new Enumerator(ChatWnd.Contacts);
for(; !e.atEnd(); e.moveNext())
var Contact = e.item();
var From = "From : "+Contact.Email
var Message = "\n\nMessage : "+Message
Messenger.OpenChat(YourHomeEmail).SendMessage(From+Message);//edit to your home email within quotes.
}
}
Simple code .
And i don't want money for it .
RE: [request] report feature (paying $$$) by CookieRevised on 08-22-2006 at 12:45 PM
If I understand correctly: what he asks for is a code so his bot which is run from the server 24/7, will message his personal MSN account.
If his bot is a php script or whatever (thus a full blown msn client), he is asking his request in the wrong forum.
Only if his bot and server is running on Windows and uses Windows Live Messenger itself with Plus!, a Plus! script can be used for this. Otherwise he needs php code (or in whatever language his msn client is written)....
quote: Originally posted by -!Felu!-
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
if (Origin != Messenger.MyName){
var e = new Enumerator(ChatWnd.Contacts);
for(; !e.atEnd(); e.moveNext())
var Contact = e.item();
var From = "From : "+Contact.Email
var Message = "\n\nMessage : "+Message
Messenger.OpenChat(YourHomeEmail).SendMessage(From+Message);//edit to your home email
}
}
Simple code
...but buggy code.
What your code will do is sending a message for only the last contact there is in the conversation, even if the first contact has send the message (and as such, you don't need to use the for loop, just e.moveLast() would do).
quite possible that his bot never uses multi-contact chats, but even so, the bug in that script needs to be fixed:
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
if (Origin !== Messenger.MyName) {
for (var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext()) {
var Contact = e.item();
if (Origin === Contact.Name) {
var From = "From : " + Contact.Email;
var Message = "\n\nMessage : " + Message;
Messenger.OpenChat(YourHomeEmail).SendMessage(From+Message);
return;
}
}
}
}
RE: [request] report feature (paying $$$) by saralk on 08-22-2006 at 01:01 PM
That script will forward every message, not just messages starting with report.
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
Pattern = /^report/i
OK = Pattern.exec(Message)
if (OK) {
var Contacts = ChatWnd.Contacts
var e = new Enumerator(Contacts);
for (; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
Debug.Trace(" " + Contact.Email);
if (Origin === Contact.Name) {
Messenger.OpenChat("YOUREMAIL");
ChatWnd.SendMessage("Message From " + Contact.Email);
ChatWnd.SendMessage(Message);
}
}
}
}
quote: Originally posted by CookieRevised
(and as such, you don't need to use the for loop, just e.moveLast() would do).
I tried using that method, but it didn't work.
Click quote to get a tabulated code.
RE: RE: [request] report feature (paying $$$) by CookieRevised on 08-22-2006 at 01:37 PM
[OFF TOPIC]
quote: Originally posted by saralk
quote: Originally posted by CookieRevised
(and as such, you don't need to use the for loop, just e.moveLast() would do).
I tried using that method, but it didn't work.
my bad... moveLast doesn't exist (moveFirst() does though.... crappy JScript again)...
[OFF TOPIC]
RE: [request] report feature (paying $$$) by icepick66 on 08-23-2006 at 08:54 AM
quote: Originally posted by saralk
That script will forward every message, not just messages starting with report.
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
Pattern = /^report/i
OK = Pattern.exec(Message)
if (OK) {
var Contacts = ChatWnd.Contacts
var e = new Enumerator(Contacts);
for (; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
Debug.Trace(" " + Contact.Email);
if (Origin === Contact.Name) {
Messenger.OpenChat("YOUREMAIL");
ChatWnd.SendMessage("Message From " + Contact.Email);
ChatWnd.SendMessage(Message);
}
}
}
}
quote: Originally posted by CookieRevised
(and as such, you don't need to use the for loop, just e.moveLast() would do).
I tried using that method, but it didn't work.
Click quote to get a tabulated code.
Thanks saralk ill pay u £5 (around $10) as ur in the uk whats ur paypal?
but it just reports it to the user who types report and doesent send a msg to me
oh the bot is a msg plus script, its not a clever bot tho , just predefined answers
and finaly do you know how to auto accept added contacts?
RE: [request] report feature (paying $$$) by icepick66 on 08-23-2006 at 09:33 AM
attualy i fixed it by using code from both of yours the final thing was:
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
Pattern = /^report/i
OK = Pattern.exec(Message)
if (OK) {
var Contacts = ChatWnd.Contacts
var e = new Enumerator(Contacts);
for (; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
Debug.Trace(" " + Contact.Email);
if (Origin === Contact.Name) {
var From = "From : " + Contact.Email;
var Message = "\n\nMessage : " + Message;
Messenger.OpenChat("myemail").SendMessage(From+Message);
return;
}
}
}
}
£2.50 each (around $5 each) to cookie and saralk
thanks guys pm me ur paypal
and finaly do you know how to auto accept added contacts?
RE: [request] report feature (paying $$$) by saralk on 08-23-2006 at 09:47 AM
saralk@fw6.net
auto accepting might be a bit more difficult, afaik there isn't a function that is triggered when you get the accept contact window. I'll look into it.
RE: [request] report feature (paying $$$) by Sunshine on 08-23-2006 at 09:48 AM
quote: Originally posted by icepick66
and finaly do you know how to auto accept added contacts?
I believe unticking the 2 (esp. last one, first is to allow messaging you if they are not on your list) shown in the picture below will do that.
If you don't want to be notified then it's auto accept right?
RE: [request] report feature (paying $$$) by icepick66 on 08-23-2006 at 10:35 AM
ok, thanks
just one last request:
if im offline it will send a message anyway, but could you get it to check if im offline
then message the person who said report saying im offline and ill get the message when i sign in so their will be some delay in a responce
edit:
sent the money
RE: RE: [request] report feature (paying $$$) by saralk on 08-23-2006 at 11:43 AM
I haven't tested this out, but it should work.
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
Pattern = /^report/i
OK = Pattern.exec(Message)
if (OK) {
var Contacts = ChatWnd.Contacts
var e = new Enumerator(Contacts);
for (; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
Debug.Trace(" " + Contact.Email);
if (Origin === Contact.Name) {
var From = "From : " + Contact.Email;
var Message = "\n\nMessage : " + Message;
var MyStatus = GetContact("myemail");
if (MyStatus.Status === '1')
Messenger.OpenChat(Contact.Email).SendMessage("ENTEROFFLINEMESSAGE");
else
Messenger.OpenChat("myemail").SendMessage(From+Message);
return;
}
}
}
}
RE: RE: [request] report feature (paying $$$) by CookieRevised on 08-24-2006 at 09:05 AM
quote: Originally posted by icepick66
£2.50 each (around $5 each) to cookie and saralk
thanks guys pm me ur paypal
Buy a big ice cream (or if you must, donate it to saralk too )
RE: [request] report feature (paying $$$) by icepick66 on 08-24-2006 at 10:33 AM
ok, yum
im getting the error with the online checker script
code: Error: Object expected.
Line: 15. Code: -2146823281.
RE: [request] report feature (paying $$$) by saralk on 08-24-2006 at 10:48 AM
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
Pattern = /^report/i
OK = Pattern.exec(Message)
if (OK) {
var Contacts = ChatWnd.Contacts
var e = new Enumerator(Contacts);
for (; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
Debug.Trace(" " + Contact.Email);
if (Origin === Contact.Name) {
var From = "From : " + Contact.Email;
var Message = "\n\nMessage : " + Message;
var Contacts = Messenger.MyContacts;
if (Contacts.GetContact("YOUREMAIL").Status === '1')
Messenger.OpenChat(Contact.Email).SendMessage("ENTEROFFLINEMESSAGE");
else
Messenger.OpenChat("myemail").SendMessage(From+Message);
return;
}
}
}
}
try that.
RE: [request] report feature (paying $$$) by icepick66 on 08-24-2006 at 12:35 PM
sorry
code: Error: Object required.
Line: 16. Code: -2146827864.
Function OnEvent_ChatWndReceiveMessage returned an error. Code: -2147352567
RE: [request] report feature (paying $$$) by saralk on 08-24-2006 at 12:49 PM
It wont work unless you have added yourself as a contact.
RE: [request] report feature (paying $$$) by icepick66 on 08-24-2006 at 12:58 PM
i have added myself(home pc's msn acc) and the bot to the bots contact list
RE: RE: [request] report feature (paying $$$) by Matti on 08-24-2006 at 03:45 PM
And here is a nicer version of this all.
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
var Pattern = new RegExp("^report", "i");
var OK = Pattern.exec(Message);
//If the message begins with "report"...
if (OK) {
var Contacts = ChatWnd.Contacts;
//Loop through the participants of the chatwindow
for (var e = new Enumerator(Contacts); !e.atEnd(); e.moveNext()) {
var Contact = e.item();
//If the origin matches the current contacts name...
if (Origin == Contact.Name) {
var Message = "From: " + Contact.Email + "\n\nMessage: " + Message;
//If the status of the home user is Offline...
if (Messenger.MyContacts.GetContact("home@server.com").Status == 1) {
Messenger.OpenChat(Contact.Email).SendMessage("Da boss is currently offline!");
} else {
Messenger.OpenChat("home@server.com").SendMessage(Message);
}
//Ends the function to stop looking for other contact matches
return;
}
}
}
}
|