Jump to content

anony10

Active Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by anony10

  1. woop woop, im a dummy, please delete
  2. Yes I see now, thank you very much once again.
  3. Apparently I can't read... I feel so dumb, thank you M23, answering my stupid questions as usual It does say in the reference (under the flag) however that "1 - Overwrite "new section". This will erase any existing keys in "new section"" so I either dont know how to english, or thats a typo?
  4. Hi I would like to use the IniRenameSection command without it erasing everything in that given section. $openLearningDb = fileopen("test.txt", 1) ;open new database $desiredLines = iniRead("test123.ini", "base", "importx", "") $countEntries = _filecountlines("test.txt") if $desiredLines > $countEntries then msgbox(0, "", "there is less lines than what we need!") for $i = 1 to $desiredLines - $countEntries $importingArray = inireadsection("test123.ini", $i) ;import the desired lines _arraydisplay($importingArray) filewriteline($openLearningDb, $importingArray[2][1] & "|" & $importingArray[1][1]) ;write to the file inidelete("test123.ini", $i) ;delete them Next ;when done msgbox(0, "imported new words", "new words") endif Every time the difference between $desiredLines and $countEntries is at least 1, this loop should run which is supposed to read the ini file, the first section (simply called [1]), write it into an other file and then delete this section from the ini file. This works flawlessly however the next time the difference is 1, there obviously will be no 1, as the lowest entry will be at least 2. I was thinking of using stringreplace for renaming, but that is way too brute for hundreds - if not thousands - of entries, and too much work. IniRenameSection would work, but that erases everything from the section, and saving everything first into a .tmp file or something and then rewriting it is not a way to go in my opinion. Any other ideas? (I had this for renaming, but obviously this ends up erasing everything in the end) ;~ $getSectionNames = inireadsectionnames("test123.ini") ;get the no of sections ;~ for $i = 2 to $getSectionNames[0] ;loop through them and rename them to 1, 2, 3 etc ;~ inirenamesection("test123.ini", $getSectionNames[$i], $i - 1, 1) ;~ next ;_FileReadToArray2D("test.txt", $aArray, "|") ;load it to a 2D array ;~ msgbox(0, "sections renamed", "sections renamed")
  5. Thanks for your help, but unfortunately I dont think I am able to do that on my own, as I dont even know how that is possible. Thanks anyways.
  6. Hi guys! I would like to send clicks to a minimized window, which I successfully accompolished but I have a problem. My problem is that every time a click has been sent to the window, the window maximizes itself (therefore making it active) which is quite annoying. I tried hiding it and everything, but i just cant make it so that it doesnt maximize or active itself everytime something happens in the window. Any suggestions? Opt("WinTitleMatchMode", 2) opt("caretcoordmode", 1) hotkeyset("{f2}", "handle") while 1 sleep(1) WEnd func handle() $handle = wingethandle("XY") while 1 sleep(5000000) controlclick("XY", "", $handle, "left", 1, 297, 484) wend endfunc I looked at similar forums, but I couldnt find anything similar to this. Thanks
  7. I tried that as well, it didnt work. But it seem to work with FileWrite. FileWrite ($open, @CRLF) FileWrite($open, $angolszoread & "|" & $magyarszoread & "|" & $akcentusread & "|" & $magyarazatread) this replaces the _Filewritetoline and Filewriteline, and it works perfectly, as i want it to... something is buggy with those 2, i dont know what, but i could solve this (it seems like), so im okay with this way.
  8. So everyone is clueless about these commands? Cool. I couldnt solve it still.
  9. Problem solved ! I could solve my problem, i did it with filewriteline. I realized there was a "0" at the end, that i didnt need. It seems im pretty set. thanks anyway btw couldnt solve my main "problem", its still doesnt type anything, but it doesnt matter now. the new problem is, with filewriteline before it types in a new line, it types first in the end of the last line. so instead of making a new line and writing there, it types the things at the end of the last line. however, if i use @CR, @LF or @CRLF it doesnt help anything. so it didnt help anything at all. anything else?: /
  10. I know, but it i use it in the later part of the script. And its not like it gives error message in the console... Its just not doing anything. Anything else maybe? :/ Or should i try it in an other way?
  11. Hey. I was looking for this command, added it to my app, and then tested it. it worked fine, i could add as many lines i wanted to.. but. i restarted my program without adding anything new to my source, and it started not working... #include <File.au3> Case $Save $angolszoread = GuiCtrlRead ($AngolSZO) $magyarszoread = GuiCtrlRead ($MagyarSZO) $akcentusread = GuiCTrlRead ($Akcentus) $magyarazatread = GuiCtrlRead ($Magyarazat) $open = FileOpen(@ScriptDir & "norm.txt") $lines = _FileCountLines(@ScriptDir & "norm.txt") _FileWriteToLine(@ScriptDir & "norm.txt", $lines + 1, $angolszoread & "|" & $magyarszoread & "|" & $akcentusread & "|" & $magyarazatread, 0) FileClose($open) Basically what it does is read four inputs, and then writes them in the last line. Why dont i use filewriteline is because for some reason i cant add that many handles (is that the right word? if not, what i mean under handle is $angolszoread like this. but i think its because i did it wrong, i didnt want to put much time in it, i thought this other command will do it, but it seems like it doesnt). So now if i press Save on my GUI its like it doesnt do anything. The file exists, it has rights to write in the .txt file. When i open norm.txt i cant see anything new. Im not sure if its because it bugged in at some point and it will work smoothly after reboot, but im sure i do something wrong, and there is an obvious reason why is not working. I was searching it on the forum, couldnt find anything useful. Also i was testing it in a few ways to make sure it doesnt work, and it doesnt. i hope someone can help me
  12. But as im progressing in my script i have new problems... Now im trying to figure out how to use multiple forms (like 3, 4) in one .au3 file, but this is offtopic.
  13. Thank you, i have solved every problem I had, so it seems im pretty set atm. Thank you everybody for the support.
  14. Can i read out from a .txt file, and break the read out line ? Like $text = "ThisnlinencontainsnC-style breaks." this but instead of the "ThisnlinencontainsnC-style breaks." part i want to split the read out words.
  15. Thank you, but an other question. How can i "read" the cutted pieces? I mean, i've tried out the example script, with one more line $days = StringSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",") ;$days[1] contains "Sun" ... $days[7] contains "Sat" $text = "ThisnlinencontainsnC-style breaks." $array = StringSplit($text, 'n', 1) msgbox(0, "asd", $array) It gets me a blank msgbox. Am i doing it wrong? nvm, solved! i think its enough, thanks.
  16. Hello! Im looking for a command, or something that i can read / write a table with. Lets say i write 5 words in a .txt file in one line. I seperate them from each other with something (%, a space, or something), it reads that line, and if it finds the symbol (eg %) it "breaks" the two words and put the first word in Label1, put the other word in Label2, etc etc. I want to be able to read certain lines. I hope you get it. Thanks
  17. Can you start me off somehow then, please? I dont even know, how to start it. Alright - i did it. Thank you.
  18. Thank you. Can you write an example please?
  19. Okay. So, lets say there is one .exe file on somebodys computer, and we dont know its name. We want to do this: If the stranger opens the .exe file (we dont know its name!), then an msgbox pops up, and writes the .exe files name in it. Like the code that you wrote, but i want to avoid to write all the words, programs name, etc. So i want to watch every .exe file in the world, without writing them in sections like this If ProcessExists("Firefox.exe") Then MsgBox(0,0,"Firefox.exe") Exit EndIf I hope you understand now, what i want to do.
  20. then write an example please, because i dont get it
  21. Because i have to wait until the window comes "active". I dont want this, I just run it, it doesnt have to come active, and it pops up an msgbox with the .exe name in it. WinWaitActive("[CLASS:Notepad]", "") $pid = WinGetProcess("[CLASS:Notepad]", "") $name = _ProcessGetName($pid) you have to write the window's name first. its like doing processexists with all the exe files.thats why its not good for me now
  22. Hi. How could i do this: If i run an .exe file, then my program open an msgbox with the process's name in it (i mean, i open mozilla firefox msgbox pop ups, and writes firefox.exe in it). I dont want to do ProcessExists with every single .exe file in the world, because i want to see my own programs names as well. So, i want it something like this: I open mozilla firefox, an msgbox pop ups, and writes firefox.exe in it. And so on, with everything else like that. I want to do it just with .exe files. I already tried _ProcessGetName, it does anything else, it's not that what i want. really really sorry for my english, and for my grammar. thank you
  23. Thx!
  24. Hi. I did a calculator. (okay, if u have better dont need to post) I know bug: u can write letters too, but i dont know how to fix it.So if you know, how to, pls write. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Calculator", 367, 210, 192, 124) $Input1 = GUICtrlCreateInput("", 32, 51, 121, 21) $Radio1 = GUICtrlCreateRadio("-", 160, 24, 29, 17) $Radio2 = GUICtrlCreateRadio("+", 160, 44, 29, 17) $Radio3 = GUICtrlCreateRadio("*", 160, 63, 30, 17) $Radio4 = GUICtrlCreateRadio("/", 160, 83, 28, 17) $Input2 = GUICtrlCreateInput("", 195, 50, 121, 21) $Button1 = GUICtrlCreateButton("=", 79, 108, 182, 25, 0) $Input3 = GUICtrlCreateInput("", 110, 148, 121, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $kivon = BitAnd(GUICtrlRead($Radio1),$GUI_CHECKED) $osszead = BitAnd(GUICtrlRead($Radio2),$GUI_CHECKED) $szoroz = BitAnd(GUICtrlRead($Radio3),$GUI_CHECKED) $oszt = BitAnd(GUICtrlRead($Radio4),$GUI_CHECKED) If $kivon = 1 Then kivonas() EndIf If $osszead = 1 Then osszeadas() EndIf If $szoroz = 1 Then szorzas() EndIf If $oszt = 1 Then osztas() EndIf If $kivon + $osszead + $szoroz + $oszt = 0 Then msgbox(0, "Error", "Choose from any radio buttons!") EndIf EndSwitch WEnd Func kivonas() $put1 = GuiCtrlRead ($input1) $put2 = GuiCtrlRead ($input2) $kivonasss = $put1 - $put2 GuiCtrlSetData ($Input3, $kivonasss) EndFunc Func osszeadas() $put1 = GuiCtrlRead ($input1) $put2 = GuiCtrlRead ($input2) $osszeadasss = $put1 + $put2 GuiCtrlSetData ($Input3, $osszeadasss) EndFunc Func szorzas() $put1 = GuiCtrlRead ($input1) $put2 = GuiCtrlRead ($input2) $szorzasss = $put1 * $put2 GuiCtrlSetData ($Input3, $szorzasss) EndFunc Func osztas() $put1 = GuiCtrlRead ($input1) $put2 = GuiCtrlRead ($input2) $osztasss = $put1 / $put2 GuiCtrlSetData ($Input3, $osztasss) EndFunc
  25. When you listen a music, and you pres open - cancel the music will stop
×
×
  • Create New...