Leaderboard
Popular Content
Showing content with the highest reputation on 11/19/2015 in all areas
-
Hello. I did create these few functions several months ago. I post here, if it can interest someone. These functions based on WMI queries allow you to manage printers : add / delete printer, driver, port, or obtain configuration, set default printer ... I let you discover it with the code. Here is the list of the available functions : _PrintMgr_AddLocalPort _PrintMgr_AddLPRPort _PrintMgr_AddPrinter _PrintMgr_AddPrinterDriver _PrintMgr_AddTCPIPPrinterPort _PrintMgr_AddWindowsPrinterConnection _PrintMgr_CancelAllJobs _PrintMgr_CancelPrintJob _PrintMgr_EnumPorts _PrintMgr_EnumPrinter _PrintMgr_EnumPrinterConfiguration _PrintMgr_EnumPrinterDriver _PrintMgr_EnumPrinterProperties _PrintMgr_EnumPrintJobs _PrintMgr_EnumTCPIPPrinterPort _PrintMgr_Pause _PrintMgr_PortExists _PrintMgr_PrinterExists _PrintMgr_PrinterSetComment _PrintMgr_PrinterSetDriver _PrintMgr_PrinterSetPort _PrintMgr_PrinterShare _PrintMgr_PrintTestPage _PrintMgr_RemoveLocalPort _PrintMgr_RemoveLPRPort _PrintMgr_RemovePrinter _PrintMgr_RemovePrinterDriver _PrintMgr_RemoveTCPIPPrinterPort _PrintMgr_RenamePrinter _PrintMgr_Resume _PrintMgr_SetDefaultPrinter And some examples : #include <Array.au3> #include "PrintMgr.au3" _Example() Func _Example() ; Remove a printer called "My old Lexmark printer" : _PrintMgr_RemovePrinter("My old Lexmark printer") ; Remove the driver called "Lexmark T640" : _PrintMgr_RemovePrinterDriver("Lexmark T640") ; Remove the TCP/IP printer port called "TCP/IP" _PrintMgr_RemoveTCPIPPrinterPort("MyOLDPrinterPort") ; Add a driver, called "Samsung ML-451x 501x Series", and driver inf file is ".\Samsung5010\sse2m.inf" _PrintMgr_AddPrinterDriver("Samsung ML-451x 501x Series", "Windows NT x86", @ScriptDir & "\Samsung5010", @ScriptDir & "\Samsung5010\sse2m.inf") ; Add a TCP/IP printer port, called "MyTCPIPPrinterPort", with IPAddress = 192.168.1.10 and Port = 9100 _PrintMgr_AddTCPIPPrinterPort("MyTCPIPPrinterPort", "192.168.1.10", 9100) ; Add a printer, give it the name "My Printer", use the driver called "Samsung ML-451x 501x Series" and the port called "MyTCPIPPrinterPort" _PrintMgr_AddPrinter("My Printer", "Samsung ML-451x 501x Series", "MyTCPIPPrinterPort") ; Set the printer called "My Printer" as default printer _PrintMgr_SetDefaultPrinter("My Printer") ; Connect to the shared printer "\\192.168.1.1\HPDeskjetColor") _PrintMgr_AddWindowsPrinterConnection("\\192.168.1.1\HPDeskjetColor") ; List all installed printers Local $aPrinterList = _PrintMgr_EnumPrinter() _ArrayDisplay($aPrinterList) ; List all printers configuration Local $aPrinterConfig = _PrintMgr_EnumPrinterConfiguration() _ArrayDisplay($aPrinterConfig) ; List all installed printer drivers Local $aDriverList = _PrintMgr_EnumPrinterDriver() _ArrayDisplay($aDriverList) ; Retrieve the printer configuration for the printer called "Lexmark T640" $aPrinterConfig = _PrintMgr_EnumPrinterConfiguration("Lexmark T640") _ArrayDisplay($aPrinterConfig) ; Add a local printer port (for a file output) _PrintMgr_AddLocalPort("c:\temp\output.pcl") ; Remove the local port _PrintMgr_RemoveLocalPort("c:\temp\output.pcl") ; Enum a print job Local $aJobList = _PrintMgr_EnumPrintJobs() _ArrayDisplay($aJobList) EndFunc ;==>_Example Download link : PrintMgr_Example.au3 PrintMgr.au31 point
-
Windows Firewall UDF
Keithw reacted to JLogan3o13 for a topic
I dug this UDF out in response to a request in the General Help forum. There is still some tidying to do, but I thought I would post here for anyone that would benefit. All functions have been tested on both XP and Windows 7. Updated January 22, 2014: Tested on XP, WIN7 and WIN8.1, x86 and x64 Current version includes: Enable or Disable the Windows Firewall Add or Remove Authorized Applications to the Exclusions list Add or Delete Ports from the Exclusions list. Enable or Disable the use of Exceptions Enable or Disable Notifications of blocked applications Enable or Disable Existing Ports List all Applications in the Exclusions List List all Ports in the Exclusions List List Properties of the current Firewall Configuration Restore the Windows Firewall to its default configuration Windows Firewall.au31 point -
StreamHelper
Mobius reacted to AdmiralAlkex for a topic
Give the script your username on Twitch or Hitbox (empty string to skip) and it'll alert you when the people you are following goes online. $sTwitchUsername = IniRead(@ScriptDir & "\Settings.ini", "Section", "Twitch", "") ;NAME ON TWITCH $sHitboxUsername = IniRead(@ScriptDir & "\Settings.ini", "Section", "Hitbox", "") ;NAME ON HITBOX $iMinRefresh = IniRead(@ScriptDir & "\Settings.ini", "Section", "RefreshMinutes", 5) ;HOW MANY MINUTES BETWEEN EVERY CHECK FOR NEW STREAMSUses Livestreamer for playback if available (highly recommended) otherwise opens in your browser. In comparison to similar scripts that I have seen posted here, this takes your username and pulls the people you are already following instead of having you manually entering everyone again, greatly simplifying things. The Twitch and Hitbox API's were largely implemented by glancing at the python-twitch and Hitboxy python libs. For the future, I'm thinking maybe quality-selector, nicer popup instead of traymenu and balloon tip (maybe some sort of toast thing) and SVPtube-like functionality (play link from clipboard) Uses A Non-Strict JSON UDF. Download from Downloads or GitHub (both source and executable available at both locations). Old attachments had 16 downloads.1 point -
StreamHelper
Mobius reacted to AdmiralAlkex for a topic
Yeah the tray menu is not great at all, I agree. But I'm hesitant to work much more on it, I think I would rather replace it with something else completely. Like, you click the icon, up pops a GUI with sorting, categories, search, thumbnails and all that cool stuff. No idea yet though how it would look and work. The next update will probably be play link from clipboard (only if you have Livestreamer installed). Maybe after that if I find the inspiration and time... I like that. They could have more eye-catching notifications so you don't miss 'em as easily. And be placed in the list so they are the fastest to click on.1 point -
Sorry, the ^ was missing. Try now, I edited my code1 point
-
This example appears to work. ConsoleWrite(_CeilingEx(0.01, 0.04) & @LF) ConsoleWrite(_CeilingEx(0.07, 0.04) & @LF) ConsoleWrite(_CeilingEx(0.09, 0.04) & @LF) ConsoleWrite(_CeilingEx(-0.01, 0.04) & @LF) ConsoleWrite(_CeilingEx(-0.05, 0.04) & @LF) ConsoleWrite(_CeilingEx(-0.09, 0.04) & @LF) ; https://www.autoitscript.com/forum/topic/130951-price-problem/?do=findComment&comment=911767 ; Round up towards positive infinity. Func _CeilingEx($n, $x = 0.01) Return Ceiling($n / $x) * $x EndFunc ;==>_CeilingEx #cs ; Returns:- 0.04 0.08 0.12 0 -0.04 -0.08 #ce1 point
-
or this ? Global $sCharAllowed = "\w;!#$%&'\(\)+,-.=@\[\]^`{}~" Local $uStringIN = "頹-衙-浳-浤-搰-橱-煪๏๐๑๒๖๚๛ẀẁẂẴẵẶặẸẹẺẻỈỉỊịỌÆ¢™®¯ÌÍÎÏÐÑ×ØÙòóôŘřŢţŷŸǾǿ₪₫€℅l№™Ωe⅛∑-/•v8∫˜≠==□ּׂאַאָאּבּגּדּהּוּזטּיּךּכשּתּוֹבֿכֿפֿﭏﭽﮊﮋﮏﮐﮑﮒﮓﮔﺅﺆﺇﺈﺉﺊﺋﺛﺜﺝﺮﺯﺰﺱﻐﻑﻒﻓﻔﻕﻟﻠﻡﻢﻣﻤﻥﻦﻧﻨﻰﻱﻲﻳﻴﻵﻶﻷﻸﻹﻺﻻﻼْ%-㍱-煱-둻-睤-㌹-" $replace = StringRegExpReplace($uStringIN, "[^" & $sCharAllowed& "]", "_") MsgBox(0, "", @CRLF & $replace & @CRLF)1 point
-
Not tested but this should work $lStringOUT = StringRegExpReplace($uStringIN, '[[:^print:]]', "_")1 point
-
What happened with my software?
minxomat reacted to JLogan3o13 for a topic
@MrTheDzam you keep getting the same answer (and will continue to do so) because it is obvious you haven't expended the effort to read the thread you're being pointed to. Do so and maybe your questions will be answered1 point -
1 point
-
https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_GetParentProcess.htm https://www.autoitscript.com/autoit3/docs/libfunctions/_ProcessGetName.htm1 point
-
Since you will need to include the encryption key within your script, probably not too secure. Edit: didn't see that you didn't want that answer until after I posted it.1 point
-
Here's a solution that drops items if not enough columns are available, or stops overwriting if too many columns exist. Perhaps it's an idea to play around with. #include <Array.au3> Local $aArray = [['a1','a2','a3','a4'],['b1','b2','b3','b4'],['c1','c2','c3','c4']] _ArrayDisplay($aArray, 'before') Local $aRow = ['d1','d2','d3','d4','d5'], $iRowNum = 1 _RowOverwrite($aArray, $aRow, $iRowNum) _ArrayDisplay($aArray, 'after') Func _RowOverwrite(ByRef $aArray, $aRow, $iRowNum) If Not (IsArray($aArray) And IsArray($aRow) And IsInt($iRowNum)) Then Return SetError(1) ; one param is not an array, or $iRowNum is not an integer If UBound($aArray, 0) <> 2 Or UBound($aRow, 0) <> 1 Then Return SetError(2) ; one array dimension did not match If $iRowNum > UBound($aArray) -1 Then Return SetError(3) ; out of bounds row number Local $iItems = UBound($aRow), $iCols = UBound($aArray, 2) If $iItems > $iCols Then $iItems = $iCols For $i = 0 To $iItems - 1 $aArray[$iRowNum][$i] = $aRow[$i] Next EndFunc1 point