aMSN Forums
May 20, 2013, 08:13:41 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: RemoteShell plugin for aMSN (Problem sending message)  (Read 2929 times)
ikermendi
Newbie

Offline Offline

Posts: 1


View Profile
« on: May 24, 2006, 11:00:33 pm »

I'm doing a plugin to control a remote computer with aMSN. The idea is, that a allowed_contact(configured by the user) can send a messages to a remote aMSN client and this aMSN client answear with the output of the command executed. For security, you can configure a sring with blocked commands.

The plugin accept the msg with a chat_msn_receive event and then it execute and save the output of the command on a variable. The problem is that i dont know how can i do to send this variable (command output) to the user automatically. Any ideas or examples?                                                                      
                                                                                                                                 
                      1)       USER {Send the command}--------------------------------------->REMOTE (aMSN) {Execute}                                    
                                                                                                               
                      2)     USER{View output on the chat}<----------------------------------REMOTE (aMSN) {Send command ouput}


thanks, iker.

PD: sorry, my english is very poor
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #1 on: May 25, 2006, 09:15:10 pm »

The easiest way is o look at the file remote.tcl it has simple code to do simple tasks.. here's the code that should do what you need, it's from the 'proc msg' function, so take a look there :
Code:
set input [text ${win_name}.tmp]
$input insert end "${message}"

::amsn::MessageSend $win_name $input

destroy $input


This should send the message (it makes amsn think that you typed the text in the input window, faking the input window.. I'm sure there's an easier/cleaner way, but sorry, I don't have time to look at the code right now to find the appropriate function.
good luck
Logged

KaKaRoTo
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!