
Wicked_Caty
Active Members-
Posts
34 -
Joined
-
Last visited
Everything posted by Wicked_Caty
-
I finally gave a look into DLLs and want to make use of them in Autoit. I know that a DLL is basically a library with some code, that can be used by several other programs at the same time to get some advantages. Yet, I need to know how they are properly used. Also it might be helpful to know what DLL is doing what task. Can you provide some resources? Thanks!
-
I'm not really sure, if that belongs here. However, I don't need any real help, so I put it here. What's the difference between _WinAPI_beep($frequency, $duration) and Beep($frequency, $duration)? It does the same. Beeping. Is there any difference at all, apart from the name? Thanks xD
-
No carriage return in label
Wicked_Caty replied to Wicked_Caty's topic in AutoIt GUI Help and Support
It would be nice, if I could just squeeze it in manually. Sadly, it doesn't work. I get those numbers in a huge single string, and it has to be exactly that way for further processing. There's nothing I could change about that. The program has to detect itself when the numbers would exceed the limits of the label. Then it has to put them into the next line without adding an actual carriage return. Similar to what is done in the input box in my example. -
My program generates a huge lot of numbers that has to be displayed in a label. Usually there are around 100 thousand and 1 million numbers, so I obviously have certain problems with space. I get the data into the label, but it's all in one line and simply exceeds the label (by a couple of million pixels, but never mind that)... Of course it won't fit into a 200x200 big label either, but it'd look a lot nicer. I don't even need to scroll in it. The only thing in need is an automatic @CRLF at the border of the label. Something like the style $ES_MULTILINE for the input box. Here's the most important stuff from the GUI. Local $gui = GUICreate("Crypt", 630, 440) Local $in = GUICtrlCreateInput("", 10, 10, 300, 300, $ES_MULTILINE) ; need something like $ES_MULTILINE just one line later in this code Local $out = GUICtrlCreateLabel("", 320, 10, 300, 300) ; instead of "", please imagine a random number between 1e5 and 1e6 here please ; a lot of buttons that don't matter right now GUISetBkColor(0x111111, $gui) GUICtrlSetBkColor($in, 0xEEEEEE) GUICtrlSetBkColor($out, 0xEEEEEE) ; again a lot of button configuartion that's completely unnecessary right now GUICtrlSetColor($in, 0x111111) GUICtrlSetColor($out, 0x111111) ; same as before GUISetFont(13, 200, 0, "Candara", $gui) GUICtrlSetFont($in, 13, 200, 0, "Candara") GUICtrlSetFont($out, 13, 200, 0, "Candara") ; still configuation for the buttons Local $data0 = "" ; some unimportant variables GUISetState(@SW_SHOW, $gui) ; switch from GUIGetMsg() in an infinite while-loop Thanks!
-
Thanks. I really didn't expect the problem there. I'm coding for almost 2 years now in several languages, but I still get confused by starting to count at zero xD
-
$data0 in the second function is a string indeed.
-
Actually, using "ABC" in the first step is working too. Edit: Using delimiters, when there are none, is also a bit difficult :/
-
Is in the comments I added at the beginning of the files. In Encode() it's "A" and in Decode() it's "00065"
-
In my current project I have a part that should convert from string to array, and later on that array should be converted to a string again. The first part works just fine and I get the array just as I want it, but on the way back I'm encountering some issues... Func Encode($data0) ; works just fine, just here for clarification. ; That if-statement in the middle is just there that I'm always getting a string with 5 symbols ; $data0 = "A" in this example Local $data1 = "" Local $tmp = "" Local $arr = StringSplit($data0, "", 2) For $i = 0 To UBound($arr)-1 $tmp = AscW($arr[$i]) If $tmp = 0 Then $tmp = "00000" & $tmp ElseIf $tmp > 0 And $tmp < 10 Then $tmp = "0000" & $tmp ElseIf $tmp >= 10 And $tmp < 100 Then $tmp = "000" & $tmp ElseIf $tmp >= 100 And $tmp < 1000 Then $tmp = "00" & $tmp ElseIf $tmp >= 1000 And $tmp < 10000 Then $tmp = "0" & $tmp ElseIf $tmp >= 10000 And $tmp <= 65535 Then $tmp = $tmp EndIf $data1 = $data1 & $tmp Next Return $data1 EndFunc Func Decode($data0) ; does NOT work ; $data0 = "00065" ; via MsgBox and ConsoleWrite I could find out that it fails already before StringSplit ; when it fails, no message is given and everything just disappears Local $data1 = "" Local $tmp = "" Local $arr = StringSplit(String($data0), "", 2) For $i = 0 To UBound($arr)-1 Step 5 $tmp = $arr[$i] & $arr[$i+1] & $arr[$i+2] & $arr[$i+3] & $arr[$i+4] & $arr[$i+5] $tmp = ChrW($tmp) $data1 = $data1 & $tmp Next Return $data1 EndFunc Sorry for dropping all the #include, the GUI, the login screen, etc... It's not necessary for this problem and I needn't give you a 613kB file full of plain text for finding an error in 3 lines of code. I found out that $arr is always empty, so there must be an issue with StringSplit. I suspected "00065" might be seen as an integer and converted it to a string, but that doesn't make it work. I already played around quite a while with that issue now, I hope some of you can finally relieve me. Thanks
-
Problem with FileCopy()
Wicked_Caty replied to Wicked_Caty's topic in AutoIt General Help and Support
I tried it with "C", "C:", "C:\" and "C:\*", but none work -
Problem with FileCopy()
Wicked_Caty replied to Wicked_Caty's topic in AutoIt General Help and Support
I also tried it, but it does the same, namely nothing... -
I'm writing a small program for creating a backup. I want to do that by using FileCopy. Everything from drive C should be copied to drive D. FileCopy("C:", "D:", $FC_OVERWRITE + $FC_CREATEPATH) That doesn't do anything, though. I played a bit with the paths, but nothing does what I want. Sometimes only the folder of the program itself is copied, sometimes nothing is copied. What am I doing wrong? What do I have to do that everything from C goes to D? Thanks! Backup.au3 Edit: DirCopy does pretty much the same
-
How am I supposed to do that? I don't know the "guildelines" or the "rulebook" :/
-
Unicode code of an array
Wicked_Caty replied to Wicked_Caty's topic in AutoIt General Help and Support
I indeed tried some other programming languages first I did C++, vbs and python before, but switched to autoit because it's enough for my basic needs and A LOT easier than C++ for example. -
A function is started and creates a GUI with two buttons. If either of those are pressed, the function will return a value, which will be used to start another function. However, only one of those two buttons works. Local $gui = GUICreate("Crypt", 120, 130) Local $button0 = GUICtrlCreateButton("Encrypt", 10, 10, 100, 50) Local $button1 = GUICtrlCreateButton("Decrypt", 10, 70, 100, 50) GUISetState(@SW_SHOW, $gui) While 1 If GUIGetMsg() = $button0 Then GUISetState(@SW_HIDE, $gui) GUIDelete($gui) Return 1 ElseIf GUIGetMsg() = $button1 Then GUISetState(@SW_HIDE, $gui) GUIDelete($gui) Return 2 ElseIf GUIGetMsg() = $GUI_EVENT_CLOSE Then GUISetState(@SW_HIDE, $gui) GUIDelete($gui) Return 0 EndIf WEnd The If works as expected, but the two ElseIf don't work at all. No matter how hard or how often I hit that $button1 or click that X in the top-right of the GUI. Maybe I haven't had enough coffee today, who knows, but I'm stuck right now... Thanks - complete source-code is attached _Crypt.au3
-
Unicode code of an array
Wicked_Caty replied to Wicked_Caty's topic in AutoIt General Help and Support
Thanks it works now Had to #include <StringConstants.au3> though Thanks for the awesome help! -
Unicode code of an array
Wicked_Caty replied to Wicked_Caty's topic in AutoIt General Help and Support
Okay, here's the full script. Maybe you find the problem in there. (before you tell me, yes, I know that this is probably the weakest encryption ever. It's just for learning autoit a bit better and hiding my personal notes from friends and family) Crypt.au3 Edit: it's not fully finished yet, so please excuse some unnecessary things in there. -
Unicode code of an array
Wicked_Caty replied to Wicked_Caty's topic in AutoIt General Help and Support
Local $len = StringLen($text) Local $text = InputBox("UCC", "Enter the text") $text is entered by the user, but it will be plain text like "abc" or "test" or "hello". Sometimes there might be numbers in there too, but really nothing special (yet). I didn't know that, thanks. Unfortunately, neither subtracting 1 from $len, nor using $i = 1 in the for-loop works (same error). -
I made a small program that should get the unicode code of an array, save it in a variable, and write it into an file. That should be done for every array of a string. For $i = 0 To $len Step 1 ; $len is the length of the text I enter previously $tmp0 = ChrW($text[$i]) ; $text is the text FileWrite($f, $tmp0 & @CRLF) ; $f is the file I write into $tmp0 = "" Next Building and compiling finish without raising warnings or errors, but the program fails when it's supposed to get the unicode code of that array... The error message says "Line 357 (File "D:\documents\coding\Crypt\Crypt.exe"): Error: Subscript used on non-accessible variable." My code ends at line 141, so it's not a problem with my code as such. I'd say that ChrW() isn't able to handle the variable I give it. I don't think it's a problem with the string, but I suspect that it's because I use a variable as an index ($text[$i]). If my clue was right, how do I fix it? If not, what could be the problem? Thanks for the help!
-
Leaving a program idle for a long time
Wicked_Caty replied to Wicked_Caty's topic in AutoIt General Help and Support
That's not the whole code. And the whole code doesn't matter. That are only the two ways that I've figured out put into two functions. It's about the part within the functions, but what's written outside of it. And it would do something if you add those silly two lines outside of the functions and declare the variables $t0 and $t1 -
Leaving a program idle for a long time
Wicked_Caty replied to Wicked_Caty's topic in AutoIt General Help and Support
Sorry, totally forgot to paste the code xD Reminder.au3 -
Leaving a program idle for a long time
Wicked_Caty posted a topic in AutoIt General Help and Support
What am I supposed to do, if a program is able for a long time? My program is idle for 20 minutes, before doing a very tiny task, and then starting all over again. I tries using Sleep(), but that literally melts my CPU and pushes them up for 20 to 30%. Permanently checking the time costs too much CPU too. Any other way of doing this? Preferably without taking more than 1% CPU. It also needn't be exactly 20 minutes, everything between 15 and 25 is fine too Thanks! -
Making a backup of the entire Registry
Wicked_Caty replied to Wicked_Caty's topic in AutoIt General Help and Support
Thanks... Was way too obvious >.< -
Making a backup of the entire Registry
Wicked_Caty posted a topic in AutoIt General Help and Support
I wanted to have a few lines that copy the whole registry into a file. I know that there is RegRead, but I don't want to type every single key into my code... Any way of doing this easily? Filetype doesn't matter, as long as it isn't encrypted. A batch or exe would be okay, if it's in the same location on every PC. Doing this without admin permissions would be awesome too Thanks -
I've written a small surveillance tool for one of my programs. It shows the time that has already passed, the estimated time until the end, the average time of the steps, and the progress in %. It works pretty well, but I want to add some stats. That'd be the usages of the CPU, RAM, network and hard-drive of all threads in %. Basically what you see in the taskmanager, but without the list of every single process. I'm aware that there's no in-built function for that, and that I'd need an additional library. Are there any for that? Simply functions that return the stats mentioned above. Thanks! Edit: I run an ASUS R752M with an Intel BayTrail M3540 on Windows 10 64-bits.