Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/04/2022 in all areas

  1. CoePSX

    Drawing script

    Hi I've been working on this script in the last few days, and although it's not so small, I believe it can serve a few coding examples and provide some fun. It's idea is simple: It reads an image, makes it b/w, and using the mouse it draws this image. I made this to draw images on handwrite messages in MSN, but it can be tested in Paint or any other image editor. The image processing is done by capturing the image, and using the GetBitmapBits API to get the pixels' colors. Based on the pixels color and the set sensitivity, it will be either black or white (the black part is the one that is going to be drawn). The drawing was a little bit harder to get working on big images. To make it look more like drawing than like printing, the script draws black areas using recursion. In big areas this would overflow the call stack, so I use an array as a custom stack. The random drawing pattern is my favorite. This is practically useless, but I have a lot of fun using this in MSN. But people don't believe I draw that good... drawingscript.au3 mae.bmp
    1 point
  2. Subz

    how to sort this list

    Another way based on @taurus905 code: #include <Array.au3> Global $aProcesses = ProcessList() _ArrayDelete($aProcesses, 0) ;~ Delete first row _ArrayColDelete($aProcesses, 0) ;~ Delete first column _ArraySort($aProcesses) ;~ Sort Array _ArrayDisplay($aProcesses, ":: Before ::") For $i = UBound($aProcesses) - 1 To 0 Step - 1 If $aProcesses[$i][0] <=5 Then _ArrayDelete($aProcesses, $i) Next _ArrayDisplay($aProcesses, ":: After ::")
    1 point
  3. taurus905

    how to sort this list

    This isn't the shortest or best way, but it should allow you to follow and edit to suit your needs. ; Sort ProcessList #include <Array.au3> Global $sa2_ProcessList = ProcessList() _ArrayDisplay($sa2_ProcessList, "Original") _ArraySort($sa2_ProcessList, 0 , 1, 0, 1) ; Sort by 2nd column _ArrayDisplay($sa2_ProcessList, "Sorted") For $i = 1 To UBound($sa2_ProcessList) - 1 If $sa2_ProcessList[$i][1] <= 5 Then _ArrayDelete($sa2_ProcessList, $i) $sa2_ProcessList[0][0] -= 1 $i -= 1 Else ExitLoop EndIf Next _ArrayDisplay($sa2_ProcessList, "PIDs > 4") $sa2_ProcessList[0][1] = $sa2_ProcessList[0][0] & " PIDs > 4" _ArrayColDelete($sa2_ProcessList, 0) _ArrayDisplay($sa2_ProcessList, "Just PIDs > 4")
    1 point
  4. UPDATE: With the addition of the ObjCreateInterface function and enhanced COM functionality by trancexxx, these interfaces are now accessible directly in AutoIt. I've rewritten the plugin as a native UDF which will work when compiled as x64 as well. I've attached the new UDF as well as updated plugin and UDF versions of my OSD Volume script. UDF Example: #include <_AudioEndpointVolume.au3> ; ## Get current volume levels $vol = _GetMasterVolumeLevel() ConsoleWrite("Get Vol Error: " & @error & @CRLF) ConsoleWrite("Volume: " & $vol & " (decibels)" & @CRLF) $vol = _GetMasterVolumeLevelScalar() ConsoleWrite("Get Vol Error: " & @error & @CRLF) ConsoleWrite("Volume: " & $vol & " (scalar)" & @CRLF) ; ## Set new volume levels ConsoleWrite("Set vol to -20db..." & @CRLF) _SetMasterVolumeLevel(-20) ConsoleWrite("Set Vol Error: " & @error & @CRLF) $vol = _GetMasterVolumeLevel() ConsoleWrite("Get Vol Error: " & @error & @CRLF) ConsoleWrite("Volume: " & $vol & " (decibels)" & @CRLF) ConsoleWrite("Set vol to scalar 30..." & @CRLF) _SetMasterVolumeLevelScalar(30) ConsoleWrite("Set Vol Error: " & @error & @CRLF) $vol = _GetMasterVolumeLevelScalar() ConsoleWrite("Get Vol Error: " & @error & @CRLF) ConsoleWrite("Volume: " & $vol & " (scalar)" & @CRLF) ; ## Get volume range information ConsoleWrite("Get range info..." & @CRLF) $aInfo = _GetVolumeRange() ConsoleWrite("Get Range Error: " & @error & @CRLF) ConsoleWrite("MinDB: " & $aInfo[0] & @CRLF) ConsoleWrite("MaxDB: " & $aInfo[1] & @CRLF) ConsoleWrite("Increment: " & $aInfo[2] & @CRLF) ; ## Set mute states ConsoleWrite("Set mute on..." & @CRLF) _SetMute(1) ConsoleWrite("Set Mute Error: " & @error & @CRLF) $mute = _GetMute() ConsoleWrite("Get Mute Error: " & @error & @CRLF) ConsoleWrite("Muted: " & $mute & @CRLF) Sleep(2000) ConsoleWrite("Set mute off..." & @CRLF) _SetMute(0) ConsoleWrite("Set Mute Error: " & @error & @CRLF) $mute = _GetMute() ConsoleWrite("Get Mute Error: " & @error & @CRLF) ConsoleWrite("Muted: " & $mute & @CRLF) ; ## Get volume step info ; ## Steps range from 0 to nStepCount - 1 ConsoleWrite("Get step info..." & @CRLF) $aInfo = _GetVolumeStepInfo() ConsoleWrite("Get Step Error: " & @error & @CRLF) ConsoleWrite("Current step: " & $aInfo[0] & @CRLF) ConsoleWrite("Total steps: 0 to " & $aInfo[1] - 1 & @CRLF) ConsoleWrite("Increase 5 steps..." & @CRLF) For $i = 1 To 5 _VolumeStepUp() Next $aInfo = _GetVolumeStepInfo() ConsoleWrite("Get Step Error: " & @error & @CRLF) ConsoleWrite("Current step: " & $aInfo[0] & @CRLF) ConsoleWrite("Decrease 2 steps..." & @CRLF) For $i = 1 To 2 _VolumeStepDown() Next $aInfo = _GetVolumeStepInfo() ConsoleWrite("Get Step Error: " & @error & @CRLF) ConsoleWrite("Current step: " & $aInfo[0] & @CRLF) OLD PLUGIN VERSION vista_vol_plugin.zip _AudioEndpointVolume.au3 VolumeOSD.zip VolumeOSD_plugin.zip
    1 point
×
×
  • Create New...