What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Request] Need pro help on this one.

[Request] Need pro help on this one.
Author: Message:
DennisMartijn
Full Member
***


Posts: 119
Joined: Jul 2006
O.P. [Request] Need pro help on this one.
Hello,

I'd like a script that terminates a process, when someone signs in.

When 123@hotmail.com signs in, then the process LegacyGamers.exe should be terminated. LegacyGamers.exe is a private server version of GunZ: The Duel, and has some 'anti-hack' system. It prevents you from using Alt tab, by shutting the game down if alt+tab are pressed.

Basicly, what im asking, is that when 123@hotmail.com signs in, and while im playing legacygamers (so only when the process is active), the script 'presses' alt+tab/terminates LegacyGamers.exe on its own.

Input: 123@hotmail.com signs in.
Process: If LegacyGamers.exe = active/running, Then terminate LegacyGamers.exe / "press'' Alt+tab
Output: Happy me, makes me smarter at scripting, no more problems with that contact :)


I hope someone can help me with this. Your help would be greatly appreciated:)

Thanx in advance

Edit: for those who like to hear the reason of this request;
I cant hear/see someone signing in while playing lg.exe. they talk to me, but i dont notice. i had a problem with that before, with contact 123@hotmail.com.
(note that this is just a masking adress, i can change it in the script myself:P

This post was edited on 12-30-2007 at 10:22 AM by DennisMartijn.
12-30-2007 10:17 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Request] Need pro help on this one.
code:
/*
    This script will simulate pressing ALT+TAB when a
    specific user signs in
    (C) Matty 2007

*/

var kbdevent_keyup = 0x2;
var vk_alt = 0x12;
var vk_tab = 0x9;

var oWMI = GetObject('winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2');

function OnEvent_ContactSignin(sEmail) {
    if (sEmail === '123@hotmail.com') {
        var oProcesses = oWMI.ExecQuery('Select * From Win32_Process');
        for (var oProcess = new Enumerator(oProcesses); !oProcess.atEnd(); oProcess.moveNext()) {
            if (oProcess.item().Name.toLowerCase() === 'legacygamers.exe') {
                Interop.Call('user32', 'keybd_event', vk_alt, 0, 0, 0);
                Interop.Call('user32', 'keybd_event', vk_tab, 1, 0, 0);
                Interop.Call('user32', 'keybd_event', vk_alt, 0, kbdevent_keyup, 0);
            }
        }
    }
}

This post was edited on 12-30-2007 at 03:48 PM by matty.
12-30-2007 03:47 PM
Profile E-Mail PM Find Quote Report
DennisMartijn
Full Member
***


Posts: 119
Joined: Jul 2006
O.P. RE: [Request] Need pro help on this one.
Wow, thats one hell of a code i wouldnt have even thought of :O
thank you =D
12-30-2007 03:49 PM
Profile E-Mail 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