Search the Community
Showing results for tags 'Convert'.
-
I'd like to take a string like|this and turn it to a 1 key array such as: Array[1] ( [0] => like|this ) There seem to be 2 functions (one internal and the other is an UDF) that are meant for this, but both of which require to supply a delimiter for this to always work. Now of course I can fake a delimiter that I don't expect to exist (like @CRLF). Alternatively, I can use a middleman variable, but it seems like a waste. Is there a more normal (i.e. delimiter and middleman free) way to do it? $foobar = "like|this", $foobar2 = $foobar, $foobar3 = $foobar $foobar = StringSplit($foobar, @CRLF, 3)) ; the delimiter here is a mandatory field ; or include <Array.a3u> $foobar2 = _ArrayFromString($foobar2, @CRLF)) ; the delimiter here is optional but the default "|" will break my string ; or local $foobar_temp[1] = [$foobar3] ; making up a whole new parameter just for this $foobar3 = $foobar_temp
-
hey, I'm trying to convert a PNG and a JPG file into a CUR file in Autoit. Does anyone have a role there? I couldn't find anything
-
hello autoit team please i've a question for you. am creating a audio player and in this audio player i want to show the current trac info such as the total time and the position ... etc i know i can show it as label but the screen reader for the blind read the text every change because it have a screen scan what i want is to show this informations but such image or icon i mean i need to create GUICtrlCreatepic or GUICtrlCreateicon .... or some thing as that and show this informations as image on it i think that i can do that with the _GDIPlus functions but i couldn't find the currect way to do it i tried the _GDIPlus_GraphicsDrawString but i couldn't know how it work what i need is a small example that create a GUI and add a multy line text to it as graphic or image. so i need a simple way because it will changed every sec i hope any one can help me to do that global $GUI = GUICreate("text", 400, 400) global $label = GUICtrlCreateLabel(GetText(), 10, 10, 380, 380) GUISetState() do sleep(100) until GUIGetMSG() = -3 exit func GetText() return StringFormat("file name is test.mp3 \r\n total time is 00:30:00 \r\n position is 00:05:50") endFunc
-
Hello everyone, I decided to rewrite/convert some autohotkey scripts to autoit. I know Ahk pretty well, but I'm obviously new at autoit. I've done my best with this one and the problem I'm getting now is the error message "Error: Unknown function name". Forgive me if it's something simple, but like I said, I'm completely new at this (been at it for one day, while ahk for years). Here is the autoit script: #RequireAdmin If WinExists(@ScriptName) Then Exit AutoItWinSetTitle(@ScriptName) $slowness = IniRead ("extra.ini", "slownesss", slowness, "0") $slowdelay = IniRead ("extra.ini", "slownesss", slowdelay, "0") Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{DELETE}", "Terminate") $track = 0 while 1 global $pos2 = mousegetpos() Local $coord1 = PixelSearch (511, 388, 511, 424, 0xBD302E, 30) If Not @error Then exitloop EndIf wend For $redloop = 1 to 10 step 1 global $pos2 = mousegetpos() local $coord2 = PixelSearch (511, 388, 511, 424, 0xBD302E, 30) If Not @error Then $track = 1 EndIf If @error Then ExitLoop EndIf If $redloop > 0 Then $fade = $redloop / 100 EndIf $move = $slowness + fade if $track = 1 Then global $pos1 = mousegetpos() $newx1 = $pos1-$xpos2 $newx2 = $pos2-$xpos1 $movex = $newx2/move _MouseMovePlus($movex,0) global $pos2 = mousegetpos() $track = 0 EndIf Next while 1 sleep 1 local $coord3 = PixelSearch (511, 388, 511, 424, 0xBD302E, 30) If @error Then exitloop EndIf WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc ; mousemove------------------------------------------ Func _MouseMovePlus($X, $Y,$absolute = 0) global $MOUSEEVENTF_MOVE = 1 Local $MOUSEEVENTF_ABSOLUTE = 32768 DllCall("user32.dll", "none", "mouse_event", _ "long", $MOUSEEVENTF_MOVE + ($absolute*$MOUSEEVENTF_ABSOLUTE), _ "long", $X, _ "long", $Y, _ "long", 0, _ "long", 0) EndFunc Func Terminate() Exit 0 EndFunc And here is the original Ahk script which I wrote (and works perfectly) : #SingleInstance force CoordMode, pixel,screen CoordMode, mouse,screen SetBatchLines -1 IniRead, slowness, extra.ini, slownesss, slowness IniRead, slowdelay, extra.ini, slownesss, slowdelay mouseXY(x,y) { DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0) } track = 0 loop { mousegetpos, xpos2, ypos2 PixelSearch, Px, Py, 511, 388, 511, 424, 0xBD302E, 30, fast RGB if errorlevel = 0 { sleep slowdelay gosub, red } } red: loop, 10 { mousegetpos, xpos2, ypos2 PixelSearch, Px, Py, 511, 388, 511, 424, 0xBD302E, 30, fast RGB if errorlevel = 0 track = 1 if errorlevel = 1 break if (a_index > 0) fade := (a_index / 100) move := (slowness + fade) if track = 1 { MouseGetPos, xpos1, ypos1 newx1 := (xpos1-xpos2) newx2 := (xpos2-xpos1) mousexy(newx2/move, 0) mousegetpos, xpos2, ypos2 track = 0 } } loop { sleep 1 PixelSearch, Px, Py, 511, 388, 511, 424, 0xBD302E, 30, fast RGB if errorlevel = 1 return } return Any help about the error is greatly appreciated and perhaps something else you may spot. Thanks in advance
- 5 replies
-
- autohotkey
- unknown function name
-
(and 1 more)
Tagged with:
-
I need help turning this string "20180913221626" into a formatted time string. I need to go from this: 20180913221626 to this: 09/13/2018 10:16 PM I do not always know what the date will be so I can not just use a variable I need to actually convert/format. I did see an older post in the forms that was basically the same question only the other guy did not post the working code and I can not figure out how to use _AD_GetObjectProperties properly to get what I want. As always any help would be appreciated. Here is the code I use to find the date, but it always gives me the unformatted version. ;retrieve the items object $oItem = $oOutlook.Session.GetItemFromID($aItems[1][0], Default) $oItem.GetInspector $eSentOn = $oItem.SentOn ; When was the email sent? MsgBox("", "Sent On of the email", $eSentOn) ;******************************************************************************* ; Formats the date and time from the email ;******************************************************************************* ;Local $fDatenTime = _DateTimeFormat($eSentOn, 1) ;MsgBox("", "Formatted email time", $fDatenTime) $aProperties = _AD_GetObjectProperties($eSentOn) _ArrayDisplay($aProperties, "Did the conversion work?")
-
Has anybody ever imported a VuGen recording into AutoIT? I like the recording cabability of VuGen and thought it would be great to use and then pull it into AutoIT to compile into an EXE. Jim
- 2 replies
-
- loadrunner
- vugen
-
(and 1 more)
Tagged with:
-
Good evening I was looking around the forum if I could find a function that allows to convert a string into a 2 dimensional array... The first column of the array is always the same, but the rows could change... I have a pattern like: Column A|Column B Static Text 1|Data 1 Static Text 2|Data 2 Static Text 3|Data 3 Static Text 4|Data 4 Where, Static Text (1...4) will be always the same, and I don't want to change them... But, Data 1...4 are dynamic fields... So, I could have the pattern above AND I coould have the pattern I'm going to show you right below Column A|Column B Static Text 1|Data 1 Static Text 2|Data 2 Static Text 3|Data 3 Static Text 4|Data 4 Static Text 1|Data 5 Static Text 2|Data 6 Static Text 3|Data 7 Static Text 4|Data 8 How can I do in this case? Thanks for everyone's help
- 18 replies
-
- string
- 2-dimensional
-
(and 2 more)
Tagged with:
-
-
Good morning guys I'd like to know if there is a way to convert a PDF in CSV or, eventually, in TXT, in order to read from it, like a database... I have a PDF and I think ( I dind't search a lot on the forum ) with AutoIt, but I'd like work with Excel styles... Does anyone know a good program which convert PDF to CSV? PS: the PDF file is 5 MB, and it contains 439 pages... Thanks everyone for the help
-
Hi, I have a binary string that I want to convert to octal, The string I want to convert is, 10001001010100000100111001000111000011010000101000011010 The String is read from a .txt file Once its converted it should read this, 4 2 2 5 0 1 1 6 2 1 6 0 6 4 1 2 0 6 10 which I want written to the .txt file to overwrite the original binary string. The 10 at the end should be ignored as there are not 3 digits to convert. I'm thinking it should read the string from left to right to get the next 3 digits before converting them to its oct value. would this be the best way to do this or is there a better way? If i'm on the right track can anyone give me an example of how to write this script please? I've looked at the StringLeft function & StringReplace but I'm not sure how to use them the correct way to accomplish what I'm trying to do. Thanks
-
-
May be some of you know the shareware VectorMagic who permit to easily convert bitmap Images to clean Vector Art ! Pic2Vector 1.0.1.4 is free, and can give similar effects ! I was interested by some effects added to a photo. I'm not using gdi for the vectorization, but 2 command line tools : Autotrace 0.27 with ILDA file support for converting bitmap to vector graphics Custom Version at : http://www.raycomposer.de/en/ressources/autotrace/ More general infos : http://autotrace.sourceforge.net/ GPL Ghostscript 9.07 use here for converting vector graphics to Jpeg. More infos : http://www.ghostscript.com/doc/9.07/Use.htm# example 1 example 2 example 3 example 4 example 5 example 6 example 7 example 8 Free to you to play with settings for see changes.(Infos with tooltip added to each type of setting) If UAC Enable, use right click, execute as Admin. Click on vectorized Pic for display it in fullscreen with Windows picture Viewer. You can save result to jpg, png, bmp or gif format. Changes Version 1.0.1.4 Settings can be saved by creating a profil. No more appcrash window for autotrace.exe. New buttons for display compatibility with xp. Externals files are embedded, no more downloads needed. Some minor improvements. Added new examples to topic. Tested with WinXp, Win7 and Win 8.1. previous downloads : 666 source and executable are available in the Download Section Hope you like it !
-
Does anyone have a concrete way of converting/decoding REG_BINARY?
- 6 replies
-
- reg_binary
- registry
-
(and 1 more)
Tagged with:
-
Hello, I've created a script for a Bingo / Lottery kind of game in PHP. Now I want to make this a standalone application in AutoIT. I really dont know how to do that as i´m just a Autoit-beginner. Can you help me with it? In general I have the following files: data.csv - the "database" where the bingo-numbers are stored, together with the name of the candidate index.htm - to show the 'program' in a browser input.php - to take care of input results.php - to show the winners numbers.txt - the winning numbers to compare with I have the following files: Input.php: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> body { font-family:Times New Roman, Verdana,Geneva; font-size:12px; color:#000000; margin-left:20px; background:#F7F5DF; width: 300px; } H2 { font-family:Times New Roman, Geneva; font-size:16pt; color:#840018; text-align:center; } </style> <link rel=stylesheet href="style.css" TYPE="text/css"> <title>Input</title> <?php $sepsign = '/;/'; $text = ''; $wnumbers = ''; $counter = 0; $filed = "data.csv"; $fileg = "numbers.txt"; $in_numbers = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $name = $_POST['name']; $in_numbers = $_POST['$in_numbers']; } $fd = fopen($fileg,"r") or die ("Unable to open $file."); $text = fread($fd,filesize($fileg)); $wnumbers = preg_split($sepsign,$text); // wnumbers is an array with winning numbers Fclose($fd); for ($j = 0; $j < 10; $j++) { for ($i = 0; $i < 10; $i++) { if ($wnumbers[$i] == $in_numbers[$j]) { $counter++; } } } // $counter will contain the number of matches on the input # Append and write the line in a file <number of matches>;<name>;<number 1>;<number 2>; etc $fdb = fopen($filed,"a+"); fwrite($fdb,$counter . ";" . $name); for ($i = 0; $i < 10; $i++) { fwrite($fdb,";" . $in_numbers[$i]); } fwrite($fdb,"\r\n"); fclose($fdb); ?> <h2><br>Your input has been stored successfully!</h2> </body></html> Results.php: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <HTML><head> <meta http-equiv="Content-Type" content="text/HTML; charset=iso-8859-1"> <style> body { font-family:Times New Roman, Verdana,Geneva; font-size:12px; color:#000000; margin-left:20px; background:#F7F5DF; width: 300px; } H2 { font-family:Times New Roman, Geneva; font-size:16pt; color:#840018; text-align:center; } </style> <title>Result</title> </head><BODY> <h2>Result of the draw</h2><hr><br> <?php $sepsign = '/;/'; $text = ''; $filed = "data.csv"; $fileg = "numbers.txt"; $fd = fopen($filed,"r") or die ("unable to open $file."); $text = fread($fd,filesize($filed)); $lines = preg_split("/\r\n/",$text); // Will split the file data.csv in lines $count_reg = count($lines); fclose($fd); sort ($lines); reset($lines); for ($i = ($count_reg - 1); $i>($count_reg-4); $i--) { // The three highest scores are showed $collums = preg_split($sepsign,$lines[$i]); print "<b>Name: " . $collums[1] . "<br>"; print "Number of matches: " . $collums[0] . "</b><br>"; print "Input: "; for ($j = 2; $j < 12; $j++) { print $collums[$j]; if ($j <> 11 ) { print ", "; } // to prevent the "," to appear after the last number } print "<br><br>"; } $fd = fopen($fileg,"r") or die ("Unable to open $file."); $text = fread($fd,filesize($fileg)); $wnumbers = preg_split($sepsign,$text); Fclose($fd); print "<br><b>Bingo numbers</b><br><hr>"; for ($j = 0; $j < 11; $j++) { print $wnumbers[$j]; if ($j < 9 ) { print ", "; } // to prevent the "," to appear after the last number } ?> </body></html> Index.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> body { font-family:Times New Roman, Verdana,Geneva; font-size:12px; color:#000000; margin-left:20px; background:#F7F5DF; width: 300px; } H2 { font-family:Times New Roman, Geneva; font-size:16pt; color:#840018; text-align:center; } </style> <title>Bingo game, input numbers.</title> </head><body> <form action="input.php" method="post" name="form"> <center> <h2>Input numbers</h2> lines <input type="text" name="lines" size=20 maxlength=50><br><br> Number 1 <input type="text" name="$in_numbers[0]" size=4><br> Number 2 <input type="text" name="$in_numbers[1]" size=4><br> Number 3 <input type="text" name="$in_numbers[2]" size=4><br> Number 4 <input type="text" name="$in_numbers[3]" size=4><br> Number 5 <input type="text" name="$in_numbers[4]" size=4><br> Number 6 <input type="text" name="$in_numbers[5]" size=4><br> Number 7 <input type="text" name="$in_numbers[6]" size=4><br> Number 8 <input type="text" name="$in_numbers[7]" size=4><br> Number 9 <input type="text" name="$in_numbers[8]" size=4><br> Number 10 <input type="text" name="$in_numbers[9]" size=4><br><br> <input type="submit" value="Submit..."></FORM> </center> <p /> <p /> </body></html>
-
Hello AutoIT Gurus/MVPs! Can someone convert my vbs script to autoit script please? Please check below: Option Explicit Dim Fso, Ws Set Fso = CreateObject("Scripting.FileSystemObject") If Fso.FileExists("error.log") Then Fso.DeleteFile("error.log") End If WScript.Sleep (500) Set Ws = CreateObject("WScript.Shell") WScript.Sleep (1000) Ws.Run "cmd /k validitor --dtd ""custom.dtd"" -c *.xml > error.log & exit", True MsgBox "Successful. Please refer to a log file." Thanks, Ray
-
How can I convert system time to PST time? What functions should I use? This is needed, for instance, for telling current time in Canada. Thank you.
-
In a nut shell I have some excel files with data extracted from calendars and I am trying to get some statistics. One of the things I would like to do is compare on which days certain things happen. So I was curious if anyone had an easy way to convert a date in a format (something like XX/XX/XX) to a day Mon-Fri. Thanks!
-
How to convert string that retrieved from inputbox into math equation. for example, if the user type a math equation like : 2x^2+3x-4 how to convert it into math equation so we can process the result?