
nss
Members-
Posts
13 -
Joined
-
Last visited
Everything posted by nss
-
Hi all, I am making a program in which I use Bass audio library (with the wrapper for autoit that I found here on forums I think) because of its support for dx effects. My problem, though, is that when effects as reverb or echo/delay are added, the channel length is not extended as to fit the tail of the effect, so if the file was really short, you wouldn't even hear the reverb at all. I've tried setting the buffer parameter even to 60k ms, updating the channel length to 60k ms, but nothing makes it so that the effects aren't being cut off. I've heard that I could add silence manually to wave files by adding the chr(0) characters, but haven't had any luck doing that, either. What I'm doing: initialize bass use streamCreateFile to load the wave file with the fx flag and length parameter set to 60000 set the config buffer to 60000 use channel set fx to add dx8 reverb use channel play to play the sound use bass update to update the length to 60000 I even tried having only silence in one wave file and tried joining two wave files together, but that didn't work either. Any help would be very much appreciated.
-
Thanks much guys. Upon further testing, it seems that the [0] returns the last added element the way I did it. But then comes the question how would you dynamically loop through such arrays if you didn't know the string indexes? The enum variable way seems a bad idea (performance-wise) for big arrays, so is there another way? P.S., I'm not using the beta, I did once, and it would always scream at me that it is the beta, and it annoyed me.
-
Hi all. Because of me wondering if I could access the key/value pair arrays with the numbers as indexes, I have found out that the zeroth element for some reason doesn't return anything. Here's the example: local $r[2] $r["test1"]="hello" $r["test2"]="how are you" msgbox(64, $r[0], $r[1]) ; prints the ["test2"] but not ["test1"]. Is this even supposed to be a thing? BTW, I haven't seen Autoit get updated since 2015; is it abandened or something? Any help/clarification appreciated.
-
Thank you guys a lot! I couldn't get scriptomatic to work – I use a screen reader to work on my computer and it doesn't work with all the guis. Now the only thing I need more is per-core bassed tempreture, and computer manufacturer/model (since I couldn't get scriptomatic to work). I'm not good with WMI...
-
@JLogan3o13 All due respect, but I have searched everywhere and haven't found what I'm looking for. I have seen @OSBuild in help file, but it returns something like 14393.693, while what I need is 1607. I'll try searching again, but I would really appreciate if you could refer me to the posts about the things I need. Have a great day.
-
Hi all, I'm making an app that among other things has the system info feature, where it displays stuff like the system version, build, CPU and ram stats, etc. So, I haven't been able to find anywhere a way to access the following things (is there even?): Windows version (not like WIN_10, but the version like 1607, or 1511 Windows edition like professional, home, education, etc. information whether the Windows is registered or not (optionally the registrant's name) the type of the currently logged-in user (e.g., administrator) computer manufacturer and model (e.g., dell inc. Inspiron n5110 boot mode (e.g., safe, normal) CPU tempreture I'd appreciate a lot if any of you could help me with any of the things from above; it would mean a lot to me. Have a great day.
-
Hi all. I am creating an app that runs a program with the admin privileges using the shellexecute's run as verb, but what my problem is, that no matter what I use to launch the program, it doesn't quite work like the run dialog would (certain programs don't get found, etc.). I've tried using the explorer.exe and passing the program to it, that is unreliable and opens documents folder sometimes instead, I've tried using the @comspec /c and that works better, but still some of the programs aren't being found that would be with the run dialog e.g., if I do @comspec /c diskpart it won't find it, I've even tried setting the working dir, but still no luck. I also tried passing commandline params to C:\WINDOWS\system32\rundll32.exe shell32.dll,#61, but no luck. can anyone help me what way to go in order to be able to launch programs in the run dialog style? is there a function in winapi that run dialog uses that I could use as well? Or what would be the best way to go about this? Any help much appreciated.
-
Help with retrieving (per-core) CPU usage
nss replied to nss's topic in AutoIt General Help and Support
Thank you JLogan; that seems to be accurate. Sorry @melba; I wasn't sure how to make it treat like the code, now that I know, I will remember that for the future posts. -
Greetings, I am writing some sort of a system info application, in which I need to display the CPU usage both in total and per core. I found this function, but it seems to report the wrong data, i.e., sometimes it will report negative percentage, and it just seems to report fake info. Any help on this would be appreciated as for right now I'm stuck with my program making because of this function. This is the function that I found: Func _GetCPUUsage() Local Const $SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION = 8 Local Const $SYSTEM_TIME_INFO = 3 Local Const $tagS_SPPI = "int64 IdleTime;int64 KernelTime;int64 UserTime;int64 DpcTime;int64 InterruptTime;long InterruptCount" Local $CpuNum, $IdleOldArr[1], $IdleNewArr[1], $tmpStruct Local $timediff = 0, $starttime = 0 Local $S_SYSTEM_TIME_INFORMATION, $S_SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION Local $RetArr[1] Local $S_SYSTEM_INFO = DllStructCreate("ushort dwOemId;short wProcessorArchitecture;dword dwPageSize;ptr lpMinimumApplicationAddress;" & _ "ptr lpMaximumApplicationAddress;long_ptr dwActiveProcessorMask;dword dwNumberOfProcessors;dword dwProcessorType;dword dwAllocationGranularity;" & _ "short wProcessorLevel;short wProcessorRevision") $err = DllCall("Kernel32.dll", "none", "GetSystemInfo", "ptr", DllStructGetPtr($S_SYSTEM_INFO)) If @error Or Not IsArray($err) Then Return $RetArr[0] = -1 Else $CpuNum = DllStructGetData($S_SYSTEM_INFO, "dwNumberOfProcessors") ReDim $RetArr[$CpuNum + 1] $RetArr[0] = $CpuNum EndIf $S_SYSTEM_INFO = 0 While 1 $S_SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION = DllStructCreate($tagS_SPPI) $StructSize = DllStructGetSize($S_SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) $S_SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION = DllStructCreate("byte puffer[" & $StructSize * $CpuNum & "]") $pointer = DllStructGetPtr($S_SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) $err = DllCall("ntdll.dll", "int", "NtQuerySystemInformation", _ "int", $SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, _ "ptr", DllStructGetPtr($S_SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION), _ "int", DllStructGetSize($S_SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION), _ "int", 0) If $err[0] Then Return $RetArr[0] = -2 EndIf Local $S_SYSTEM_TIME_INFORMATION = DllStructCreate("int64;int64;int64;uint;int") $err = DllCall("ntdll.dll", "int", "NtQuerySystemInformation", _ "int", $SYSTEM_TIME_INFO, _ "ptr", DllStructGetPtr($S_SYSTEM_TIME_INFORMATION), _ "int", DllStructGetSize($S_SYSTEM_TIME_INFORMATION), _ "int", 0) If $err[0] Then Return $RetArr[0] = -3 EndIf If $starttime = 0 Then ReDim $IdleOldArr[$CpuNum] For $i = 0 To $CpuNum - 1 $tmpStruct = DllStructCreate($tagS_SPPI, $pointer + $i * $StructSize) $IdleOldArr[$i] = DllStructGetData($tmpStruct, "IdleTime") Next $starttime = DllStructGetData($S_SYSTEM_TIME_INFORMATION, 2) Sleep(100) Else ReDim $IdleNewArr[$CpuNum] For $i = 0 To $CpuNum - 1 $tmpStruct = DllStructCreate($tagS_SPPI, $pointer + $i * $StructSize) $IdleNewArr[$i] = DllStructGetData($tmpStruct, "IdleTime") Next $timediff = DllStructGetData($S_SYSTEM_TIME_INFORMATION, 2) - $starttime For $i = 0 To $CpuNum - 1 $RetArr[$i + 1] = Round(100 - (($IdleNewArr[$i] - $IdleOldArr[$i]) * 100 / $timediff)) Next Return $RetArr EndIf $S_SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION = 0 $S_SYSTEM_TIME_INFORMATION = 0 $tmpStruct = 0 WEnd EndFunc ;==>_GetCPUUsage
-
Hi all, I am working on a project, in which I decided I should have history of previously searched stuff (since it's an app with which you can search stuff), so I have been thinking that I could just create the context menu or regular menu, that I could somehow force to activate on a button click or by using accelerators. Now, I haven't been able to figure out how to make that work. First I tried guiCtrlSetState, which didn't seem to work (I tried show and focus), then I tried accelerators and they didn't do anything. So I'm wondering is there any way I can make the context menu or regular menu pop up on button press/click or key press (with accelerators)? I know I can be old school and use a new gui, or just a combo box for the history or anything but I kinda want this, if there's any way to do so. Any help, or an alternative way of doing the same thing appreciated Here's the testing code in which I was trying to make the test button trigger and activate the context menu, and I have tried the same with the regular menu: « #notrayicon #include <GUIConstantsEx.au3> guicreate("test123") $but=guictrlcreatebutton("test", -1, -1, -1) $xt=GUICtrlCreateContextMenu("test context menu") GUICtrlCreateMenuItem("test1", $xt) GUICtrlCreateMenuItem("test2", $xt) guisetstate(@SW_MAXIMIZE) while 1 sleep(5) $msg=GUIGetMsg() if $msg=$but then guictrlsetstate($xt, $GUI_FOCUS) endif wend »
-
autoit crashes after the call to the c style dll succeeds
nss replied to nss's topic in AutoIt General Help and Support
Thanks lots @binhnx. calling with cdecl fixed it, though it'd be cool if autoit automatically tried to switch to cdecl if the stdcall one doesn't work and not just randomly crash giving anyone who's messing with dll's no idea why that happened since there can be 1 milion possible reasons. -
Hello everyone, I'm having a hard time debugging what's wrong with this. I'm trying to call the c style library called universal speech from autoit 3 (I'm using the latest final release), and after the dll does what I want it to, autoit crashes and displays the message autoit has stopped working... I'm not sure if I'm doing something wrong here? autoit: ↓ #notrayicon dllcall("UniversalSpeech.dll", "int", "speechSayA", "str", "test 123", "int", 1) sleep(1000) ↑ universal speech.h: ↓ #ifndef ____UNIVERSAL_SPEECH_H__ #define ____UNIVERSAL_SPEECH_H__ #if defined __WIN32 || defined __WIN64 #define export __declspec(dllexport) #else #error Platform currently unsupported #endif #ifdef __cplusplus extern "C" { #endif int export speechSayA (const char* str, int interrupt) ; #ifdef __cplusplus } // extern "C" #endif #endif ↑ I've successfully did this in other programming languages but autoit doesn't seem to like it; plz help!