Jump to content

Remote Control Via Msn Messenger


Recommended Posts

I was doing a remote control project and a MSN Messenger bot at the same time, and i wondered what would come out if i'd combine them. So i was scripting for about 5 minutes and then did a little debugging and here it is.

Notes:

  • Read Line 6 (Line 6 = Dim $conversation = "Conversation" ; <====== "Conversation" in English, "Gesprek" in Dutch etc. make sure this is right or it will fail)
  • Enable the little popup message when someone tells you something
  • You probably need a fairly new version of msn messenger. It was tested on MSN Messenger 7.5.
Syntax list(send this to the client):

MsgBoxTITLE~MESSAGE~command

Sends a message box with the custom TITLE and MESSAGE.

CDOpen~command

Opens all CD trays.

CDClose~command

Closes all CD trays. *(Kinda slow)

RunFILEPATH~command

Runs FILEPATH.

TypeMESSAGE~command

Equivalent of AutoIt's 'Send'.

VolumeNUMBER~command

Sets the wave volume to number in %.

CloseTITLE~command

Closes the window that has title TITLE.

TalkMESSAGE~command

WIN_XP Only i think, allows the PC to say something.

If OS is not WinXP the client will crash.

MouseBUTTON~X~Y~command

Clicks with BUTTON at X and Y coordinates.

MouseX~Y~command

Moves the mouse to X and Y coordinates.

BlockInput~command

AllowInput~command

Blocks and allows the user to type input.

Shutdown~command

Shuts the computer down.

If you want more commands you can script them on your own, it's not hard, look at the examples: there are plenty in my script.

Ok, have fun and i hope it works :think:

Opt("WinTitleMatchMode", 2)
Opt("TrayAutoPause",0)
Opt("SendKeyDelay", 1)

Dim $title, $msg
Dim $conversation = "Conversation" ; <====== "Conversation" in English, "Gesprek" in Dutch etc. make sure this is right or it will fail

While 1
    If WinExists("Alert") Then
        $title = StringSplit(StringTrimRight(WinGetTitle("Alert"), 8), @CRLF)
        If Not @error Then
            If StringInStr( StringRight($title[2], 12) , "~command") > 0 Then 
                ControlClick("Alert", "", "DirectUIHWND1")
                $succes = WinWaitActive($conversation,"", 4)
                If $succes Then
                    Sleep(10)
                    Send("{ESC}")
                    $data = StringTrimRight(StringStripWS($title[2], 3), 8)
                    If StringInStr($data, "MsgBox") > 0 Then
                        $abc = StringSplit(StringReplace($data, "MsgBox", ""), "~")
                        If $abc[0] = 2 Then
                            MsgBox(0, $abc[1], $abc[2])
                        ElseIf $abc[0] = 1 Then
                            MsgBox(0, "", $abc[1])
                        EndIf
                    EndIf
                    If StringInStr($data, "CDOpen") > 0 Then
                        $var = DriveGetDrive( "CDROM" )
                        If NOT @error Then
                            For $i = 1 to $var[0]
                                CDTray($var[$i], "Open")
                            Next
                        EndIf
                    EndIf
                    If StringInStr($data, "CDClose") > 0 Then
                        $var = DriveGetDrive( "CDROM" )
                        If NOT @error Then
                            For $i = 1 to $var[0]
                                CDTray($var[$i], "Close")
                            Next
                        EndIf
                    EndIf
                    If StringInStr($data, "Run") > 0 Then
                        $data = StringReplace($data, "Run", "")
                        Run($data)
                    EndIf
                    If StringInStr($data, "Type") > 0 Then
                        $data = StringReplace($data, "Type", "")
                        Send($data)
                    EndIf
                    If StringInStr($data, "Volume") > 0 Then
                        $data = StringReplace($data, "Volume", "")
                        SoundSetWaveVolume($data)
                    EndIf
                    If StringInStr($data, "Close") > 0 Then
                        $data = StringReplace($data, "Close", "")
                        WinClose($data)
                    EndIf
                    If StringInStr($data, "Talk") > 0 Then
                        $data = StringReplace($data, "Talk", "")
                        Local $o_speech = ObjCreate("SAPI.SpVoice")
                        $o_speech.Speak($data)
                        $o_speech = ""
                    EndIf
                    If StringInStr($data, "Mouse") > 0 Then
                        $abc = StringSplit(StringReplace($data, "Mouse", ""), "~")
                        If $abc[0] = 3 Then
                            If $abc[1] = "left" Then
                                MouseClick("left", $abc[2], $abc[3], 1, 0)
                            ElseIf $abc[1] = "right" Then
                                MouseClick("right", $abc[2], $abc[3], 1, 0)
                            EndIf
                        ElseIf $abc[0] = 2 Then
                            MouseMove($abc[1], $abc[2], 0)
                        EndIf
                    EndIf
                    If StringInStr($data, "BlockInput") > 0 Then
                        BlockInput(1)
                    EndIf
                    If StringInStr($data, "AllowInput") > 0 Then
                        BlockInput(0)
                    EndIf
                    If StringInStr($data, "Shutdown") > 0 Then
                        Shutdown()
                    EndIf
                EndIf
            EndIf
        Else
            ControlClick("Alert", "", "DirectUIHWND1")
            $succes = WinWaitActive($conversation,"",4)
            If $succes Then
                Send("{ESC}")
            EndIf
        EndIf
    EndIf
    Sleep(10)
