Leaderboard
Popular Content
Showing content with the highest reputation on 02/07/2019 in all areas
-
That is not really what I meant as I do believe he was trying to help you but the communication wasn't smooth from either side. ... moving on.2 points
-
....try remove the endless loop from lines 13 and 14 .... ...2 points
-
how to click toolStripButton
LarsJ reacted to Earthshine for a topic
see this thread, get the zipped files and use this for those types of controls.1 point -
"This app can't run on your PC" Windows 10 message
LisHawj reacted to JLogan3o13 for a topic
@LisHawj I ran into the same issue with a customer once, had road warriors on satellite connections. One, I recall, was living literally in the middle of a corn field in the southern part of the US. I did the same thing; sent the Office files on a thumb drive. But I did not include a couple of the .dlls - those I pushed with SCCM. It prevented users from walking off with a copy of office, and the push was only a couple hundred KB.1 point -
There are existing libraries for that sort of thing that should provide functional templates of what you wish to achieve, for example, check out Eigen's (open source) Geometry module here. Furthermore, a basic conversion from Euler to Quat (in C++) (from here) is: { FQuat q; // Declare output quaternion float yaw = Current_Rotation.Yaw * PI / 180; // Convert degrees to radians float roll = Current_Rotation.Roll * PI / 180; float pitch = Current_Rotation.Pitch * PI / 180; double cy = cos(yaw * 0.5); double sy = sin(yaw * 0.5); double cr = cos(roll * 0.5); double sr = sin(roll * 0.5); double cp = cos(pitch * 0.5); double sp = sin(pitch * 0.5); q.W = cy * cr * cp + sy * sr * sp; q.X = cy * sr * cp - sy * cr * sp; q.Y = cy * cr * sp + sy * sr * cp; q.Z = sy * cr * cp - cy * sr * sp; return q; // Return the quaternion of the input Euler rotation } That's part of a simple mod for Unreal Engine (engine and mod are free for personal use at the time of writing, AFAIK). My broader point though, is that you're attempting to reinvent the wheel, which is great for training purposes, personal growth, and world peace, but requires significant investment in time and effort on your part to bear fruit. Case in point, your "LookAt function" is a standard call in the core functionality of most modern rendering engines (so studying their source where available would be another possible starting point if you really wish to roll your own). Maybe it's worth considering whether that ready-made integrated power can be wielded and automated more effectively than starting from scratch. In any case, I would suggest you don't get too hung up on FP precision issues; that's a rabbit hole you don't want to go down at this point...1 point
-
I would probably use _IETagNameGetCollection ($oIE, "a"). Then for each tag, get the innertext. Look help file, and example of the function.1 point
-
Save an array to file with @TAB delimiter
GoogleGonnaSaveUs reacted to Valnurat for a topic
I'm trying to save an array to a file with TAB as a delimiter so it looks nice and the lines are not jumping. I have seen this _FileWriteFromArray($sFilePath,$aEndResult,Default,Default,@TAB) but the content of the file is jumpy. My array contains 3 column and I'm affraid if the 1. column is to short/long it will jump. I add to the array like this and it looks ok when I use _arraydisplay _ArrayAdd($aEndResult,$aUser[$i] & '|' & $sSetAccountDate & '|' & 'FAILED') _ArrayAdd($aEndResult,$aUser[$i] & '|' & $sSetAccountDate & '|' & 'OK') FileContent: DKSOCNNC 2016/09/31 07:52:16 Failed DKSOGVY 2016/04/31 06:20:31 Failed Is there a way to control that?1 point -
Code Fixed: Mode 1: #include <File.au3> $file = "c:\yourfile.txt" FileOpen($file, 0) For $i = 1 to _FileCountLines($file) $line = FileReadLine($file, $i) msgbox(0,'','the line ' & $i & ' is ' & $line) Next FileClose($file) Mode 2: #include <file.au3> $file = FileOpen("yourfile.txt", 0) While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0,'',$line) WEnd FileClose($file) Mode 3: #include <Array.au3> #include <File.au3> Local $aInput $file = "yourfile.txt" _FileReadToArray($file, $aInput) For $i = 1 to UBound($aInput) -1 MsgBox (0,'',$aInput[$i]) Next all tested!1 point
-
Checkbox check
crackdonalds reacted to Melba23 for a topic
serr57, Short answer = No. Longer answer = if you create all the checkboxes in IMMEDIATE succession, you can use a loop to make things a little easier: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $hCheck_1 = GUICtrlCreateCheckbox("Box 1", 10, 10, 100, 20) $hCheck_2 = GUICtrlCreateCheckbox("Box 2", 10, 30, 100, 20) $hCheck_3 = GUICtrlCreateCheckbox("Box 3", 10, 50, 100, 20) $hCheck_4 = GUICtrlCreateCheckbox("Box 4", 10, 70, 100, 20) $hCheck_5 = GUICtrlCreateCheckbox("Box 5", 10, 90, 100, 20) $hCheck_6 = GUICtrlCreateCheckbox("All", 10, 200, 100, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch If GUICtrlRead($hCheck_6) = $GUI_CHECKED Then For $i = $hCheck_1 To $hCheck_5 GUICtrlSetState($i, $GUI_CHECKED) Next Else For $i = $hCheck_1 To $hCheck_5 GUICtrlSetState($i, $GUI_UNCHECKED) Next EndIf WEndNow the top 5 turn on and off together when you check/uncheck the "All" box. This can be useful if you have a lot of checkboxes. M23 Edit: When you reply please use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button in the post itself. That way you do not get the contents of the previous post quoted in your reply and the whole thread becomes easier to read.1 point -
How do I create a dynamic array?
GoogleGonnaSaveUs reacted to Melba23 for a topic
muzle6074, To the best of my knowledge, AutoIt arrays are inherently dynamic in the sense that the values within a declared array can be updated any time you wish to any value you require without problem, and without affecting the number of elements. From the Help file: Data types in Arrays It was said that an Array contains only one datatype of the same type. But technically speaking, a Variant in AutoIt can contain anything from a number to a boolean value. So an AutoIt-Array could also contain different types, even other Arrays: $Array[0]=1 $Array[1]=true $Array[2]="Text" $Array[3]=$AnotherArray This has not been strictly forbidden in AutoIt. However, it is NOT ADVISABLE to mix different datatypes in an Array. If you do need to change the number of elements, Dim or ReDim are the functions to use - the latter preserves existing values within surviving elements. Additionally, the include file Array.au3 contains a whole bunch of interesting functions to add and delete elements from within code, but the functions tend to be quite slow if used within loops because of the ReDim calls that they use. M231 point -
array tutorial
GoogleGonnaSaveUs reacted to peter1234 for a topic
I hope this will be of help to someone. Shows how to make array, save array to file, read array from file. ;**** array tutorial by peter1234 **** ;requires beta AutoIt #include <GuiConstants.au3> #include <Array.au3> #include <file.au3> ;************ ;make array ;************ Dim $MyArray[1] For $n = 101 to 105 _ArrayAdd($MyArray, $n/10 ) Next $MyArray[0] = Ubound($MyArray) - 1 _ArrayDisplay($MyArray, "array") ;************************ ;save array to text file ;************************ FileChangeDir (@scriptdir ) FileDelete ("array.txt") FileOpen("array.txt",1) For $x = 0 to $MyArray[0] FileWrite("array.txt", $MyArray[$x] ) If $x<>$MyArray[0] then FileWrite("array.txt", @CRLF ) Next FileClose("array.txt") MsgBox(0, "", "array written to text file ") ;************************** ;read array from text file ;************************** FileChangeDir (@scriptdir ) If FileExists ("array.txt")<>1 then MsgBox(0, "ERROR", "Array text file not found ") Exit EndIf Dim $NewArray FileOpen("array.txt",0) If Not _FileReadToArray("array.txt",$NewArray) Then MsgBox(4096,"Error", " Error reading text file to $NewArray error:" & @error) EndIf FileClose("array.txt") ;************************* ;display NewArray as read ;************************* _ArrayDisplay($NewArray, "as read") ;************************ ;display fixed NewArray ;************************ _ArrayDelete ( $NewArray, 0 ) _ArrayDisplay($NewArray, "fixed") Exit Simplified with suggestion by CHRIS95219 ;**** array tutorial by peter1234 (simplified) **** ;requires beta AutoIt #include <GuiConstants.au3> #include <Array.au3> #include <file.au3> ;************ ;make array ;************ Dim $MyArray[1] For $n = 101 to 105 _ArrayAdd($MyArray, $n/10 ) Next $MyArray[0] = Ubound($MyArray) - 1 ;*********************** ;display original array ;*********************** _ArrayDisplay($MyArray, "array") ;************************ ;save array to text file ;************************ _FileWriteFromArray("array.txt" , $MyArray,1) MsgBox(0, "", "array was written to text file ") ;************************** ;read array from text file ;************************** Dim $NewArray If Not _FileReadToArray("array.txt",$NewArray) Then MsgBox(4096,"Error", " Error reading Array error:" & @error) Exit EndIf ;********************************** ;display array read from text file ;********************************** _ArrayDisplay($NewArray, "as read")1 point -
How save Array to file ?
GoogleGonnaSaveUs reacted to herewasplato for a topic
Nice. Thanks. mozart90, It can be found here: http://www.autoitscript.com/forum/index.php?showtopic=222421 point -
How save Array to file ?
GoogleGonnaSaveUs reacted to cppman for a topic
#include <File.au3> _FileWriteFromArray($sFilePath, $a_Array)1 point -
cmd to AutoIT
KevinSchmidt reacted to JLogan3o13 for a topic
@KevinSchmidt @Marius-Ligon Creating multiple accounts is a great way to get yourself banned from the forum. Both accounts are prevented from posting until you PM me and we have a conversation about which you would like to keep.0 points