Shoutbox

A bit more help taking pictures - 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: A bit more help taking pictures (/showthread.php?tid=95046)

A bit more help taking pictures by SR01001010 on 07-17-2010 at 08:26 PM

I need a bit more help with something, There's this thing going around where two people are on webcam and they take pictures with print screen and show each other just for fun, The problem is you can never pose properly when you've gotta keep a finger on print screen.

Could someone help me with a script that goes like this:

I send the word "!pictureinitiate"

it starts from 10 and counts down, sending a message each time the number goes down 1 (So we can both get prepared)

Then on 0 it Takes a picture (By pressing print screen) and sends a message saying 'Picture taken'

Is this possible and if so could someone help me?


RE: A bit more help taking pictures by roflmao456 on 07-17-2010 at 08:55 PM

Screenshot Sender? IIRC you can put a timer for the picture :P

edit: oh never mind (you needed chat message for each second)
i'm sure it can be edited slightly to send a chat message though


RE: A bit more help taking pictures by SR01001010 on 07-18-2010 at 09:43 AM

Thanks, I can't really edit that too well because I don't understand it.. D:

I think All i'd need help with would be a timer, a button the press print screen and then automatically press Ctrl + V


RE: A bit more help taking pictures by matty on 07-18-2010 at 05:47 PM

Download the latest released beta of Screenshot Sender here http://beta.screenshotsender.com/beta.

Change the code in timer.js to the following:

Javascript code:
/*
 * -----
 * Screenshot Sender - timer.js
 * -----
 * Handles all timer functions for Screenshot Sender
 * -----
 */
 
var sWindow = '';
 
function OnEvent_Timer(sTimerId) {
    _debug.getfuncname(arguments);
    switch (sTimerId.toLowerCase()) {
        case 'countdown':
            if (TimerValue !== 0) {
                var s = (TimerValue < 10 ? '0' : '') + TimerValue;                objWindows['Countdown'].SetControlText('lblTimer', s);                 var o = objCWindows[objWindows['Countdown'].Handle].ChatWnd;                if (o.EditChangeAllowed === true) {                    o.SendMessage(s);                }                --TimerValue;
                MsgPlus.AddTimer(sTimerId, 1000);
            } else if (TimerValue === 0) {
                _win32.ShowWindow(objWindows['Countdown'].Handle, _win32._const._SW_HIDE);
                var o = objCWindows[objWindows['Countdown'].Handle];
                CommandToFunction(o.ChatWnd, o.SaveImage, o.Command);
                CloseWindow('Countdown');
                IsTimerActive = false;
            }
            break;
        case 'window':
            sWindow = 'WindowSelect';
        case 'pcc' :
            if (sWindow === 'WindowSelect' && new_hWnd !== _win32.GetForegroundWindow()) {
                MsgPlus.AddTimer('window', 200);
                return;
            }
            if (sWindow === '') sWindow = 'PointClickCapture';
            var lWindowRect = Interop.Allocate(16);
            var hWnd = _win32.GetForegroundWindow();
            _win32.GetWindowRect(hWnd, lWindowRect);
           
            var objCWindow = objCWindows[objWindows[sWindow].Handle];
            var oGdip = new Gdip(objCWindow.SaveImage);
            oGdip.Initialize();
            if (oGdip.Initialized == true) {
                oGdip.SaveImage(oGdip.CaptureWindow(hWnd, lWindowRect, false, false, true), SessionImages.CreateTempImage());
                if (oGdip.SaveSuccessful == true /*[Ok]*/) {
                    if (objCWindow.SaveImage == false) {
                        if (objPreferences['cPreviews'] == true) {
                            Preview(objCWindow.ChatWnd, oGdip.ImageLocation);
                        }
                        else {
                            try {
                                if (objCWindow.ChatWnd.Contacts.Count === 1) oChatWnd_SendFile(objCWindow.ChatWnd, oGdip.ImageLocation);
                                else ContactSelector(objCWindow.ChatWnd.Contacts);
                            } catch (e) {
                                var WndContactSelector = ContactSelector(Messenger.MyContacts);
                                objChatWnds[WndContactSelector.Handle] = {};
                                objChatWnds[WndContactSelector.Handle].Image = oGdip.ImageLocation;
                            }
                        }
                    } else {
                        if (objPreferences['cPreviews'] == true) {
                            Preview(objCWindow.ChatWnd, oGdip.ImageLocation, true);
                        } else {
                            SessionImages.MoveTempImage(oGdip.ImageLocation, SessionImages.CreateImagePath());
                            if ((objPreferences['cUploadScreenshots'] == true && objPreferences['cUploadOptions'] === 0) ||
                                (SaveImage === false && objPreferences['cUploadOptions'] === 1) ||
                                (SaveImage === true && objPreferences['cUploadOptions'] === 2)) {
                                Ftp_UploadFile(oGdip.ImageLocation, false, objCWindow.ChatWnd, true);
                            }
                        }
                    }
                }
            }
            CloseWindow(sWindow);
            oGdip.Uninitialize();
            sWindow = '';
           
            if (bMinimized === true) {
                _win32.ShowWindow(hWnd, _win32._const._SW_SHOWMINIMIZED);
                _win32.SetForegroundWindow(pre_hWnd);
                bMinimized = false;
            }
            break;
    }
}