Jump to content

Auto It IM


Recommended Posts

There are several geeky students currently attending our High School. We are currently taking the last programming course that is offered. Several of us are playing around independantly with Auto It. Some students began bringing in Instant Messenger Services. So I had the idea to make an instant messenger of my own, that would use our current setup, and not open holes in our security. This project is still in it's begining stages, but I'm just trying to work out the bugs.

I am able to access command prompt because the teacher made all 7 of us administrators.

the code starts here.

run ("C:\WINNT\system32\cmd.exe", "" , @SW_Minimize)

$varComputer = inputbox ("Messanger Service", "What computer do you wish to send it to?")

$varText = inputbox ("Messanger Service", "What would you like to send?")

winactivate ("Command Prompt")

send ("Net Send " & $varcomputer & " " & $vartext )

send ("{Enter}", 0)

winclose ("Command Prompt")

the code ends here.

The program will open dos and input "Net Send (Computer number) (Message)", but won't hit Enter.

Please help me.

Noteworthy works:Fast Pixel SearchSigned: WG

Link to comment
Share on other sites

or:

#NoTrayIcon
#include <GUIConstants.au3>

If @OSType = "WIN32_WINDOWS" Then Exit

HotkeySet("^{TAB}", "hide")

$w = 300
$h = 40
$l = ( @DesktopWidth / 2 ) - ( $w / 2 )
$t = ( @DesktopHeight / 2 ) - ( $h / 2 )
$style = $WS_OVERLAPPED + $WS_SYSMENU + $WS_CAPTION + $WS_MINIMIZEBOX + $WS_VISIBLE
$dns = @IPAddress1

$gui = GUICreate("Net Send", $w, $h, $l, $t, $style)
$text = GUICtrlCreateInput("message", 0, 0, 300, 20)
$name = GUICtrlCreateInput($dns, 0, 20, 250, 20)
$send = GUICtrlCreateButton("Send", 250, 20, 50, 20, $BS_DEFPUSHBUTTON)

GUISetState()

GUICtrlSetState($text, $GUI_FOCUS)
GUICtrlSetFont($name, 9, 400, "", "Courier New")

While 1
  $msg = GUIGetMsg()
  Select
    Case $msg = $GUI_EVENT_CLOSE
      Exit
    Case $msg = $send
      If GUICtrlRead($text) <> "" and GUICtrlRead($name) <> "" and GUICtrlRead($text) <> "::source" Then
        RunWait(@COMSPEC & ' /c net send ' & GUICtrlRead($name) & ' "' & GUICtrlRead($text) & '"', @SystemDir, @SW_HIDE)
        MsgBox(266240, "Net Send", "The message was sent.")
      Else
        If GUICtrlRead($text) = "::source" Then
          FileInstall("F:\AutoItv3.0.103\GUI\netsend.au3", @TempDir & "\netsend.au3")
          Sleep(500)
          Run(@SystemDir & "\notepad.exe " & @TempDir & "\netsend.au3", @SystemDir, @SW_MAXIMIZE)
          Sleep(500)
          FileDelete(@TempDir & "\netsend.au3")
        Else
          MsgBox(266288, "Net Send", "The message was not sent.")
        EndIf
      EndIf
  EndSelect
  Sleep(10)
Wend

Func hide()
  HotkeySet("^{TAB}", "unhide")
  WinSetState("Net Send", "", @SW_HIDE)
EndFunc

Func unhide()
  HotkeySet("^{TAB}", "hide")
  WinSetState("Net Send", "", @SW_SHOW)
EndFunc

© Erifash

Link to comment
Share on other sites

There are several geeky students currently attending our High School. We are currently taking the last programming course that is offered. Several of us are playing around independantly with Auto It. Some students began bringing in Instant Messenger Services. So I had the idea to make an instant messenger of my own, that would use our current setup, and not open holes in our security. This project is still in it's begining stages, but I'm just trying to work out the bugs.

I am able to access command prompt because the teacher made all 7 of us administrators.

the code starts here.

run ("C:\WINNT\system32\cmd.exe", "" , @SW_Minimize)

$varComputer = inputbox ("Messanger Service", "What computer do you wish to send it to?")

$varText = inputbox ("Messanger Service", "What would you like to send?")

winactivate ("Command Prompt")

send ("Net Send " & $varcomputer & " " & $vartext )

send ("{Enter}", 0)

winclose ("Command Prompt")

the code ends here.

The program will open dos and input "Net Send (Computer number) (Message)", but won't hit Enter.

Please help me.

<{POST_SNAPBACK}>

Made on in Excell once, but AutoIt seems to be better (as you can grab the text off a message pop-up and keep a history off sended messages)

If your interested, i will see if i can find it (complete interface, password protected macro, hiding interface spreadsheet, .....)

Link to comment
Share on other sites

Made on in Excell once, but AutoIt seems to be better (as you can grab the text off a message pop-up and keep a history off sended messages)

If your interested, i will see if i can find it (complete interface, password protected macro, hiding interface spreadsheet, .....)

<{POST_SNAPBACK}>

No thanks, I would rather learn how to do it than to use someone's code.

Noteworthy works:Fast Pixel SearchSigned: WG

Link to comment
Share on other sites

I love the idea and your post got me thinking... which is why I will also attempt to code a simple IM program for use at school. I will post it when it gets done. Additionally, I was wondering if there was any way to recieve the netsends, (have the default application thats opening them send the text to my GUI instead of opening the messages itself) Any ideas?

Also, if you were wondering about the new account, I originally had an account with the name "McFries" but I beleive it got deleted from inactivity. (I visit the forums 3/4 times a week but never post ;P)

-ame1011

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

I love the idea and your post got me thinking... which is why I will also attempt to code a simple IM program for use at school. I will post it when it gets done. Additionally, I was wondering if there was any way to recieve the netsends, (have the default application thats opening them send the text to my GUI instead of opening the messages itself) Any ideas?

Also, if you were wondering about the new account, I originally had an account with the name "McFries" but I beleive it got deleted from inactivity. (I visit the forums 3/4 times a week but never post ;P)

-ame1011

<{POST_SNAPBACK}>

Not directly i think:

Just trow a

if winexists("title") then

$text = WinGetText ( "title" ) ;and add it to an editcontrol of your GUI

controlclick("title","","button1","left") ;to close the window

Endif

Put it in the while1 wend loop of your GUI window

Link to comment
Share on other sites

Not directly i think:

Just trow a

if winexists("title") then

$text = WinGetText ( "title" ) ;and add it to an editcontrol of your GUI

controlclick("title","","button1","left") ;to close the window

Endif

Put it in the while1 wend loop of your GUI window

<{POST_SNAPBACK}>

thanks... i was hoping I wouldnt have to do that... and instead of

controlclick("title","","button1","left") ;to close the window

you could use WinClose but i guess its the same thing.

-Also, It appears that we cannot use the net functions on the machines at school... *sigh* anyway, i may still give it a shot.

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

I am going to use use a loop that repetitively checks for open message boxes, and then sends the info to a VB form that I created to do the GUI interface.

but here is the revised code for sending

$Message = GUICtrlRead (lstDisplay)

$User = GUICtrlRead (txtSend)

run (@comspec)

sleep (500)

send ("Net Send " & $User & " " & $Message)

sleep (500)

send ("{ENTER}")

sleep (500)

send ("{Lshift}" & "{LAlt}" & "{F4}")

I am just having troble closing the command prompt window, without knowing the title.

I can use command prompt because the teacher made us Admins in order to use advanced functions in VB like saving and opening.

Edited by blahblahblah5038

Noteworthy works:Fast Pixel SearchSigned: WG

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...