Jump to content

Communicating over a network


Recommended Posts

I'm in a computer class at school, and I'm looking for some extra credit.

I was thinking of designing a program so the teacher could block input on all the computers, and each computer would simply mimmick his computer's mouse/keyboard input.

How would I do this aside from communicating in a file?

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

I'm in a computer class at school, and I'm looking for some extra credit.

I was thinking of designing a program so the teacher could block input on all the computers, and each computer would simply mimmick his computer's mouse/keyboard input.

How would I do this aside from communicating in a file?

<{POST_SNAPBACK}>

You could use the net send command. There is no other way than this and using a file.

[quote name='d2hacker88' date='Jan 6 2005, 05:10 PM']Can someone please help me out with autoit like gimme a link on how to use it cause i have no experience with computer languages and i'd like to make a program with autoit in order to empress my computer teacher.[right][snapback]52215[/snapback][/right][/quote]

Link to comment
Share on other sites

I don't believe the Messenger service is enabled on these computers, and how would that work?

That little annoying window that occasionally popped up from spammers?

I don't think those are enabled...

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

NET SEND isn´t a AutoIt-command, but a DOS-command..

It`s a service that is standard on Windows XP, 2000 and NT.

With NET SEND you can send messages over a network,

and a window will appear on the receivers computer.

You can make a script that waits for that window-title to exist

(in English the title is Messenger Service...it think) and make

it perform something on the receivers computer...

Try starting Run (Press Win + R) and input something like this :

NET SEND RECEIVERPC "shutdown pc"

(Change RECEIVERPC to the receivers computername or IP-address..)

Then, you could make it that, when for example the NET SEND-window pops up

and the text contains shutdown pc then it would shutdown the receiver`s pc..

This requires, of course, that the script is started on the receivers computer..

Hope that made it clear !

Good luck !

Link to comment
Share on other sites

That did indeed make it clear, thank you :)

I don't believe these computers have that enabled though, or how I'd send it to multiple computers...

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

You might be able to use VNC: http://www.realvnc.com/winvnc.html

It could allow your teacher to control a particular computer (with optionally blocking user input) OR allow the teacher's screen to appear on each student's monitor.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

This was a small challenge.

If the main PC has access to the other PCs and the users have access to the main PC you can use my scripts.

NOTE: Change the variables for your situation.

eg: $MainComp and the location of the INIfile on the main PC $INIFile

This is for the main PC:

DirCreate("C:\scripts")
$INIFile = "C:\scripts\send.ini"
While 1
   $input = InputBox("Text2Send", "Enter the keys you want the other computers to send.", "")
   If $input = "" Then
      INIWrite($INIFile, "Commands", "Send", "Exit Now")
      Exit
   EndIf
   INIWrite($INIFile, "Commands", "Send", $input)
   INIWrite($INIFile, "Commands", "LastTime", @HOUR & ":" & @MIN & ":" & @SEC)
   Sleep(100)
WEnd

And run this script on the other PCs:

$MainComp = "\\maincomputer"
$IniFile = $MainComp & "\C$\scripts\send.ini"
$LocalINI = @ScriptDir & "\send.ini"
Global $LastTime
While 1
   FileCopy($IniFile, $LocalINI)
   $SendInfo = INIRead($LocalINI, "Commands", "Send", "")
   $LastTime_now = INIRead($LocalINI, "Commands", "LastTime", "")
   If $SendInfo <> "" AND $LastTime <> $LastTime_now Then
      $LastTime = $LastTime_now
      If $SendInfo = "Exit Now" Then Exit
      Send($SendInfo)
   EndIf
   Sleep(100)
WEnd
Edited by SlimShady
Link to comment
Share on other sites

I agree Ultra is the best one for the Windows environment (which happens to be what we know everyone is on :))

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

I noticed DLLCALL function is now in 1.03, what DLL would I use to communicate over a network?

Would this be very hard?

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

I noticed DLLCALL function is now in 1.03, what DLL would I use to communicate over a network?

Would this be very hard?

<{POST_SNAPBACK}>

I see this becoming a problem in the future after DllCall() goes gold...

I hope that somewhere in the DllCall documentation that a paragraph similar to this appears (Minus any typo's/mis-spellings I may have):

DllCall() is intended to give users who are already familiar with the Windows API an opportunity to access raw API calls that would otherwise be unavailable.  It is not intended to be used by the inexperienced; meaning people not familiar with the Windows API or people not familiar with the DLL they are trying to use.  It is also not intended to bridge a gap between features that aren't/won't be implemented (Such as sockets/internet communication).  More specifically, any such attempt at doing such can be made by an individual, but support requests should be directed towards the author/distributor of the DLL rather than to AutoIt support since very likely the request deals more with how the DLL (or its contents) works as opposed to how AutoIt works with the DLL.

With that being said, I will admit that I am no expert on Windows sockets/network communication, however, I do not think you can use Winsocks (Windows socket layer) with AutoIt. Due to current limitations in how DllCall() works, it isn't possible to initialize the socket layer, meaning any attempt to use any of the socket functions will fail.
Link to comment
Share on other sites

No problem at all :)

But with you mentioning sockets, that just gave me a wonderful idea... LAN IRC chat room? :)

AutoIT could easily send many updates via that... but something that could send mouse movement updates every .25 seconds would be nice, I think that'd get flooded and take up too much ram pretty fast.

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

  • 4 months later...

ive made an remote thing for msn messenger....

it contains 2 scripts, one wich waits for the "has just logged in" window(wich runs one the remote computer)

and one wich i use on my computer to change name quickly(with use of msn +'s /nick)

else you could try making it with the "net send" messages but that only work over lan...

Link to comment
Share on other sites

I ended up using a protected Ini file, works fairly well/fast.

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
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...