Leaderboard
Popular Content
Showing content with the highest reputation on 06/26/2014 in all areas
-
AudioBox - simple BASS.dll music player
mesale0077 reacted to scintilla4evr for a topic
I'd like to introduce you AudioBox - a simple music player powered by BASS music library. Requires: >ID3 UDF by joeyb1275 AutoItObject BASS UDF AudioBox.zip1 point -
Some of Jerome Herr's processing code samples in AutoIt
UEZ reacted to DatMCEyeBall for a topic
I wrote this after seeing Jerome Herr's post on Tumblr and looking at the code here. A few Google searches later, I came up with these. #include <GDIPlus.au3> #include <Math.au3> ;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w- 7 Opt("GUIOnEventMode", 1) Global Const $nPI = 3.1415926535897932384626433832795 Global Const $nTWOPI = $nPI * 2 Global $iNum = 25 Global $nStep, $nSz, $nTheta $nStep = 20 Global $iMaxRad = ($iNum - 1) * $nStep Global $fClose = False Global $iW = $iMaxRad, $iH = $iMaxRad Global $hGUI = GUICreate('"Wave" by Jerome Herr | Written in AutoIt3 by EyeZiS', $iW, $iH) GUISetOnEvent(-3, "_Exit") _GDIPlus_Startup() Global $hCtxt = _GDIPlus_GraphicsCreateFromHWND($hGUI) Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hCtxt) Global $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2) Global $hPen = _GDIPlus_PenCreate(0xFFFFFFFF, 3, 2) Global $hTimer = TimerInit() GUISetState() While Not $fClose If TimerDiff($hTimer) >= 33 Then $hTimer = TimerInit() _Draw() _GDIPlus_GraphicsDrawImage($hCtxt, $hBitmap, 0, 0) ConsoleWrite(TimerDiff($hTimer) & @CRLF) EndIf Sleep(33 - TimerDiff($hTimer) - 1) WEnd _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hCtxt) GUIDelete() Func _Draw() _GDIPlus_GraphicsClear($hGraphics, 0xFF000000) Local $nArcEnd, $nOffset, $nDrawOffset For $i = 0 To $iNum - 1 $nSz = $i * $nStep $nOffset = $nTWOPI / $iNum * $i $nDrawOffset = $iMaxRad / 2 - $nSz / 2 $nArcEnd = _Degree(_Map(Sin($nTheta + $nOffset), -1, 1, $nPI, $nTWOPI) - $nPI) _GDIPlus_GraphicsDrawArc($hGraphics, $nDrawOffset, $nDrawOffset, $nSz, $nSz, 0, $nArcEnd, $hPen) _GDIPlus_GraphicsDrawArc($hGraphics, $nDrawOffset, $nDrawOffset, $nSz, $nSz, 180, $nArcEnd, $hPen) Next $nTheta += 0.0523 If $nTheta > $nTWOPI Then $nTheta = Mod($nTheta, $nTWOPI) EndIf EndFunc ;==>_Draw Func _Exit() $fClose = True EndFunc ;==>_Exit Func _Map($nVar, $nMin1, $nMax1, $nMin2, $nMax2) Return $nMin2 + ($nMax2 - $nMin2) * (($nVar - $nMin1) / ($nMax1 - $nMin1)) EndFunc ;==>_Map Playing with hue: #include <GDIPlus.au3> #include <Math.au3> #include <WinAPIGdi.au3> ;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w- 7 Opt("GUIOnEventMode", 1) Global Const $nPI = 3.1415926535897932384626433832795 Global Const $nTWOPI = $nPI * 2 Global $iNum = 25 Global $nStep, $nSz, $nTheta Global $iStHue = 0 $nStep = 20 Global $iMaxRad = ($iNum - 1) * $nStep Global $fClose = False Global $iW = $iMaxRad, $iH = $iMaxRad Global $hGUI = GUICreate('"Wave" by Jerome Herr | Written in AutoIt3 by EyeZiS', $iW, $iH) GUISetOnEvent(-3, "_Exit") _GDIPlus_Startup() Global $hCtxt = _GDIPlus_GraphicsCreateFromHWND($hGUI) Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hCtxt) Global $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2) Global $hPen = _GDIPlus_PenCreate(0xFFFFFFFF, 3, 2) Global $hTimer = TimerInit() GUISetState() While Not $fClose If TimerDiff($hTimer) >= 33 Then $hTimer = TimerInit() _Draw() _GDIPlus_GraphicsDrawImage($hCtxt, $hBitmap, 0, 0) ConsoleWrite("Draw: " & TimerDiff($hTimer) & @CRLF) EndIf Sleep(33 - TimerDiff($hTimer) - 1) WEnd _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hCtxt) GUIDelete() Func _Draw() _GDIPlus_GraphicsClear($hGraphics, 0x7F000000) Local $nArcEnd, $nOffset, $nDrawOffset For $i = 0 To $iNum - 1 $nSz = $i * $nStep $nOffset = $nTWOPI / $iNum * $i $nDrawOffset = $iMaxRad / 2 - $nSz / 2 $nArcEnd = _Degree(_Map(Sin($nTheta + $nOffset), -1, 1, $nPI, $nTWOPI) - $nPI) _GDIPlus_PenSetColor($hPen, "0xFF" & Hex(_WinAPI_ColorHLSToRGB($iStHue + $i, 120, 240), 6)) _GDIPlus_GraphicsDrawArc($hGraphics, $nDrawOffset, $nDrawOffset, $nSz, $nSz, 0, $nArcEnd, $hPen) _GDIPlus_GraphicsDrawArc($hGraphics, $nDrawOffset, $nDrawOffset, $nSz, $nSz, 180, $nArcEnd, $hPen) Next $nTheta += 0.0523 $iStHue += 0.5 _ModIfGreater($nTheta, $nTWOPI) _ModIfGreater($iStHue, 239) EndFunc ;==>_Draw Func _Exit() $fClose = True EndFunc ;==>_Exit Func _Map($nVar, $nMin1, $nMax1, $nMin2, $nMax2) Return $nMin2 + ($nMax2 - $nMin2) * (($nVar - $nMin1) / ($nMax1 - $nMin1)) EndFunc ;==>_Map Func _ModIfGreater(ByRef $nVar, $nMod) $nVar = ($nVar > $nMod) ? (Mod($nVar, $nMod)) : ($nVar) EndFunc >#6 - Trunk in space >#7 - Lava Lamp >#8 - Wavy Thing1 point -
I got this one and put it here btw. I can not remember from where, but I still have one UDF XML - see attached files MSXML.ZIP1 point
-
how to make secondary windows in the main window ?
yousefsamy reacted to JLogan3o13 for a topic
The problem, "bro", is when someone is too lazy to put forth any effort. This forum is designed around helping people better their scripts and scripting ability, not for spoon feeding you answers because you don't want to search for yourself. You have a history of threads now where people have directed you to either the forum search or the help file, and yet you feel no desire to use either one. Good luck1 point -
tcc is very small and could probably do this.1 point
-
Edit...beat me to it ^ Use a while loop...no recursion there. BTW, recursion is when you use a function to call it's self again, and again, and again, etc #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=upload.ico #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** FileInstall("D:\upload2.ico", @ScriptDir & "\upload2.ico") FileInstall("D:\upload.ico", @ScriptDir & "\upload.ico") ;$set = 0 While True $ping = Ping("google.com") If $ping = 0 or $ping = 1 or $ping = 2 or $ping = 3 or $ping = 4 Then TraySetIcon(@ScriptDir & "\upload2.ico") ;If $set = 0 Then ; MsgBox(64, "Network Offline", "Your OFFLINE!") ; $set = 1 ;EndIf EndIf TraySetIcon(@ScriptDir & "\upload.ico") WEnd1 point
-
First off, you can't turn it off. It's telling you that you've seriously screwed up somewhere within your script and it's preventing a catastrophe. Second, you're getting that warning because you're calling pingfunc() from within itself, you shouldn't be doing that. Third, you're not reading the return from Ping correctly, it returns 0 if it can't reach the target, @error gets set to any of the other numbers you're looking for, not the return from ping. Try it this way. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=upload.ico #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** FileInstall("D:\upload2.ico", @ScriptDir & "\upload2.ico") FileInstall("D:\upload.ico", @ScriptDir & "\upload.ico") ;$set = 0 pingfunc() Func pingfunc() While 1 $ping = Ping("google.com") If $ping = 0 Then TraySetIcon(@ScriptDir & "\upload2.ico") ;If $set = 0 Then ; MsgBox(64, "Network Offline", "Your OFFLINE!") ; $set = 1 ;EndIf Else ;If $set = 1 Then ; $set = 0 ; MsgBox(64, "Network Online", "Your ONLINE!") ;EndIf TraySetIcon(@ScriptDir & "\upload.ico") EndIf Sleep(1000) ; sleep for 1 second WEnd EndFunc ;==>pingfunc1 point
-
how can i change window style?
yousefsamy reacted to BrewManNH for a topic
Do a search on the forum for skinning your GUI, there's several UDFs out there. XSkin, USkin, EZSkin are 3 that come to mind right now.1 point -
XML.Dom: Global $sXML = '<?xml version="1.0" encoding="utf-8"?>' & @CRLF & _ "<Configuration>" & @CRLF & _ " <MajorVersion>1</MajorVersion>" & @CRLF & _ " <SubVersion>1</SubVersion>" & @CRLF & _ " <General>" & @CRLF & _ " <Language>0x0409</Language>" & @CRLF & _ " <AppCurrentMode>0x0001</AppCurrentMode>" & @CRLF & _ " <RunAtStartup>0</RunAtStartup>" & @CRLF & _ " <SaveMovieTo>X:\Storage Folder</SaveMovieTo>" & @CRLF & _ " <Transparency>0.855000</Transparency>" & @CRLF & _ " <Profile>" & @CRLF & _ " </Profile>" & @CRLF & _ " <Skin>std</Skin>" & @CRLF & _ " <Device>" & @CRLF & _ " </Device>" & @CRLF & _ " <StandbyOSD>0</StandbyOSD>" & @CRLF & _ " <CaptureOSD>1</CaptureOSD>" & @CRLF & _ " <SnapshotOSD>1</SnapshotOSD>" & @CRLF & _ " <DiskOSD>1</DiskOSD>" & @CRLF & _ " <StreamOSD>1</StreamOSD>" & @CRLF & _ " <MicOSD>1</MicOSD>" & @CRLF & _ " <TimeShiftMode>0</TimeShiftMode>" & @CRLF & _ " <PreviewMute>0</PreviewMute>" & @CRLF & _ " </General>" & @CRLF & _ " <Stream>" & @CRLF & _ " <ActiveService>" & @CRLF & _ " </ActiveService>" & @CRLF & _ " </Stream>" & @CRLF & _ "</Configuration>" $oXML = ObjCreate("Microsoft.XMLDOM") $oXML.loadXML($sXML) $oSaveMovieTo = $oXML.SelectSingleNode("//General/SaveMovieTo") ConsoleWrite($oSaveMovieTo.text & @CRLF)1 point
-
Global $sXML = '<?xml version=" 1.0" encoding=" utf - 8"?>' & @CRLF & _ "<Configuration>" & @CRLF & _ " <MajorVersion>1</MajorVersion>" & @CRLF & _ " <SubVersion>1</SubVersion>" & @CRLF & _ " <General>" & @CRLF & _ " <Language>0x0409</Language>" & @CRLF & _ " <AppCurrentMode>0x0001</AppCurrentMode>" & @CRLF & _ " <RunAtStartup>0</RunAtStartup>" & @CRLF & _ " <SaveMovieTo>X:\Storage Folder</SaveMovieTo>" & @CRLF & _ " <Transparency>0.855000</Transparency>" & @CRLF & _ " <Profile>" & @CRLF & _ " </Profile>" & @CRLF & _ " <Skin>std</Skin>" & @CRLF & _ " <Device>" & @CRLF & _ " </Device>" & @CRLF & _ " <StandbyOSD>0</StandbyOSD>" & @CRLF & _ " <CaptureOSD>1</CaptureOSD>" & @CRLF & _ " <SnapshotOSD>1</SnapshotOSD>" & @CRLF & _ " <DiskOSD>1</DiskOSD>" & @CRLF & _ " <StreamOSD>1</StreamOSD>" & @CRLF & _ " <MicOSD>1</MicOSD>" & @CRLF & _ " <TimeShiftMode>0</TimeShiftMode>" & @CRLF & _ " <PreviewMute>0</PreviewMute>" & @CRLF & _ " </General>" & @CRLF & _ " <Stream>" & @CRLF & _ " <ActiveService>" & @CRLF & _ " </ActiveService>" & @CRLF & _ " </Stream>" & @CRLF & _ "</Configuration>" Global $Value = _XML_GetElementContent($sXML, "Configuration.General.SaveMovieTo") ConsoleWrite("Error: " & @error & " - Value: " & $Value & @LF) Func _XML_GetElementContent($sXML, $sPath) ;funkey 2014.06.25 Local $sTemp, $aTemp Local $aPath = StringSplit($sPath, ".") $sTemp = $sXML For $i = 1 To $aPath[0] $aTemp = StringRegExp($sTemp, "(?s)(?i)<" & $aPath[$i] & "\b(.*?)</" & $aPath[$i] & ">", 3) If @error Then Return SetError($i, 0, "") $sTemp = StringStripWS(StringTrimLeft($aTemp[0], StringInStr($aTemp[0], ">")), 3) Next Return $sTemp EndFunc ;==>_XML_GetElementContent Edit: Updated code to find XML elements with attributes as well.1 point
-
The quoted SmOke_N keys are correct... Easy way to see what a key value is run this from scite and watch the console when pressing keys #include <Misc.au3> While 1 Sleep(50) For $i = 1 To 255 If _IsPressed(Hex($i, 2)) Then ConsoleWrite(Hex($i,2) & @LF) Next WEnd1 point