Leaderboard
Popular Content
Showing content with the highest reputation on 10/27/2012 in Posts
-
No it doesn't speak, I lied. That is impossible. It's about setting animated GIF (and every other type of images) to a GUI control. How is this done for animated GIF? Few simple steps: - created ImageList of GIF Bitmaps retrieved from gif file/resource - created Pic control - every now and then another image is displayed. This is determined by frame delay time - see gif specification somewhere. That's it. All that takes time and could potentially block our gui/script. That's why flying assembly is used. Animation is done in another thread different from one AutoIt's code is executed in. Nothing stops animation but you. Animation works both for x64 and x86. Also it works for all kind of images not only GIFs. That means you can use it to display PNGs, BMPs, JPGs, etc... All of them from resources too. Example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "GIFAnimation.au3" Opt("MustDeclareVars", 1) ; Start by choosing GIF to display Global $sFile = FileOpenDialog("Choose Image", "", "(*.gif;*.png;*.jpg;*.tiff;*.bmp;*.jpeg)", -1, "") If @error Then Exit ; Make GUI Global $hGui = GUICreate("GIF Animation", 500, 500, -1, -1, $WS_OVERLAPPEDWINDOW) ; Add some buttons Global $hButton = GUICtrlCreateButton("&Pause animation", 50, 450, 100, 25) Global $hButton1 = GUICtrlCreateButton("&Delete Control", 200, 450, 100, 25) Global $hButton2 = GUICtrlCreateButton("&Open Image", 350, 450, 100, 25) ; Make GIF Control Global $hGIF = _GUICtrlCreateGIF($sFile, "", 10, 10) If @extended Then GUICtrlSetState($hButton, $GUI_DISABLE) GUICtrlSetTip($hGIF, "Image") ; Additional processing of some windows messages (for example) GUIRegisterMsg(133, "_Refresh") ; WM_NCPAINT GUIRegisterMsg(15, "_ValidateGIFs") ; WM_PAINT Global $iPlay = 1 ; Show it GUISetState() ; Loop till end While 1 Switch GUIGetMsg() Case -3 Exit Case $hButton If $iPlay Then If _GIF_PauseAnimation($hGIF) Then $iPlay = 0 GUICtrlSetData($hButton, "Resume animation") EndIf Else If _GIF_ResumeAnimation($hGIF) Then $iPlay = 1 GUICtrlSetData($hButton, "Pause animation") EndIf EndIf Case $hButton1 _GIF_DeleteGIF($hGIF) Case $hButton2 $sFile = FileOpenDialog("Choose gif", "", "(*.gif;*.png;*.jpg;*.tiff;*.bmp;*.jpeg)", -1, "", $hGui) If Not @error Then _GIF_DeleteGIF($hGIF); delete previous $hGIF = _GUICtrlCreateGIF($sFile, "", 10, 10) If @extended Then GUICtrlSetState($hButton, $GUI_DISABLE) Else GUICtrlSetState($hButton, $GUI_ENABLE) EndIf GUICtrlSetTip($hGIF, "Image") $iPlay = 1 GUICtrlSetData($hButton, "Pause animation") EndIf EndSwitch WEnd Func _Refresh($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GIF_RefreshGIF($hGIF) EndFunc ;==>_Refresh Func _ValidateGIFs($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GIF_ValidateGIF($hGIF) EndFunc ;==>_ValidateGIFs It should be 0% cpu. Download from here if you want to impress chicks: http://code.google.com/p/gif-animation/downloads/list There are 8 examples in there. GIF files are downloaded automatically if some example script needs it. Mostly from photobucket.com. Some examples work without classic download. Required data is get with InetRead(). That's mighty cool. So, download, open ZIP, grab folder inside and place it where you want. Run examples and that's it. Word or two about main function, _GUICtrlCreateGIF(). It can handle all sorts of input. Will display Images that are passed as binary, resource identifiers, strings, file names, ... everything. If it's valid image all works. For example, all this is valid: ; Pass GIF File path/name _GUICtrlCreateGIF("Some.gif", "", 10, 10) ; Binary data _GUICtrlCreateGIF($bGIF, "", 10, 10,) ; PE Resource (file GIF.dll, Type: GIF, Name: 4) _GUICtrlCreateGIF("GIF.dll", "GIF;4", 10, 10, 100, 120) ; PE Resource (file @AutoItExe, Type: RES, Name: BLAH, Language: 1033) _GUICtrlCreateGIF(@AutoItExe, "RES;BLAH;1033", 10, 10) ; PE Resource (file "explorer.exe", Type: 2, Name: 6801) _GUICtrlCreateGIF("explorer.exe", "2;6801", 10, 10) ;<- BITMAP ; PE Resource (file @AutoItExe, Type: RC_DATA, Name: PNG) _GUICtrlCreateGIF(@AutoItExe, "10;PNG", 10, 10) ; GIF string _GUICtrlCreateGIF(FileRead("Some.gif"), "", 10, 10) ____________________________________________1 point
-
Just wanted to see if it could be done in WMI. Please let me know if any issues. Thanks. _WMI_IsProcessSuspended.au3 - Edit - Added "ThreadState" for accuracy. - Edit 2 - Added two different ways to check suspension and removed the SRE. - Edit 3 - Here is an alternate version that shows how many threads are suspended out of the total. _WMI_IsProcessSuspended_0.2.au31 point
-
@JScript Can you fix the ShowOriginalLineNumbers for this case : Global $aArray[8][3] = [ _ ;I'm a comment ["D1", "D2", 10], _ ... ;after Global $aArray[8][3] = [ _ ;I'm a comment $__iLineNumber=10 ;<<THE PROBLEM ["D1", "D2", 10], _ ... Of course I can do it myself, but it's better if you fix it for your next update. Br, FireFox.1 point
-
@Ontosy Here you go : #include <String.au3> ... Global $aPacket = _TCP_Recv(...) If Dec($aPacket[13]) = 80 Then ;Source port = 80 $sPacketText = _HexToString($aTCPPacket[20]) ... ;process EndIf In the $sPacketText you will have the request header where you will be able to retreive the URI. Br, FireFox.1 point
-
Did you try running post #6? I wouldn't consider Switch/Case suitable for such a large number of data combinations. All those hard-coded values will be a maintenance nightmare and require program recompiles any time a change is made. I'd suggest looking into loading arrays from an external file that can be easily updated without needing to recompile your program.1 point
-
Global $rack, $key, $version = "v1.8b" $hGui = GUICreate("Dain's Key Lookup Utility " & $version, 650, 160) $iInput = GUICtrlCreateLabel("Please enter the rack that you need to get into. This utility will then tell you which key opens that rack. You can also look up specific property names (but please note that feature is in progress and still experimental).", 10, 10, 600, 34) $iInput = GUICtrlCreateInput("Type a rack in the format 'CO1 AB123'", 10, 50, 220, 22) $iButton = GUICtrlCreateButton('Get', 10, 80, 120, 28) $iStatusBar = GUICtrlCreateLabel('StatusBar', 5, 160 - 20, 600, 17) GUISetState() While 1 Switch GUIGetMsg() Case $iButton $rack = GUICtrlRead($iInput) $validate = (StringLen($rack) > 1) If Not $validate Then _SetData("Oops - looks like you left the box empty. Please try again, or press Cancel to quit.") ; GUICtrlSetData($iStatusBar, "Oops - looks like you left the box empty. Please try again, or press Cancel to quit.") ContinueLoop Else $answer = GiveKey() _SetData($answer[0] & ', ' & $answer[1]) ; GUICtrlSetData($iStatusBar, $answer[0] & ', ' & $answer[1]) EndIf Case -3 ; MsgBox(4096, "Dain's Key Lookup Utility " & $version, "Thanks for using Dain's Key Lookup Utility. If you encountered any bugs, please report them to MY WORK EMAIL.") Exit EndSwitch WEnd Func _SetData($Data) GUICtrlSetData($iStatusBar, $Data) $trOper=1 For $i = 1 to 4 GUICtrlSetBkColor ($iStatusBar, 0xff0000 ) GUICtrlSetColor ($iStatusBar, 0xffffff) Sleep(40) GUICtrlSetBkColor ($iStatusBar, -1 ) GUICtrlSetColor ($iStatusBar, 0xff0000) Sleep(40) Next EndFunc Func GiveKey() Local $answer[2] Switch $rack Case "CO1 AM123", "CO1 AM124" $key = "209 or 210" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AR111" $key = "171" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 DN102", "CO1 DN103" $key = "133 or 134" $msg = "To open the rack " & $rack & ", you need key number " & $key & "! Please note that these racks are for FTEs only." Case "CO1 DN111" $key = "142 or 143" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 DR102", "CO1 DR103", "CO1 DR104", "CO1 DR105", "CO1 DR106", "CO1 DR107", "CO1 DR108", "CO1 DR109" $key = "150 or 151" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 DN109" $key = "271 or 272" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 DN110" $key = "120 or 121" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 DN107", "CO1 DN108", "CO1 DJ425", "CO1 DJ426" $key = "269 or 270" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AL218" $key = "261 or 262" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AL217" $key = "184 or 185" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AD217", "CO1 AD218", "CO1 AD219", "CO1 AD220", "CO1 AD221", "CO1 AD222", "CO1 AD223", "CO1 AD224", "CO1 AD225", "CO1 AD226", "CO1 BQ202", "CO1 BQ203", "CO1 BQ204", "CO1 BQ205", "CO1 BQ206", "CO1 BQ207", "CO1 BQ208", "CO1 BQ209", "CO1 BQ210", "CO1 BQ211" $key = "129 or 130" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AP218", "CO1 AP219", "CO1 AP220", "CO1 AP221" $key = "152 or 153" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AR321" $key = "136 or 137" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AR322", "CO1 AW322", "CO1 AW323" $key = "138 or 139" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AR323", "CO1 AR324" $key = "140 or 141" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AR325", "CO1 AR326" $key = "146 or 147" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AR317", "CO1 AR318", "CO1 AR319", "CO1 AR320" $key = "267 or 268" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AH317", "CO1 AH318", "CO1 AH319", "CO1 AH320", "CO1 AH321", "CO1 AH322", "CO1 AH323", "CO1 AM317", "CO1 AM318", "CO1 AM319", "CO1 AM320", "CO1 AM321", "CO1 AM322", "CO1 AM323", "CO1 CX310", "CO1 CX311", "CO1 DH308", "CO1 DH309", "CO1 DM306", "CO1 DM307", "CO1 DM308", "CO1 DM309", "CO1 DM310", "CO1 DM311" $key = "257 or 258" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 BQ303" $key = "216 or 217" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AD317", "CO1 AD318", "CO1 AD319", "CO1 AD320", "CO1 AD321", "CO1 AD322", "CO1 AD323", "CO1 AD324", "CO1 AD325", "CO1 AD326", "CO1 AH324", "CO1 AH325", "CO1 AH326", "CO1 AM302", "CO1 AM303", "CO1 AM304", "CO1 AM305", "CO1 AM306", "CO1 AM307", "CO1 AM308", "CO1 AM309", "CO1 AM310", "CO1 AM311", "CO1 AM324", "CO1 AM325", "CO1 AM326", "CO1 AR302", "CO1 AR303", "CO1 AR309", "CO1 AR310", "CO1 AR311", "CO1 AW302", "CO1 AW303", "CO1 AW304", "CO1 AW305", "CO1 AW307", "CO1 AW308", "CO1 AW309", "CO1 AW311", "CO1 BB302", "CO1 BB303", "CO1 BB304", "CO1 BB305", "CO1 BB306", "CO1 BB307", "CO1 BB308", "CO1 BB310", "CO1 BB311", "CO1 BB318", "CO1 BB319", "CO1 BB320", "CO1 BB321", "CO1 BB322", "CO1 BB323", "CO1 BG302", "CO1 BG303", "CO1 BG304", "CO1 BG305", "CO1 BG306", "CO1 BG307", "CO1 BG308", "CO1 BG309", "CO1 BG310", "CO1 BG311", "CO1 BL302", "CO1 BL303", "CO1 BL304", "CO1 BL305", "CO1 BL306", "CO1 BL307", "CO1 BL308", "CO1 BL309", "CO1 BL310", "CO1 BL311", "CO1 BL312", "CO1 BL313", "CO1 BL314", "CO1 BL315", "CO1 BL316", "CO1 BQ304", "CO1 BQ305", "CO1 BQ306", "CO1 BQ307", "CO1 BQ308", "CO1 BQ309", "CO1 BQ310", "CO1 BQ311", "CO1 BQ312", "CO1 BQ313", "CO1 BQ314", "CO1 BQ315", "CO1 BQ316", "CO1 BU302", "CO1 BU303", "CO1 BU304", "CO1 BU305", "CO1 BU306", "CO1 BU307", "CO1 BU308", "CO1 BU309", "CO1 BU310", "CO1 BU311", "CO1 BU312", "CO1 BU313", "CO1 BU314", "CO1 BU315", "CO1 CI302", "CO1 CI303", "CO1 CI307", "CO1 CI308", "CO1 CI310", "CO1 CI311", "CO1 CI312", "CO1 CI313", "CO1 CI315", "CO1 CI316", "CO1 CI317", "CO1 CI319", "CO1 CI320", "CO1 CI321", "CO1 CI322", "CO1 CI323", "CO1 CI324", "CO1 CI325", "CO1 CN302", "CO1 CN303", "CO1 CN317", "CO1 CN318", "CO1 CN319", "CO1 CN320", "CO1 CS302", "CO1 CS303", "CO1 CX302", "CO1 CX303", "CO1 CX310", "CO1 CX311", "CO1 DC302", "CO1 DC303", "CO1 DC306", "CO1 DC307", "CO1 DC319", "CO1 DC323", "CO1 DC324", "CO1 DH302", "CO1 DH303", "CO1 DH304", "CO1 DH305", "CO1 DH306", "CO1 DH307", "CO1 DM302", "CO1 DM303", "CO1 DM304", "CO1 DM305", "CO1 DR302", "CO1 DR303", "CO1 DR304", "CO1 DR305", "CO1 DR306", "CO1 DR307", "CO1 DR308", "CO1 DR309" $key = "199, 200, 201, or 202" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AP222", "CO1 AP223", "CO1 AP224", "CO1 AP225", "CO1 AP226" $key = "236 or 237" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AW317", "CO1 AW318", "CO1 AW319", "CO1 AW320", "CO1 AW321" $key = "238 or 239" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AC303", "CO1 AC305", "CO1 AR305", "CO1 AR306", "CO1 AR307", "CO1 AR308", "CO1 AW310", "CO1 BQ302", "CO1 CN307", "CO1 CN310", "CO1 AH217", "CO1 AH218", "CO1 AH219", "CO1 AH220", "CO1 AH221", "CO1 AH222", "CO1 AH223", "CO1 AH224", "CO1 AH225", "CO1 AH226", "CO1 AL223", "CO1 AL224", "CO1 AL225", "CO1 AL226", "CO1 AY221", "CO1 AY222", "CO1 AY223", "CO1 AY224", "CO1 AY225", "CO1 AY226" $key = "240 or 241" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AD404", "CO1 AD405", "CO1 AD406", "CO1 AD407", "CO1 AD408", "CO1 AD409", "CO1 AD410", "CO1 DJ421", "CO1 DJ422", "CO1 DJ423", "CO1 DJ424", "CO1 DN417", "CO1 DN418", "CO1 DN419", "CO1 DN421", "CO1 DN422", "CO1 DN423", "CO1 DN424", "CO1 DN425", "CO1 DN426", "CO1 DR417", "CO1 DR418", "CO1 DR419", "CO1 DR420", "CO1 DR421", "CO1 DR422", "CO1 DR423", "CO1 DR424", "CO1 DR425", "CO1 DR426", "CO1 DN503", "CO1 DN504", "CO1 DN505", "CO1 DN506" $key = "242 or 243" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 DC319" $key = "144 or 145" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AD402", "CO1 AD403" $key = "176 or 177" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AD411" $key = "178" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 BL422", "CO1 BL423", "CO1 BL425" $key = "122 or 123" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 BL424", "CO1 BL426" $key = "193 or 194" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AP517" $key = "118 or 119" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AP518", "CO1 AP519" $key = "263 or 264" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AD517", "CO1 AD518", "CO1 AD519", "CO1 AD520", "CO1 AD521", "CO1 AD522", "CO1 AD523", "CO1 AD524", "CO1 AD525", "CO1 AH517", "CO1 AH518", "CO1 AH519", "CO1 AH520", "CO1 AH521", "CO1 AH522", "CO1 AH523", "CO1 AH524", "CO1 AH525", "CO1 AH526", "CO1 AL517", "CO1 AL518", "CO1 AL519", "CO1 AL520", "CO1 AL521", "CO1 AL522", "CO1 AL523", "CO1 AL524", "CO1 AL525", "CO1 AL526" $key = "131 or 132" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO1 AL219", "CO1 AL220", "CO1 AL221", "CO1 AL222", "CO2 AR116", "CO2 AR117", "CO2 AR118", "CO2 AR119" $key = "222 or 223" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO2 AD103", "CO2 AD104", "CO2 AD105", "CO2 AD106", "CO2 AD107", "CO2 AD108", "CO2 AD109", "CO2 AD110", "CO2 AD111", "CO2 AD112", "CO2 AD113", "CO2 AD114" $key = "265 or 266" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO2 AW103", "CO2 AW104", "CO2 AW105", "CO2 AW106", "CO2 AW107", "CO2 AW108", "CO2 AW109", "CO2 AW110", "CO2 DR203", "CO2 DR204", "CO2 DR205", "CO2 DR206", "CO2 DR207", "CO2 DR208", "CO2 DR209", "CO2 DR210", "CO2 DR211" $key = "164, 165, or 166" $msg = "To open the rack " & $rack & ", you need key number " & $key & "!" Case "CO2 AH315", "CO2 AH316", "CO2 AH317", "CO2 AH319", "CO2 AH320", "CO2 AH321", "CO2 AH322", "CO2 AH324", "CO2 AH325" $key = "214 or 215" $msg = "To open the rack " & $rack & ", you need key number " & $key & "! Please note that these racks are for FTEs only." Case "CO2 BB312", "CO2 BB313", "CO2 BB315", "CO2 BB316", "CO2 BB317" $key = "220 or 221" $msg = "To open the rack " & $rack & ", you need key number " & $key & "! Please note that these racks are for FTEs only." ;From here on, I've added a few cases so that the user can type the names of different properties to quickly look up their keys. Case "BPOS-S" $key = "199, 200, 201, or 202" $msg = "To open the racks for the property " & $rack & ", you need key number " & $key & "!" Case "FOPE" $key = "240 or 241" $msg = "To open the racks for the property " & $rack & ", you need key number " & $key & "!" Case "CTP" $key = "131 or 132" $msg = "To open the racks for the property " & $rack & ", you need key number " & $key & "!" Case "BPOS-D" $key = "257 or 258" $msg = "To open the racks for the property " & $rack & ", you need key number " & $key & "!" Case "MS Store" $key = "152 or 153" $msg = "To open the racks for the property " & $rack & ", you need key number " & $key & "!" Case "Lync" $key = "236 or 237" $msg = "To open the racks for the property " & $rack & ", you need key number " & $key & "!" Case Else $key = "- // - " $msg = "Sorry, '" & $rack & "' does not appear to be a recognized rack. If you are certain this rack exists but is not yet recognized by this program, please send a bug report to MY WORK EMAIL." EndSwitch $answer[0] = $key $answer[1] = $msg Return $answer EndFunc1 point
-
Need some assistance with a huge "if" statement
Dainish reacted to MilesAhead for a topic
Or as alternative, have an array key building function that builds a unique string from the factors. The data portion of an AssocArray can itself be an array or object. It's not limited to say, one key(as in key that fits the lock) number. You could have an array of possible keys for locks as just that data member. These wheels have already been implemented a zillion times. Might as well use a tool that's supposedly been debugged. But when new the feeling is to do things yourself to learn. Nothing wrong with that.1 point -
Haha, I was waiting for you to do it (Hi btw) It is really quite easy, as it's name suggest, the word boundary is related to the word sequence ( w ). It matches a boundary of a word but not an actual character (zero width assertion), in other words it matches bewtween a word character ( A-Z a-z 0-9 _ ) and a non-word character. For example, if you were to match groups of 3 digits you might write a pattern like this. #include <Array.au3> $aMatches = StringRegExp("123 456 7890", "d{3}", 3) ; matches 0:123, 1:456, 2:789 _ArrayDisplay($aMatches) Which matches "123" "456" and "789", now you can see the problem, the "789" was originally Not a group of 3 numbers, now let's try it with boundaries. #include <Array.au3> $aMatches = StringRegExp("123 456 7890", "bd{3}b", 3) ; matches 0:123, 1:456 _ArrayDisplay($aMatches) I hope this clears it up a bit. I'm betting you did not start the test with an SRE call you did not include in the timings, to start up the engine? ( First SRE call is significantly slower ) Edit: tidy.1 point
-
Global $rack = 0 Global $key = 0 While 1 GetRack() GiveKey() WEnd Func GetRack() Do $rack = InputBox("Dain's Key Lookup Utility", "Please enter the rack that you need to get into. This utility will then tell you which key opens that rack.", "Type a rack in the format 'CO1 AB123'", " M9") If @error Then MsgBox(4096, "Peace out, homie", "Thanks for using Dain's Key Lookup Utility.") Exit Else $validate = (StringLen($rack) = 9) If Not $validate Then MsgBox(4096, "YOU BROKE IT!", "Oops - looks like you left the box empty. Please try again, or press Cancel to quit.") EndIf Until $validate EndFunc Func GiveKey() Switch $rack Case "CO1 AM123", "CO1 AM124" $key = "209 or 210" MsgBox(4096, "Dain's Key Lookup Utility", "To open the rack " & $rack & ", you need key number " & $key & "!") Case "CO1 AR111" $key = "171" MsgBox(4096, "Dain's Key Lookup Utility", "To open the rack " & $rack & ", you need key number " & $key & "!") Case "CO1 DN102", "CO1 DN103" $key = "133 or 134" MsgBox(4096, "Dain's Key Lookup Utility", "To open the rack " & $rack & ", you need key number " & $key & "! Please note that these racks are for FTEs only.") Case Else MsgBox(4096, 'Error', 'Error') EndSwitch EndFunc1 point
-
Thats kinda tricky. zero can be valid. so can one. thats why the fuction passes it. (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) just verifys its a value 0 to 255. If you have a bunch like that I would add a second check for that. so something like: (?i)((?:(?:25[0-5]|2[0-4][0-9]|[1]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?):(?:[some port|statmests])) and not stringregexp($ip, '.0d?')1 point