Jump to content

farouk12

Active Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by farouk12

  1. You want string between <ul> and </ul> ? if so. Stringregexp($String,"(?s)<ul>.*?\n(.*?)<\/ul>",3)
  2. 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.
  3. 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)
  4. what comes in the error dialog?
  5. 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.
  6. 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
  7. 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
  8. 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
  9. 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.
  10. 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
  11. 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)
  12. that can be with backtracking but that will take a bit of time.
  13. that sad because its take less then 5 sec with backtracking algorithm built in autoit SudokuSolver.au3
  14. here is difficult one, the topic one solve it in more than 50 sec but yours couldn't solve it at all .61..7..3.92..3..............853..........5.45....8....4......1...16.8..6........
  15. In this way you will get Sudoku with many many many solutions .
  16. You will find the answer in this pdf (With all Information about making Sudoku) . Sudoku.pdf
  17. i mean Millisecond lol
  18. Its really faster without the obj. Now it take 30-60 sec was 500-600 sec huh
  19. Srry this will work the other had error Logic2.au3
  20. I think that will do it. Logic2.au3
  21. I already made the Gui of the game (need to add restart and new game buttons Later) but i need to make the contain first. http://prntscr.com/hvww7u
×
×
  • Create New...