Leaderboard
Popular Content
Showing content with the highest reputation on 08/15/2023 in all areas
-
What's New in Version v1.4.0 v1.4.0 (2023-08-15) Added the ability to set the Content-Type response header's value in _HTTPAPI_HttpSendHttpResponse(). See the function's header and the example script in order to see how to implement the new functionality. Thanks @noellarkin for the suggestion. Added an additional api link (/json) to the example script in order to show the new content-type functionality in _HTTPAPI_HttpSendHttpResponse(). v1.3.0 (2022-06-14) - These modifications were not previously released. Added 2 new internal functions related to setting response headers: __HTTPAPI_ResetKnownResponseHeaderValue() - Clears a known response header __HTTPAPI_SetKnownResponseHeaderValue() - Set a known response header Did a little code optimization/refactoring in _HTTPAPI_HttpSendHttpResponse() and some of the struct definitions.3 points
-
GIF Animation (cached)
pixelsearch and one other reacted to Nine for a topic
After reviewing different options about an issue with OnEvent GUI, I went with a deletion mark. I also included a few code optimizations and resolve a possible issue with a stack overflow. New version available.2 points -
Tester needed ^^
simplercoder000 reacted to argumentum for a topic
...who allowed you two to come out of the chat room ! If you're not on topic, don't spam the thread.1 point -
HttpApi UDF - HTTP Server API
argumentum reacted to TheXman for a topic
If I understand what you are asking for correctly, it seems similar to what @sylremo described HERE. His next post seemed to be a way to handle that type of processing. Personally, I haven't really looked into it because I haven't had a need for it. But at first glance, his proposed solution seemed to be a viable one.1 point -
HttpApi UDF - HTTP Server API
noellarkin reacted to TheXman for a topic
Thanks, I will definitely check them out.1 point -
HttpApi UDF - HTTP Server API
Hashim reacted to noellarkin for a topic
Been using this for a personal project, love it:) Just had a suggestion: In the function _HTTPAPI_HttpSendHttpResponse adding an additional parameter $sResponseType Func _HTTPAPI_HttpSendHttpResponse($hRequestQueue, $iRequestId, $iStatusCode, $sReason, $sBody, $sResponseType = "text/html") And replacnig "text/html" in the function with $sResponseType. Allows one to use other formats, like JSON :) For example: Switch $sPath Case $path & "/username" $iStatusCode = 200 $sReason = "OK" $sMsg = '{"username":"' & @UserName & '"}' EndSwitch _HTTPAPI_HttpSendHttpResponse($requestqueue, $tRequest.RequestId, $iStatusCode, $sReason, $sMsg, "application/json")1 point -
I think OP wants to generate a command to assign a variable ($My_Password) the password string if so then the best way would be to use double quotes to escape the single quotes (method 1) but if OP doesn't like this way then he could replace the quotes with chr(34) (method 2) If I didn't understand anything then sorry ; BEGIN - Write Test file Local $My_Password = "R7PIO'24NJ7'5OI2J6'O23L64P23" & '"J624P46P;46Z7PIO2' & "'4NJ75OI2J6O23Y64P23J6" & '"24P"46P;46T7PIO24N' & "'J75OI2J6'O23T64P" & '"23"J624"P46P;46K' Local $My_Password_File = @ScriptDir & '\My_Password.txt' FileWrite($My_Password_File, $My_Password) ; END - Write test file $My_Password = FileRead($My_Password_File) FileDelete($My_Password_File) ; Remove test file ConsoleWrite("- " & $My_Password & @CRLF& @CRLf) ; (method 1) ConsoleWrite('-> $My_Password = "' & StringReplace($My_Password, '"', '""') & '"' & @CRLF) ; (method 2) ConsoleWrite('-> $My_Password = "' & StringReplace($My_Password, '"', '" & Chr(34) & "') & '"' & @CRLF)1 point
-
I hope, I am Local $My_Password = "R7PIO'24NJ7'5OI2J6'O23L64P23" & '"J624P46P;46Z7PIO2' & "'4NJ75OI2J6O23Y64P23J6" & '"24P"46P;46T7PIO24N' & "'J75OI2J6'O23T64P" & '"23"J624"P46P;46K' Local $dPasswordBin, $sPasswordStr ConsoleWrite($My_Password & @CRLF) $dPasswordBin = StringToBinary($My_Password) ConsoleWrite($dPasswordBin & @CRLF) ConsoleWrite(BinaryToString($dPasswordBin) & @CRLF)1 point
-
I don't think I can help you with this since I'm unable to understand your use case. Maybe someone else will be better at deciphering your requirements.1 point
-
Converting String Into A Variable name(?)
Musashi reacted to mistersquirrle for a topic
If you're on a roll then you're on a roll. Sometimes just completing the task is better than finding the most optimal way. However that being said, you are definitely doing more typing/work than needed for your X1-Y4 pairs. You're providing each corner of a rectangle, even though you only need opposing corners (like top left and bottom right). For example: ; https://www.autoitscript.com/forum/topic/210615-converting-string-into-a-variable-name/?do=findComment&comment=1521771 #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <array.au3> Global $id = 0 ; active selection Global $aQuad[][] = [ _ ; Provide coordinates in groups, [Top Left] and [Bottom Right] ["X1", "Y1", "X2", "Y2"], _ [223, 223, 325, 325], _ ;1 [750, 425, 850, 525] _ ;26 ] While 1 Global $sInputBoxAnswer = InputBox("Which quadrant to show?", @CRLF & "Number only, 0 - " & UBound($aQuad) - 1, $id + 1) If @error Then Exit $id = Int($sInputBoxAnswer) If $id < 0 Or $id >= UBound($aQuad) Then ConsoleWrite('Invalid number' & @CRLF) ContinueLoop EndIf For $iY = 1 To 3 Step 2 For $iX = 0 To 2 Step 2 MouseMove($aQuad[$id][$iX], $aQuad[$id][$iY], 1) ToolTip($aQuad[$id][$iX] & ", " & $aQuad[$id][$iY], _ $aQuad[$id][$iX] + 20, _ ; offset so we can see the whole tooltip without the mouse in the way $aQuad[$id][$iY], _ 'X' & ($iX + 2) / 2 & ', Y' & ($iY + 1) / 2) Sleep(250) Next Next ;Sleep(350) ToolTip("") WEnd Here, we're only using X1,Y1 and X2,Y2. These points are the Top Left and Bottom Right coordinates, that's all we need to make a rectangle. That'll save you half the typing for coordinates. I also simplified the main loop, and swapped having 4 mouse moves to a couple of loops. If you wanted to keep that part expanded though, here's what that would look like: MouseMove($aQuad[$id][0], $aQuad[$id][1], 1) ToolTip($aQuad[$id][0] & ", " & $aQuad[$id][1], $aQuad[$id][0], $aQuad[$id][1], "Top left") Sleep(250) MouseMove($aQuad[$id][2], $aQuad[$id][1], 1) ToolTip($aQuad[$id][2] & ", " & $aQuad[$id][1], $aQuad[$id][2], $aQuad[$id][1], "Top right") Sleep(250) MouseMove($aQuad[$id][0], $aQuad[$id][3], 1) ToolTip($aQuad[$id][0] & ", " & $aQuad[$id][3], $aQuad[$id][0], $aQuad[$id][3], "Bottom left") Sleep(250) MouseMove($aQuad[$id][2], $aQuad[$id][3], 1) ToolTip($aQuad[$id][2] & ", " & $aQuad[$id][3], $aQuad[$id][2], $aQuad[$id][3], "Bottom right") Sleep(250) The nice part with not having each one as its own thing is that if you want to change a part of it, instead of changing it 4 places it's only 1. Also I noticed that your coordinates are almost a pattern, at least besides the first 1 or 2 points of the pattern. But, would something like this work? ; https://www.autoitscript.com/forum/topic/210615-converting-string-into-a-variable-name/?do=findComment&comment=1521771 #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <array.au3> Global $id = 0 ; active selection Global $sInputBoxAnswer Global $aiCoords[2] While 1 $sInputBoxAnswer = InputBox("Which quadrant to show?", @CRLF & "Number only", $id + 1) If @error Then Exit $id = Int($sInputBoxAnswer) If $id <= 0 Then ConsoleWrite('Invalid number' & @CRLF) ContinueLoop EndIf For $iY = 0 To 1 $aiCoords[1] = 225 + (100 * (Floor($id / 10) + $iY)) For $iX = 0 To 1 $aiCoords[0] = 250 + (100 * Mod(($id - 1) + $iX, 10)) MouseMove($aiCoords[0], $aiCoords[1], 1) ToolTip(String($aiCoords[0]) & ", " & String($aiCoords[1]), _ $aiCoords[0] + 20, _ ; offset so we can see the whole tooltip without the mouse in the way $aiCoords[1], _ 'X' & ($iX + 1) & ', Y' & ($iY + 1)) Sleep(250) If $iX = $iY Then ConsoleWrite('id: ' & $id & ' X' & $iX & ',Y' & $iY & ': ' & _ String($aiCoords[0]) & ", " & String($aiCoords[1]) & @CRLF) Next Next ;Sleep(350) ToolTip("") WEnd This assumes that you start at 250 instead of 223, and also hit 350 instead of 335. Everything else just seems to be multiples of 100, with 10 points in X before moving to a new Y and repeating. I think I had some other stuff to say, but then took a work meeting and forgot. Let me know if you have questions.1 point -
Hello, This is my first post here although I've been using Autoit for around 5 years. Several years ago I started looking for a template to make Invoicing software in Autoit. For PDF generation I ran across MIPDF by Mihai Iancu and it works great. So I am including that along with the Invoice template that I created. I hope you all enjoy it and take it further than me and make a full featured personal financial manager in Autoit! Autoit Invoicing.zip1 point
-
HttpApi UDF - HTTP Server API
noellarkin reacted to TheXman for a topic
I think you are headed in the right direction. Let me know how it goes or if I can help. If you come up with new or modified functionality that would benefit others, I would definitely consider adding to the HTTPAPI UDF lib.1 point -
Yes it can really be frustrating to find out if you have to use invoke click expand patterns. I frequently just identify the element and based on xyhw just send a mousemove and mouseclick instead of using the pattern methods.1 point
-
Hey, I've noticed that my script get relatively very big just when I add one extra function that requires an additional #Include. So, is there such a tool in here that would scan my script and then filter out the Globals and the constant included so that only the ones really needed remains? I'm asking this because; first of all I want my script to be smaller in size (even if it was just for 100 KB, it worth it to my needs). Only if it would make it less in size, that is. And secondly, I believe that it would decrease the amount of false alarms that appears in AV's scans. Yeah, I've got a feeling that it's related to this matter somehow. So, any ideas?1 point
-
Derak, If you are using the full SciTE package (and if not, why not?) then add these lines to the beginning of your script: #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/SO Then Jos' little marvel will strip out all unused functions and constants from your code. Of course, remember that your script is a pretty small part of the .exe - the majority is the AutoIt stub. However, as a major grocery chain here says: "Every little helps!". M231 point