Valhalla1
Active Members-
Posts
23 -
Joined
-
Last visited
Valhalla1's Achievements
Seeker (1/7)
0
Reputation
-
thanks for the reply. That looked like it should work when I saw it, but when I tried it it seems to only hit the key once, not hold it down. The same thing happens if I remove the loop entirely. Curious, the Send("{a down}") command only seems to truly hold down the button if it is in a While 1 infinite loop here is the cleaned up code using your example, which doesn't truly hold down the a button like it should AutoItSetOption("WinTitleMatchMode", 2) ;#NoTrayIcon #include <GUIConstants.au3> #include <Date.au3> GUICreate("Basic GUI with Buttons", 205,200) GUICtrlCreateLabel ( "title goes here" , 270, 140, 200, 35 ) $Button6= GUICtrlCreateButton("Control DOWN", 20, 25, 150, 40) $Button7= GUICtrlCreateButton("Control UP", 20, 65, 150, 40) $Close= GUICtrlCreateButton("E&xit", 20, 105, 150, 40) $filemenu = GUICtrlCreateMenu ("Men&u") $Helpme = GUICtrlCreateMenuItem ( "&Help", $filemenu ) ;------------------------------------------------------------------------ GUISetBkColor ( 0xFFFFFF ) GuiSetState (1) While 1 $msg = GUIGetMsg() Select Case $msg = $button6 do Send("{a down}") ;Holds the A key down until $msg = $button6 Case $msg = $button7 do Send("{a up}") until $msg = $button7 Send("{a up}") Case $msg = $Close Exit EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend
-
I am trying to build this same script actually, but I replaced LCTRL with "a" but when I use example #3 it only sends 1 instance of "a", even though I have Send("{a down}") it should be holding down the button until Send("{a up}") but it doesn't
-
I am trying to write a script which will hold down a keyboard key when the user clicks a button, and when they click another button, the key is released. There is also an exit button Here is what I have so far. It will start holding the key down when I press the button, due to the While 1 infinite loop, but pressing the button to release the key or exit doesn't work as its stuck in the loop. How can I modify it so it holds the keydown but lets off when I press the right button ? If I get rid of the While 1 loop, pressing the button only sends 1 instance of the key, it doesn't hold it down like it should. AutoItSetOption("WinTitleMatchMode", 2) ;#NoTrayIcon #include <GUIConstants.au3> #include <Date.au3> GUICreate("Basic GUI with Buttons", 205,200) GUICtrlCreateLabel ( "title goes here" , 270, 140, 200, 35 ) $Button6= GUICtrlCreateButton("Control DOWN", 20, 25, 150, 40) $Button7= GUICtrlCreateButton("Control UP", 20, 65, 150, 40) $Close= GUICtrlCreateButton("E&xit", 20, 105, 150, 40) $filemenu = GUICtrlCreateMenu ("Men&u") $Helpme = GUICtrlCreateMenuItem ( "&Help", $filemenu ) ------------------------------------------------------------------------ GUISetBkColor ( 0xFFFFFF ) GuiSetState (1) While 1 $msg = GUIGetMsg() Select Case $msg = $button6 While 1 Send("{a down}") ;Holds the A key down WEnd Case $msg = $button7 Send("{a up}") Keyup() Case $msg = $Close Exit EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend
-
I have a folder full of jpgs. I want to write some autoit code that will display a jpg and give me an input box. Once I type in the input box to identify the jpg, the script will open a text file and search for the filename of the jpg, and append to the end of the line the text that I entered. so theres a txt file with a list of jpg file names aaa.jpg bbb.jpg ccc.jpg my code will display aaa.jpg, I will type "cats", and it will append "cats" to the text file after the correct filename aaa.jpg cats bbb.jpg ccc.jpg and then continue on to the next jpg and repeat my problem is I'm not sure how to get it started. How do I get my code to grab the filename of a jpg, store it to a variable? the filenames all have unique strings of numbers (datecodes). once I have the filename stored in a variable I'm pretty sure I can handle having the script search and append the text file, and displaying of the jpg
-
Hello, lets say I have a java app "Solve" and I pass it 3 paramters on the command line, and it outputs like this : C:\TEST\solve> java Solve a b c Output line 1 : foo Output line 2 : bar Output line 3 : foobar I'm trying to automate this in autoit and capture all 3 lines of output to a string variable. However, it is only capturing lines 1 and 2, and ignoring line 3. I guess because there is an empty whitespace line after line 2 and before line 3. How can I get it to capture everything ? Here's the code thats only capturing line 1 and 2 : $a = "A" $b = "B" $c = "C" $line2 = Solve() Msgbox(0,"",$line2) Func Solve() Local $result = Run(@ComSpec & " /c java.exe Solve "& " " & $a & " " & $b & " " & $c, "C:\TEST\solve", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $line While 1 $line = StdoutRead($result) If @error Then ExitLoop ;MsgBox(0, "STDOUT read:", $line) Wend While 1 $line = StderrRead($result) If @error Then ExitLoop ;MsgBox(0, "results", $line) Return($line) Wend Return($line) EndFunc
-
my scripts work fine on Intel, broken on AMD
Valhalla1 replied to Valhalla1's topic in AutoIt General Help and Support
I still can't figure this one out. -
I have a collection of scripts I wrote which automate some repetitive functions. They were developed on a 32bit Intel processor computer, and always work fine when I run them on other Intel computers, but when I run them on a computer with an AMD64 processor, they don't work now a little clarification, they are all actually running on a 32bit windows xp virtual machine under VMware, and they work fine as long as the host box has an Intel cpu (32bit or 64bit intels work fine). Anyone encountered anything like this ? Sometimes the scripts work under vmware XP on AMD hosts, they just take an extremely longer amount of time for each step, or sometimes they just do not work at all. the scripts are basically utilizing the functions of Pixelgetcolor(), Pixelchecksum(), MouseClick(), some loops and not a lot else. This has been a problem for years for me and I've just told my co-workers "sorry, get an Intel cpu if you want to run my scripts" but we have some new people and they are all running AMD machines and I'd like to know why my scripts dont work on AMD cpus
-
How would I click this button on webpage ?
Valhalla1 replied to Valhalla1's topic in AutoIt General Help and Support
bingo thanks, fantastic -
here's the html code snippet which produces a couple buttons I need to click in my script. <div align="center"> <button onclick="_submit(); return false;">Calculate</button> <button onclick="_clear(); return false;">Clear</button> </div> I'm trying to have my script click on either button but having trouble. I've tried: $oSubmit = _IEGetObjByName ($oIE, "Calculate") _IEAction ($oSubmit, "click") gives a warning: --> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: Calculate, Index: 0)--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType
-
how to delete everything after TAB in text file ?
Valhalla1 replied to Valhalla1's topic in AutoIt General Help and Support
thanks.. I dunno how u guys are so good -
I've got a text file that consists of 1 line with a few letters/numbers, followed by a TAB, followed by some numbers is it possible to get autoit to delete the TAB and everything after it, leaving just the characters that preceded the TAB also once I've got that, how could I have it add line breaks in between every two characters. For example I'd have 2s5cThJs[TAB]5.3322 I'd like it first to chop the tab and trailing numbers, leaving 2s5cThJs then add the line breaks giving you 2s 5c Th Js
-
an ugly hack is to have autoit open Notepad.exe, paste the clipboard data, save the file and select Unicode in the dropdown on the save dialog gui, then close notepad. this however is slow, ugly hack, and unstable. I need this process to be smoothly integrated in my autoit so accomplished within autoit or a simple CLI tool
-
I'm trying to automate a process, and I've run into a snag.. I have a 3rd party application which generates some text that I need to work with in autoit unfortunately its giving me trouble, because it uses unicode characters in the text . specifically these four which represet card suits: ♠♦♥♣ this program outputs some text to the clipboard, I need autoit to dump that clipboard data to a text file. Right now using ClipGet() and FileWrite it strips all the unicode out and sends only ?'s. I open the file with mode 16 Unicode, but still strips them. I've tried modes 32, 128.. same result $results = ClipGet() FileOpen("z:\test.txt",16) FileWrite ( "z:\test.txt", $results ) FileClose("z:\test.txt")I've tried a seperate tool, swiss file knife CLI text program which has a clipboard-to-text function but it has the same issue, it outputs ??'s How can I output this clipboard data to a text file easily ? The problem seems to be with FileWrite and not ClipGet(), because if I have autoit show me a MsgBox with the ClipGet() data it shows the unicode card suits just fine