XY16 Posted October 5, 2010 Posted October 5, 2010 hi check this script out. it uses beeps to indicate the x and y positions of the mouse. it won't beep unless the mouse is detected to have moved. $X = MouseGetPos(0) $Y = MouseGetPos(1) While 1 if $X = MouseGetPos(0) then Sleep(10) Else $X = MouseGetPos(0) Beep($X / 2,80) EndIf Sleep(10) if $Y = MouseGetPos(1) then Sleep(10) Else $Y = MouseGetPos(1) Beep($Y / 2,80) EndIf Sleep(10) WEnd Please note: If you plan on submitting any code snippits to my posts, please refrain from using the code tags as i use a screen reader and can't read the code properly, let alone copy it the way it should be.Thanks for your understanding.Best regardsXY16
Werty Posted October 5, 2010 Posted October 5, 2010 You could extend it with panning the sound balance, so you can hear if the sound comes from left or right (x position), and change the pitch for y position. Some guy's script + some other guy's script = my script!
XY16 Posted October 5, 2010 Author Posted October 5, 2010 hi werty that was my origional intention but don't quite know how i could get the beeps to pan from left to right. maybe if i could find a command to adjust the balance it might work, but what about computers that use the internal pc speaker to immit beeps? that speaker is mono i believe so i would have to find a way to force the beeps to be transmitted through the actual sound card. thanks for your advice. if you can think of a way to pan the beeps, i am open to suggestions. thanks Please note: If you plan on submitting any code snippits to my posts, please refrain from using the code tags as i use a screen reader and can't read the code properly, let alone copy it the way it should be.Thanks for your understanding.Best regardsXY16
guinness Posted October 5, 2010 Posted October 5, 2010 Pretty cool effect! UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
XY16 Posted October 5, 2010 Author Posted October 5, 2010 thanks guinness don't be offended, but that's my dogs name, simply because he's black and white. Please note: If you plan on submitting any code snippits to my posts, please refrain from using the code tags as i use a screen reader and can't read the code properly, let alone copy it the way it should be.Thanks for your understanding.Best regardsXY16
guinness Posted October 5, 2010 Posted October 5, 2010 Not at all It's a good name! UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
Werty Posted October 5, 2010 Posted October 5, 2010 Does it have to use beep ? How about using a small soundfile and use soundplay() Here's a link to some extra sound functions by Kip that have soundpanright() and soundpanleft(). http://www.autoitscript.com/forum/index.php?showtopic=67021&st=0&p=496026&hl=pan%20sound&fromsearch=1&#entry496026 Some guy's script + some other guy's script = my script!
Zibit Posted October 7, 2010 Posted October 7, 2010 yeh i like it gj the idea is 5 stars Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam
AlmarM Posted October 13, 2010 Posted October 13, 2010 Here's my mouse radar. Well actualy... Something like it. Global $iMouseX, $iMouseY $GUI = GUICreate("", 200, 200, @DesktopWidth - 230, @DesktopHeight - 350) GUISetBkColor(0x000000, $GUI) $hMousePointer = GUICtrlCreateLabel("", 0, 0, 1, 1) GUICtrlSetBkColor(-1, 0x00FF00) $hInfo = GUICtrlCreateLabel("", 10, 10, 50, 20) GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetBkColor(-1, -2) GUISetState() While Sleep(1000 / 60) ; 60 fps Switch GUIGetMsg() Case -3 Exit EndSwitch $iMouseX = MouseGetPos(0) $iMouseY = MouseGetPos(1) $iRound1 = Round($iMouseX / ((@DesktopWidth / 100) / 2), 0) $iRound2 = Round($iMouseY / ((@DesktopHeight / 100) / 2), 0) GUICtrlSetPos($hMousePointer, $iRound1, $iRound2) GUICtrlSetData($hInfo, $iRound1 & ", " & $iRound2) WEnd Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
Werty Posted October 13, 2010 Posted October 13, 2010 Here's my mouse radar.Cool, but rather useless for the OP as he is blind, hence using sound in his example Some guy's script + some other guy's script = my script!
jaberwacky Posted October 13, 2010 Posted October 13, 2010 How about instead of panning sounds from left to right instead have the pitches beep on and off constantly (beep beep beep) slow beeps mean the left side and fast beeps mean the right side. So if the mouse were at the top right then the beeps would be high pitched and occur more frequently and if the mouse were at the bottom left then the pitches would be low and the duration of the beeps would be slow. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
JohnOne Posted October 13, 2010 Posted October 13, 2010 Cool, but rather useless for the OP as he is blind, hence using sound in his example Selective quoting is akin to purposely forcing a post out of context.Here's my mouse radar.Well actualy... Something like it.Take your time to try and understand. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
iamtheky Posted October 13, 2010 Posted October 13, 2010 (edited) I like the panning, could probably use a little more restraint on the Y axis beeps, but Im sure that makes it less useful for the sightless. Once again, I am amazed by your efforts, The following script will utilize panning left to right on the (beep.mp3) of your choosing. It has to be an mp3 file (though im sure some other containers work as well) as WAVs and Midis are handled differently. http://www.losthatch.com/sounds/sound_effects/code_ok.mp3 is the file used in my example - set your path on line 12 Edit: Cleaned up some test code expandcollapse popup$X = MouseGetPos(0) $Y = MouseGetPos(1) While 1 if $X = MouseGetPos(0) then Sleep(10) Else _MCISendCommand('open "C:\code_ok.mp3" alias Song') $X = MouseGetPos(0) if $X < @DesktopWidth / 2 Then _SoundPanLeft("Song" , $X) ;~ Beep($X / 2,80) Else _SoundPanRight("Song" , @DesktopWidth - $X) Endif EndIf Sleep(10) if $Y = MouseGetPos(1) then Sleep(10) Else $Y = MouseGetPos(1) Beep($Y / 2,80) EndIf Sleep(10) WEnd Func _MCISendCommand($sCmd,$hWnd=0) Local $aRet=DllCall("winmm.dll","dword","mciSendStringW","wstr",$sCmd,"wstr","","uint",65536,"handle",$hWnd) If @error Then Return SetError(2,@error,"") If $aRet[0] Then Return SetError(3,0,$aRet[0]) Return $aRet[2] EndFunc Func _mciSendString2($String9) Local $iRet $iRet = DllCall("winmm.dll", "int", "mciSendStringA", "str", $String9, "str", "", "int", 65534, "hwnd", 0) If Not @error Then Return $iRet[2] EndFunc ;==>_mciSendString2 Func _SoundPanRight($sSnd_id, $Pan); $Pan: 0 - 1000, 1000= normal ;Declare variables Local $iRet If StringInStr($sSnd_id,'!') Then Return SetError(3, 0, 0); invalid file/alias if $Pan < 0 or $Pan > 1000 Then Return SetError(1, 0, 0) _SoundLeftOff ("Song") $iRet = _mciSendString2("setaudio " & FileGetShortName($sSnd_id) & " right volume to "&$Pan) _MCISendCommand('play Song notify') sleep (1000) _MCISendCommand('close Song') ;return If $iRet = 0 Then Return 1 Else Return SetError(1, 0, 0) EndIf EndFunc;==>_SoundPanRight Func _SoundPanLeft($sSnd_id, $Pan); $Pan: 0 - 1000, 1000= normal ;Declare variables Local $iRet If StringInStr($sSnd_id,'!') Then Return SetError(3, 0, 0); invalid file/alias if $Pan < 0 or $Pan > 1000 Then Return SetError(1, 0, 0) _SoundRightOff ("Song") $iRet = _mciSendString2("setaudio " & $sSnd_id & " left volume to "&$Pan) _MCISendCommand('play Song notify') sleep (1000) _MCISendCommand('close Song') ;return If $iRet = 0 Then Return 1 Else Return SetError(1, 0, 0) EndIf EndFunc;==>_SoundPanLeft Func _SoundLeftOff($sSnd_id); $Pan: 0 - 1000, 1000= normal ;Declare variables Local $iRet If StringInStr($sSnd_id,'!') Then Return SetError(3, 0, 0); invalid file/alias $iRet = _mciSendString2("setaudio " & FileGetShortName($sSnd_id) & " left off") ;return If $iRet = 0 Then Return 1 Else Return SetError(1, 0, 0) EndIf EndFunc;==>_SoundLeftOff Func _SoundLeftOn($sSnd_id); $Pan: 0 - 1000, 1000= normal ;Declare variables Local $iRet If StringInStr($sSnd_id,'!') Then Return SetError(3, 0, 0); invalid file/alias $iRet = _mciSendString2("setaudio " & FileGetShortName($sSnd_id) & " left on") ;return If $iRet = 0 Then Return 1 Else Return SetError(1, 0, 0) EndIf EndFunc;==>_SoundLeftOn Func _SoundRightOff($sSnd_id); $Pan: 0 - 1000, 1000= normal ;Declare variables Local $iRet If StringInStr($sSnd_id,'!') Then Return SetError(3, 0, 0); invalid file/alias $iRet = _mciSendString2("setaudio " & FileGetShortName($sSnd_id) & " right off") ;return If $iRet = 0 Then Return 1 Else Return SetError(1, 0, 0) EndIf EndFunc;==>_SoundRightOff Func _SoundRightOn($sSnd_id); $Pan: 0 - 1000, 1000= normal ;Declare variables Local $iRet If StringInStr($sSnd_id,'!') Then Return SetError(3, 0, 0); invalid file/alias $iRet = _mciSendString2("setaudio " & FileGetShortName($sSnd_id) & " right on") ;return If $iRet = 0 Then Return 1 Else Return SetError(1, 0, 0) EndIf EndFunc;==>_SoundRightOn Edited October 13, 2010 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now