WEnd
Edited by Manadar
Link to comment
Share on other sites

First you should, Enable the little popup message when someone tells you something It's under MSN Messenger's options somewhere you have probably seen it. Then you should log in on MSN, run the script.

And then get on a different computer if possible, logon a different account and send a message to the person who is running the client. For examples what to send look in my syntax list. You can also ask a friend to send you these commands.

Link to comment
Share on other sites

this is awesome! I'd like to note that the Shutdown command needs a number. 1 is shutdown

I have started to make a quick Commander to make things easier

;===============================================================================
;
; Program Name:   MSN Commander
; Description:: Sends commands on MSN to a pc running Manadar's MSN remote control
; Requirement(s):  AutoIt Beta
; Author(s):       RazerM
;
;===============================================================================
;
#include <GUIConstants.au3>

GUICreate("MSN Commander", 600, 500)
$convolist=GUICtrlCreateCombo("Choose Conversation.. (Press Update List to list new conversations)", 10, 365, 580)
$update = GUICtrlCreateButton("Update List", 10, 335, 80)
GUICtrlCreateGroup("MsgBox", 10, 10, 150, 90)
$msgtitle = GUICtrlCreateInput("Title", 15, 25, 140, 20)
$msgtext = GUICtrlCreateInput("Text", 15, 50, 140, 20)
$msgsend = GUICtrlCreateButton("Send", 40, 72, 80, 25)
GUICtrlCreateGroup("Block Input", 170, 10, 90, 80)
$inputblock = GUICtrlCreateButton("Block", 175, 25, 80, 25)
$inputallow = GUICtrlCreateButton("Allow", 175, 55, 80, 25)
GUICtrlSetState($inputallow, $GUI_DISABLE)
GUICtrlCreateGroup("CD Door", 270, 10, 90, 80)
$cdopen = GUICtrlCreateButton("Open", 275, 25, 80, 25)
$cdclose = GUICtrlCreateButton("Close", 275, 55, 80, 25)
GUISetState()
ListMSN()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $update
            ListMSN()
        Case $msgsend
            WinActivate(GUICtrlRead($convolist))
            Send("MsgBox" & GUICtrlRead($msgtitle) & "~" & GUICtrlRead($msgtext) & "~command{ENTER}")
        Case $inputblock
            WinActivate(GUICtrlRead($convolist))
            Send("BlockInput~command{ENTER}")
            GUICtrlSetState($inputblock, $GUI_DISABLE)
            GUICtrlSetState($inputallow, $GUI_ENABLE)
        Case $inputallow
            WinActivate(GUICtrlRead($convolist))
            Send("AllowInput~command{ENTER}")
            GUICtrlSetState($inputblock, $GUI_ENABLE)
        Case $cdopen
            WinActivate(GUICtrlRead($convolist))
            Send("cdopen~command{ENTER}")
        Case $cdclose
            WinActivate(GUICtrlRead($convolist))
            Send("cdclose~command{ENTER}")
    EndSwitch
WEnd

Func ListMSN()
    $var = WinList()
    For $i = 1 to $var[0][0]
; Only display visble windows that have a title
    If $var[$i][0] <> "" AND IsVisible($var[$i][1]) And StringInStr($var[$i][0], "- Conversation") Then
        GUICtrlSetData($convolist, $var[$i][0])
    EndIf
    Next
EndFunc

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf
EndFunc
Edited by RazerM
My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

  • 11 months later...

woah this is so 1337!!!! im going to have to modify this to do some other stuff >=D

EDIT: is it just me, i cant see it ><

EDIT2: sorry about bumping this, i just saw this in a thread in general help and support and didnt notice how old it was

Edited by Flamingwolf
Link to comment
Share on other sites

  • 2 weeks later...

I realise this thread is really old. But is it possible to make it read the conversation window, instead of the message chat box in the courner?

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

They need to have the program on their computer, and have the convo window closed.

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

It should be posible to send any command with FileWrite and Run AutoItExe... (if it is installed on the PC)

Because now its pretty difficult to get more commands and its very much code...

Hope you know what I mean...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...