Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function WiggleSend
- {
- param(
- [string] $InputObject
- )
- Add-Type -Assembly System.Windows.Forms
- Write-Host "Position the mouse to the left hand side of the screen"
- Start-Sleep -Seconds 10
- $currentPosition = [Windows.Forms.Cursor]::Position
- $InputObject = $InputObject + [char]3
- foreach($char in $InputObject.ToCharArray())
- {
- $charOffset = [int] $char
- [Windows.Forms.Cursor]::Position = New-Object Drawing.Point ($currentPosition.X + ($charOffset * 3)),$currentPosition.Y
- Start-Sleep -m 50
- [Windows.Forms.Cursor]::Position = $currentPosition
- Start-Sleep -m 50
- }
- }
- function WiggleReceive
- {
- Add-Type -Assembly System.Windows.Forms
- Start-Sleep -Seconds 10
- $currentPosition = [Windows.Forms.Cursor]::Position.X
- $baseX = $currentPosition
- $lastX = $baseX
- $sb = New-Object System.Text.StringBuilder
- while($true)
- {
- $currentPosition = [Windows.Forms.Cursor]::Position.X
- if($currentPosition -ne $lastX)
- {
- if($currentPosition -ne $baseX)
- {
- $result = [int] (($currentPosition - $baseX) / 3)
- if($result -eq 3)
- {
- return $sb.ToString()
- }
- else
- {
- $null = $sb.Append([char] $result)
- }
- }
- $lastX = $currentPosition
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement