kingjacob90 Posted October 11, 2018 Share Posted October 11, 2018 I have this very simple but possibly quite complicated idea for a program. It is kind of a rip of the "Find" function used in many programs and really is in a way a re-create. The problem is it take ages for the program to process the information and that is on a good PC (i5-6600, 16GB DDR4, SSD). The question, why? Why cant it work just like the find function, and how does the find function in many programs work so efficiently? Website for the words file as only allowed 4MB and it is 5MB : https://raw.githubusercontent.com/dwyl/english-words/master/words.txt Code: #include <File.au3> $Letters = InputBox("Letters","Input the letters you have.","","") If @error Then Exit $File_Words = @ScriptDir&"\words.txt" $Words = "Words:" $Amount = StringLen($Letters) $lines = _FileCountLines($File_Words) ProgressOn("Searching...","","") ProgressSet(0) For $i = 0 To $Amount $string = StringTrimRight($Letters,$i) For $j = 1 To $lines ProgressSet($lines/$j) If FileReadLine($File_Words,$j) = $string Then $Words = $Words&@CRLF&$string EndIf Next Next MsgBox(0,'',$Words) Skeletor 1 Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted October 11, 2018 Share Posted October 11, 2018 @kingjacob90 Sorry for the question, but what's your goal? Could you please make an example? Thanks Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
kingjacob90 Posted October 11, 2018 Author Share Posted October 11, 2018 @FrancescoDiMuro The goal is to be able to put in a whole lot of random letters and the program will see if it can make a work out of them like the game scrabble. Link to comment Share on other sites More sharing options...
Skeletor Posted October 11, 2018 Share Posted October 11, 2018 @kingjacob90 , this is what I prefer. Simple code to do weird stuff... you dont have to be complex in you code. Well done on this one... btw, you have another user named @kingjacob280.. with the same profile picture and everything... that also you? Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI Link to comment Share on other sites More sharing options...
kingjacob90 Posted October 11, 2018 Author Share Posted October 11, 2018 @Skeletor Problem is this code does not actually work, it takes to long for it to do anything. And yeah thats weird must have been from years ago. Link to comment Share on other sites More sharing options...
caramen Posted October 11, 2018 Share Posted October 11, 2018 (edited) 1 hour ago, kingjacob90 said: Why cant it work just like the find function Becose you're not using String compare 1 hour ago, kingjacob90 said: and how does the find function in many programs work so efficiently? They just do string comparaison on some simple sub string with maybe 500 - 1000 Entry Dont forget that a page with 1 500 words can have 200 different words only... maybe less... If you got a file with all existing words. 200 000 Words for english language. It will take a bit more time to compare ... Pretty obvius ? (particulary if you want to have all know words with same characters. that's more calcul./././ ) .... and say the real purpose of your script. What do you want to do exactly ? Find all possible words of given characters to be able to play scrabble online ? Edited October 11, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
careca Posted October 11, 2018 Share Posted October 11, 2018 I think it would be faster if you read all lines to an array and then work with it instead of reading line by line from the file for each query you make. Also, maybe ditch the string trim, and use stringinstr. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now