
farouk12
Active Members-
Posts
29 -
Joined
-
Last visited
Recent Profile Visitors
farouk12's Achievements

Seeker (1/7)
9
Reputation
-
farouk12 reacted to a post in a topic: Help StringRegExp
-
JonnyQuy reacted to a post in a topic: Help StringRegExp
-
You want string between <ul> and </ul> ? if so. Stringregexp($String,"(?s)<ul>.*?\n(.*?)<\/ul>",3)
-
Stop fatal errors from crashing script run
farouk12 replied to SchneiMi's topic in AutoIt General Help and Support
by doing this it test if $oIE.document.location.href equal to 'http://www.leo.org' if yes then return 1 else it return 0. you can use execute to test if code doesn't throw error (Crash the script) but not use it change variable data. -
[PROJECT] Ailave Project Development
farouk12 replied to DynamicRookie's topic in AutoIt Projects and Collaboration
Interesting. -
well this is 8 years died topic //// but you can use this $n=0 For $i in $checkbox $n+=(GuiCtrlRead($i)=1?1:0) next msgbox(0,0,$n)
-
Stop fatal errors from crashing script run
farouk12 replied to SchneiMi's topic in AutoIt General Help and Support
what comes in the error dialog? -
SchneiMi reacted to a post in a topic: Stop fatal errors from crashing script run
-
Stop fatal errors from crashing script run
farouk12 replied to SchneiMi's topic in AutoIt General Help and Support
Mostly it execute expression (Like Execute("$F")) if it find error ( Variable not declared ). it return a non zero @error rather then crashing the script. -
Stop fatal errors from crashing script run
farouk12 replied to SchneiMi's topic in AutoIt General Help and Support
I don't have IE, but try to use Execute func in the before " If @error Then Return False " like Execute('$oIE.document.getElementsByName("myelem")[2]') if @error then exit 0 -
Extract input to an Excel file
farouk12 replied to KickStarter15's topic in AutoIt General Help and Support
Maybe Func _Switch($Id,$FirstId) ;$FirstId : First checkbox ID $N=int(($Id-$FirstId)/3) ;Get the raw of check boxes for $i = $N*3 to $N*3 + 2 if not (($i + $FirstId) = $Id) then GUICtrlSetState($i+$FirstId,4) else GUICtrlSetState($i+$FirstId,1) endif next endfunc -
Desktop -> View -> Small icons
farouk12 replied to SharkyEXE's topic in AutoIt General Help and Support
Nice. -
Hmm, Test this. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 811, 474, 461, 223) $ButtonFile1 = GUICtrlCreateButton("File1", 24, 16, 75, 25) $EditFile1 = GUICtrlCreateEdit("" & @CRLF, 24, 72, 137, 113, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_VSCROLL)) GUICtrlSetData(-1, "") $EditFile1Deleted = GUICtrlCreateEdit("" & @CRLF, 183, 72, 137, 113, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_VSCROLL)) GUICtrlSetData(-1, "") $EditFile1Leftovers = GUICtrlCreateEdit("" & @CRLF, 341, 74, 137, 113, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_VSCROLL)) GUICtrlSetData(-1, "") $ButtonFile2 = GUICtrlCreateButton("File 2", 24, 256, 75, 25) $EditFile2 = GUICtrlCreateEdit("" & @CRLF, 26, 311, 137, 113, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_VSCROLL)) GUICtrlSetData(-1, "") $EditFile2Deleted = GUICtrlCreateEdit("" & @CRLF, 181, 311, 137, 113, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_VSCROLL)) GUICtrlSetData(-1, "") $EditFile2Leftovers = GUICtrlCreateEdit("" & @CRLF, 342, 311, 137, 113, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_VSCROLL)) GUICtrlSetData(-1, "") $EditFile1File2Deleted = GUICtrlCreateEdit("" & @CRLF, 504, 72, 273, 353, BitOR($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_VSCROLL)) GUICtrlSetData(-1, "") $Label1 = GUICtrlCreateLabel("File 1", 24, 48, 29, 17) $Label2 = GUICtrlCreateLabel("Deleted File 1", 184, 48, 68, 17) $Label3 = GUICtrlCreateLabel("Leftovers File 1", 344, 48, 78, 17) $Label5 = GUICtrlCreateLabel("File 2", 27, 290, 29, 17) $Label6 = GUICtrlCreateLabel("Deleted File 2", 187, 290, 68, 17) $Label7 = GUICtrlCreateLabel("Leftovers File 2", 347, 290, 78, 17) $Label4 = GUICtrlCreateLabel("Combined all", 592, 48, 64, 17) $ButtonDelete = GUICtrlCreateButton("Delete same ones", 353, 216, 107, 49) $ButtonC = GUICtrlCreateButton("C", 736, 440, 43, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ButtonFile1 $AddTxtFile1 = FileOpen(@ScriptDir & '\File1.txt', 0) GUICtrlSetData($EditFile1, FileRead($AddTxtFile1)) Case $ButtonFile2 $AddTxtFile2 = FileOpen(@ScriptDir & '\File2.txt', 0) GUICtrlSetData($EditFile2, FileRead($AddTxtFile2)) Case $ButtonDelete _deletesimilarFile1() _deletesimilarFile2() _deletesimilarAll() Case $ButtonC ClipPut(GUICtrlRead($EditFile1File2Deleted)) ToolTip('Copied') sleep(800) ToolTip("") EndSwitch WEnd Func _deletesimilarFile1() $aEditReadFile1 = StringRegExp(GUICtrlRead($EditFile1),".+",3) $aUniques=_ArrayUnique($aEditReadFile1,0,0,0,0) For $i In $aUniques $aPos = _ArrayFindAll($aEditReadFile1, $i, 0, 0, 1) If UBound($aPos) > 1 Then GUICtrlSetData($EditFile1Deleted, $aUniques[$i] & @CRLF, 1) Next _ArraySort($aUniques) GUICtrlSetData($EditFile1Leftovers, _ArrayToString($aUniques,@CRLF), 1) EndFunc Func _deletesimilarFile2() $aEditReadFile2 = StringRegExp(GUICtrlRead($EditFile2),".+",3) $aUniques=_ArrayUnique($aEditReadFile2,0,0,0,0) For $i In $aUniques $aPos = _ArrayFindAll($aEditReadFile2, $i, 0, 0, 1) If UBound($aPos) > 1 Then GUICtrlSetData($EditFile2Deleted, $aUniques[$i] & @CRLF, 1) Next _ArraySort($aUniques) GUICtrlSetData($EditFile2Leftovers, _ArrayToString($aUniques,@CRLF), 1) EndFunc Func _deletesimilarAll() $arr = StringRegExp(GUICtrlRead($EditFile1Leftovers),".+",3) $arr2 = StringRegExp(GUICtrlRead($EditFile2Leftovers),".+",3) _ArrayConcatenate($arr , $arr2) ; and concatenate to get all nons $i=0 Do $aPos = _ArrayFindAll($arr, $arr[$i], 0, 0, 1) If UBound($aPos) > 1 Then $K=0 For $n In $aPos _ArrayDelete($arr , $n-$K) $K+=1 Next EndIf $i+=1 Until $i>ubound($arr) - 1 _ArraySort($arr) GUICtrlSetData($EditFile1File2Deleted, _ArrayToString($arr,@CRLF), 1) EndFunc
-
DynamicRookie reacted to a post in a topic: [GUI] Gui Function Help Needed
-
Nice could be good with MetroGui. but when i set alpha in Wi3SMenu_Create to number rather then -1 the whole menu doesn't display.
- 6 replies
-
- wi3smenu
- slide menu
-
(and 3 more)
Tagged with:
-
[GUI] Gui Function Help Needed
farouk12 replied to DynamicRookie's topic in AutoIt General Help and Support
Maybe This ;Script STRNG= 103494x104955x01 #include <Misc.au3> #Include <File.au3> #include <GuiConstants.au3> #INCLUDE <GuiConstantsEx.au3> #pragma compile(inputboxres, true) If Not (@ScriptName = "DynamicRookie's Colorized No. 103494x104955x01.au3") Then MsgBox(0, "Unofficial", "You are running an unnoficial version of STRNG: 103494x104955x01 by DynamicRookie, but feel free to use it below your own risk :)") ShellExecute("https://www.autoitscript.com/forum/profile/104955-dynamicrookie/") EndIf $StringVal116 = 1 $Const_Win32_idGetHandle = WinGetHandle("103494x104955x01", "1x1") Sleep (10) Hotkeyset("{=}", "_ResetVariable") SetError(0, 0, 0) $In01 = InputBox("In01", "Please enter the string you want to automate :)") If @error Then Call("ConsoleErrorFunction") EndIf $ID=MsgBox(4, "In03", "Want to enable _HasToRenewVal Function? (DEFAULT: Yes)") If $ID = 6 Then $_HTRVal = True Elseif $ID = 7 Then $_HTRVal = False EndIf Global $StringVal104910 = 0 ;Default String 0x0x1 :) Global $StringVal116 = 0 ;Custom String 0x5x1 :) Global $State = 1 Global $vReStr = '000' MsgBox(0, "DynaRookie", "Script made by DynamicRookie, for 103494 in AutoIt Forums") GUICreate("103494x104955x01", 400, 400, -1, -1, -1, -1) GUICtrlCreateLabel("103494x104955x01 Active Process", 10, 10, 100, 20, -1, -1) GUICtrlCreateLabel("Value Extension Macrostring: ", 10, 40, 100, 20) $vReStr = GUICtrlCreateLabel("N/V/R", 112, 40, 50, 20) GUICtrlCreateLabel("String Specified: # " & $In01 & " #, type K to type specified string.", 0, 100, 300, 20) GUISetState() Call("_D4N4M11CCKR010K133") ;It waits until u press K to check for $In03 and if checked to type type $In01 in the chat, then you need to press "=" key to enable the variable back, else ;If HasToRenew function is enabled you dont need to enable it back, ;else if the variable is already enabled and you dont want to make it type $In01 when you press K, press "=" when ;the variable is already enabled, it will deactivate it until you press "=" again. Func Init0() GUICtrlSetData($vReStr, 'Initializing: Control 0x1') $StatusString = "Init0" Sleep(1) $i_Win32_idPosition = WinGetPos("103494x104955x01", "1x2") $i_Win32_Status = "Active0" GUICtrlSetData($vReStr, 'Ready to use!') $StatusString = "RD1" Call("_D4N4M11CCKR010K133") EndFunc Func _D4N4M11CCKR010K133() While 1 If _IsPressed('4B') And $StringVal116 = 1 Then $StringVal104910 = 1 ExecuteFunction_0_0_0_1() EndIf Sleep(100) WEnd EndFunc Func _ResetVariable() If $State = 0 And $_HTRVal = True Then $State = 1 Call ("_D4N4M11CCKR010K133") Elseif $State = 1 And $_HTRVal = True Then $State = 0 Call ("_D4N4M11CCKR010K133") Else Call("_D4N4M11CCKR010K133") EndIf Endfunc Func ExecuteFunction_0_0_0_1() #forcedef $StatusString If $StatusString = "Init0" Then MsgBox(0, "Wait", "Please wait until it loads completely") Call("Init0") ElseIf $State = 1 And $_HTRVal = True Then GUICtrlSetData($vReStr, "Typing specified string") Send('' & $In01 & '', 1) $State = 0 GuiCtrlSetData($vReStr, "Sent function command!") Call("_D4N4M11CCKR010K133") ElseIf $State = 0 or $State = 1 And $_HTRVal = False Then GUICtrlSetData($vReStr, "Typing specified string") Send('' & $In01 & '', 1) GuiCtrlSetData($vReStr, "Sent function command!") Call("_D4N4M11CCKR010K133") Else Call("_D4N4M11CCKR010K133") EndIf EndFunc Func ConsoleErrorFunction() #forcedef $i_idTimeout_msg ConsoleWrite($Const_Win32_idGetHandle) MsgBox("1, 48, 256, 4096, 2097152", "Exception @error", "An Unexpected error has occurred, please contact DynamicRookie for help, in AutoIt forums ( This window will close in " & $i_idTimeout_msg & "seconds", $i_idTimeout_msg) Exit 0 If @error = 1 Then ConsoleWrite("User has decided: Cancel = Val. 2") Exit 0 ElseIf @error = 2 Then ShellExecute("https://www.autoitscript.com/forum/profile/104955-dynamicrookie/") ConsoleWrite("User has decided: Nothing = Val. 0") Exit 0 EndIf EndFunc -
Earthshine reacted to a post in a topic: Fast Sudoku solver (insane) in pure SQL[ite]
-
argumentum reacted to a post in a topic: Fast Sudoku solver (insane) in pure SQL[ite]
-
Fast Sudoku solver (insane) in pure SQL[ite]
farouk12 replied to jchd's topic in AutoIt Example Scripts
Well its not mine i got it from topic here (I dont know the link / Author). And thanks for the edit, now its good as example. I found out that back tracking is more effective in some situations, rather than the sql way.(Big deference)