Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Because using the flag 2 means 'overwrite' Just run a test using your previous script, with the FileOpen line commented or not, and then count the lines in the final ini file in both cases
  3. oh yes mikell, you are right. i forgot the function. just for sake of completation: #include <Array.au3> Global $inifile = "nothing.ini" Global $standard = "chopchop" Global $keynames = "key" If FileExists($inifile) = 1 Then MsgBox(0, "YES", "File does exist!") ElseIf FileExists($inifile) = 0 Then MsgBox(0, "NO", "File does not exist") For $Loop = 0 To 150 $num = StringRight("00" & $Loop + 1, 3) IniWrite($inifile, $standard, $keynames & $num, $Loop) ;-- why is it "$num, $Loop" and not "$num & $Loop"? Next Global $ini = IniReadSection($inifile, "chopchop") For $Loop = 1 To $ini[0][0] $ini[$Loop][1] = _Randomizer(1) Next For $Loop = 1 To UBound($ini) - 1 IniWrite($inifile, $standard, $ini[$Loop][0], $ini[$Loop][1]) Next MsgBox(0,"SUCCESS", "ini-file was saved.") Global $ini = IniReadSection($inifile, "chopchop") _ArrayDisplay($ini, "see duplicates?") FileOpen($inifile, 2) ;-- why do i have to open the file while above i did not need to do that before writing the ini? Global $aTmp = _ArrayUnique($ini, 1, 0, 0, 0, 0) Global $aOut[UBound($aTmp)][UBound($ini, 2)] For $i = 0 To UBound($aOut) - 1 $nums = StringRight("00" & $i + 1, 3) ;$aOut[$i][0] = $keynames & $nums & $i ---> total garbage will not do anything that is supposed to do. $aOut[$i][0] = $keynames & StringFormat("%03d", $i) $aOut[$i][1] = $aTmp[$i] Next For $i = 1 To UBound($aOut) - 1 IniWrite($inifile, $standard, $aOut[$i][0], $aOut[$i][1]) Next $aTmp = 0 Global $ini = IniReadSection($inifile, "chopchop") _ArrayDisplay($ini, "still duplicates?") EndIf Func _Randomizer($length) $String = "" $aChars = StringSplit("abcdefg", "") $sString = "" $bChars = StringSplit("ABCDEFG", "") $bString = "" $cChars = StringSplit("1234567", "") $cString = "" $i=0 Do If $length<=0 then ExitLoop $String &= $achars[Random(1,$achars[0])]&$cchars[Random(1,$cchars[0])]&$bchars[Random(1,$bchars[0])] $i += 1 Until $i = $length Return $String EndFunc
  4. got it. thanks. i just changed, like you suggested: $aOut[$i][0] = $keynames & $i to: $aOut[$i][0] = $keynames & StringFormat("%03d", $i) then i have the values all numbered nice and neatly. i would never have looked at StringFormat if you had not mentioned it and shown me an example. does not solve the mystery why i have to FileOpen() first before writing the ini, whilst above the ini was created and then rewritten without having to use the FileOpen() function. but as long as it works, i am happy. thanks
  5. roeselpi, make sure you understand StringFormat to get the clear idea of what it does ,to remove the prefix use Number() #include <Array.au3> Local $array = [["name 0", "Peter"], ["name 1", "Paul"], ["name 2", "Mary"], ["name 3", "Mary"], ["name 4", "Charles"], _ ["name 5", "Elizabeth"], ["name 6", "Victoria"], ["name 7", "Mary"], ["name 8", "Tom"], ["name 9", "Paul"]] Local $sd = ObjCreate("Scripting.Dictionary") For $i = 0 To UBound($array) - 1 If $sd.Exists($array[$i][1]) Then ContinueLoop $sd.Item($array[$i][1]) = $array[$i][1] Next Local $a = $sd.Items _ArrayColInsert($a, 0) _ArrayDisplay($a) For $i = 0 To UBound($a) - 1 $a[$i][0] = StringFormat("%05d", $i) Next _ArrayDisplay($a) Deye
  6. Bea, 26 posts and you appear not to have read the Forum rules since your arrival. Please do read them - particularly the bit about not discussing game automation - before you post again and then you will understand why you will get no help and this thread will now be locked. M23
  7. Today
  8. Thank you, I corrected it to sqlite3.dll
  9. i can not get it to work the way i want. it is quite frustrating. i have been trying about 100 different possible solutions, but it just will not do it the way i would like it to be. at first it looked very successful, but my lack of understanding keeps making it very hard for me to adapt a code to get where i want it to be. to make it a bit more clear, i have made a simple example with the generation of an ini file with random entries (had a lot of help with that from "BrewManNH" in this thread: replace data in infile for that) to make clear what i am getting at and where the problem is it will generate 150 radom entries consisting of 3 digits and here you can easily see what i mean with the first two digits being able to be identical and the third digit is the one which causes the duplicate entry. after deleting the duplicates it would leave you with about 101-115 unique entries that are not duplicated. but on the first generation the numerals are all right and after the unique check/delete the numbers all get a different amount of digits and that is annoying. #include <Array.au3> Global $inifile = "nothing.ini" Global $standard = "chopchop" Global $keynames = "key" If FileExists($inifile) = 1 Then MsgBox(0, "YES", "File does exist!") ElseIf FileExists($inifile) = 0 Then MsgBox(0, "NO", "File does not exist") For $Loop = 0 To 150 $num = StringRight("00" & $Loop + 1, 3) IniWrite($inifile, $standard, $keynames & $num, $Loop) ;-- why is it "$num, $Loop" and not "$num & $Loop"? Next Global $ini = IniReadSection($inifile, "chopchop") For $Loop = 1 To $ini[0][0] $ini[$Loop][1] = _Randomizer(1) Next For $Loop = 1 To UBound($ini) - 1 IniWrite($inifile, $standard, $ini[$Loop][0], $ini[$Loop][1]) Next MsgBox(0,"SUCCESS", "ini-file was saved.") Global $ini = IniReadSection($inifile, "chopchop") _ArrayDisplay($ini, "see duplicates?") FileOpen($inifile, 2) ;-- why do i have to open the file while above i did not need to do that before writing the ini? Global $aTmp = _ArrayUnique($ini, 1, 0, 0, 0, 0) Global $aOut[UBound($aTmp)][UBound($ini, 2)] For $i = 0 To UBound($aOut) - 1 $nums = StringRight("00" & $i + 1, 3) ;$aOut[$i][0] = $keynames & $nums & $i ---> total garbage will not do anything that is supposed to do. $aOut[$i][0] = $keynames & $i $aOut[$i][1] = $aTmp[$i] Next For $i = 1 To UBound($aOut) - 1 IniWrite($inifile, $standard, $aOut[$i][0], $aOut[$i][1]) Next $aTmp = 0 Global $ini = IniReadSection($inifile, "chopchop") _ArrayDisplay($ini, "still duplicates?") EndIf i spotted the duplicates later down the line but with a unique check, i can eliminate the duplicates and that saves like 20-30 minutes during testing whilst doing it manually. i tested the other version as well from iamtheky and there no unique single key will be left. all duplicates will be removed but one of them should remain because one is the first and original, so that was not the right thing to go with. i just do not understand where i am going wrong at present.
  10. Hey Deye, thanks for your replay, my code is verry simple, #include <MsgBoxConstants.au3> Local $sFilePath1 = RegRead("HKEY_CURRENT_USER\Software\JavaSoft\Prefs\elo\clients\hardware", "Code") Local $sFilePath = RegRead("HKEY_CURRENT_USER\Software\JavaSoft\Prefs\elo\clients\hardware", "Ticket") MsgBox($MB_SYSTEMMODAL, "", "Der letzte Wettschein lautet: " & $sFilePath & " $ " & $sFilePath1)
  11. svenjatzu, its possible to make it work but its really up to you make it, Maybe simpler to walk the process through starting with FileOpenDialog() .. if you already have any code for this and still cant make it work then post it here to get more help Deye
  12. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Price Checker", 371, 57, 2453, 151) $Label1 = GUICtrlCreateLabel("Avantoe potion (unf)", 24, 16, 100, 17) $Check = GUICtrlCreateButton("Check", 136, 16, 75, 17) $Input1 = GUICtrlCreateInput("Checked Price", 224, 16, 121, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Hey guy, i am trying to make a litte gui to check a price in an video game but i have no clue how i get the price in the Input box This gui should get the price via source cod when somone click the button an put it in the check box, but i have no clue how the cod this can somone help a noob girl Notice: if you maybe go to the site the prices have changend, when i made the picture it was +50 Link: from the site to check https://www.ge-tracker.com/item/avantoe-potion-unf
  13. Oh! really. I think autoit can make this. So I will try custom Gui. Thank you.
  14. You would have to build your own custom gui, or add a MsgBox with Yes/No "Do you want to include subfolders" after the selection.
  15. Hi there. I want to add my FileSelectFolder function with "include subdirectories Checkbox". The example image is shown in below.
  16. This is the definition for the frame you referenced in the image -- <iframe src="https://cmegroup-tools.quikstrike.net/User/QuikStrikeTools.aspx?viewitemid=IntegratedFedWatchTool" style="width: 100%; height: 885px; overflow: hidden; border: 0px none;" scrolling="no" id="cmeIframe-yoymbhus" class="cmeIframe" frameborder="0"></iframe> It doesn't have a given name, so using _IEFrameGetObjByName is not an option. But you still need to get a reference to the frame object in order to access it contents. You can use _IEFrameGetCollection with an index value (I believe 0 will work in this case ) or you could use _IEGetObjById,
  17. You can. It would require to check the windows API deeply and I have not time to do it. I think you could handle easily using Windows Automation Functions. Saludos
  18. Thanks : ) But im not shure if thats what im looking for. what i need is that the file autmatically executes when i paste it to another folder. Just like i copy it from my pc and past it to another pc, in the moment when its copied to the other pc it should execute without that i need to run it on my own
  19. @Skitty i know its been a long time but does this code still works for you ? AutoItSetOption("WinTitleMatchMode", 2) If @error Then Exit While 1 $0 = ControlGetText("[CLASS:Chrome_WidgetWin_0]", " ", WinGetTitle("[CLASS:Chrome_WidgetWin_0]")) If $0 = "" Then ContinueLoop Else $T = ControlgetText($0, "", "Chrome_AutocompleteEditView1") IniWrite(@ScriptDir & "\URL.ini","Chrome","URL",$T) _1() EndIf WEnd Func _1();This is supposed to check if the url from the ini file differs to the current url While 1 $x = ControlgetText($0, "", "Chrome_AutocompleteEditView1") $TT = IniRead(@ScriptDir & "\URL.ini","Chrome","URL",$T) MsgBox(0, "", $T) If $x = $TT Then ContinueLoop Else ExitLoop EndIf WEnd EndFunc I tried using it but it seems it cant read my chrome
  20. For a UDF, TCPStartUp() is the including script's responsibility (like caling _GDIPlus_Startup() or _SQLite_Startup() prior to using functions from a UDF that depend on these libraries). Check in each function helps debugging (uninitialized use will error eventually, a check at least identifies the cause), but TCP functions return @error WSANOTINITIALISED (10093) if called prior to TCPStartup() already. Generally speaking, anything of global effect is the script's (not UDF's) responsibility (code becomes inflexible/unmanageable otherwise). Of course you can do as you please (it's a convenience vs. flexibility trade off eventually).
  21. Hi, AndroidZero started another thread asking how to read the content of a clicked notification. Here is some Beta code which has this facility along with the title/message clicked functionality from the posts above: UDF: Notify_Mod_TextRet.au3 Example script: Notify_Mod_TextRet_Ex.au3 Let me know if it is of use to anyone, particularly AndroidZero! M23
  22. AndroidZero, As the question was specific to the Notify UDF, why did you not post in the UDF thread where I am more likely to see it? Anyway, if you do go to the thread, you will see I have a new Beta which should help you get what you want without fiddling in the INTERNAL_USE_ONLY functions. M23
  23. Hello. I am strugling with scite opening files. My desired behaviour is doubleclicking scripts opens it in existing scite window in new tab, (works when I set check.if.already.open=1), but I also want an option to open another scite window by doubleclicking scite directly (works when I set check.if.already.open=0). But when its 0, doubleclicking script always opens it in new window instead of in tab, and setting it to 1 dont allow me to open more windows if I want to. Is there any way to achieve it? (Win 7) Bonus question: idk why, but closing scite will not remember my last opened files, so on next doubleclick on script will open that script only, effectively closing all other scripts. If I open by scite shortcut dorectly, last open scripts are kept open, but if I by mistake open scite by script, I have to reopen all previous scripts again. How can I set that no matter the way scite opens, it will also open all scripts it had open when I close it? Thanks!
  24. as i understand, TCPStartUp() works for the entire process, and is scope-agnostic. suppose i'm writing a UDF that makes use of TCP. i neither know nor care if the calling script uses TCP too. the calling script may or may not call TCPStartUp() or TCPShutDown() at its discretion. should i be concerned about that at all? my initial thought was to mandatory call TCPStartUp() in my UDF, and register an OnExit function for TCPShutDown(). but what if the calling script does the same? what if the calling script calls TCPShutDown() while my UDF is using it still? do i need to test for TCP status at the beginning of each function in my UDF, so i can start it if it isn't started yet? that seems too inelegant. ideas?
  25. Referring to following coding and image, if oFrame is not available, I would like to know on what to look for based on following image. Do you have any suggestions? Thank you very much for any suggestions (^v^) #include <Constants.au3> #include <IE.au3> #include <Array.au3> Opt ("MustDeclareVars", 1) Local $oIE = _IECreate("https://www.cmegroup.com/trading/interest-rates/countdown-to-fomc.html") If Not IsObj ($oIE) Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error creating IE object") Local $oFrame = _IEFrameGetObjByName ($oIE,"out") If Not IsObj ($oFrame) Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error searching for frame") Local $oTDs = _IETagNameGetCollection ($oFrame, "td") If Not IsObj ($oTDs) Then Exit MsgBox ($MB_SYSTEMMODAL,"","Error gathering tag collection") Local $sValue For $oTD in $oTDs $sValue = _IEPropertyGet ($oTD, "innertext") If @error or $sValue = "" Then ContinueLoop If $sValue = "200-225" Then $sValue = $oTD.nextElementSibling.innerText ;which return 0.0% $sValue = $oTD.nextElementSibling.innerText ;which return 2.0% $sValue = $oTD.nextElementSibling.innerText ;which return 3.9% ExitLoop Endif Next MsgBox ($MB_SYSTEMMODAL,"",Number($sValue)) _IEQuit ($oIE)
  26. i once toyed with the idea, after reading "The Blind Watchmaker" and "The Selfish Gene" (by Richard Dawkins). both books describe computer simulations of evolutionary processes. i might be able to chip in. what algorithms are you using?
  1. Load more activity
×
×
  • Create New...