Jump to content
Macro Express Forums

lemming

Members
  • Posts

    140
  • Joined

  • Last visited

Everything posted by lemming

  1. The Repeat Start command has its own repeat counter. Loop up "Repeat" in the Macro Express Help for details and examples.
  2. I've written a macro that does exactly that. It's probably not as fast as ol3's program, but it has the advantage of being a "pure" Macex script. Plus it's fairly easy to understand, IMHO. I've uploaded it into the Third Party Tools section -Lemming.
  3. It's probably easier to use Word's own search features in this case. With your doc, I just did a search for any text with black font, and replaced it with nothing. After the search & replace, all I had left was the red text, and some white space, which should presumably be easy to deal with. Lemming
  4. Hi all, and happy new year. Here's my proof-of-concept routine for a rudimentary image search in Macex. It consists of two macros: 1) Acquire Search Pixels macro 2) Search For Pixels macro Acquire Search Pixels will define the line of pixels to search for. The default script acquires 25 pixels to the right of the current cursor position. It then saves the data to a text file (Default is C:\PixelSaveFile25.txt). The Search For Pixels macro will figure out the size of the current window, and set up a search grid for the right half only. It then "reads" the grid line by line, starting at the top, to search for the 25 pixels defined earlier. If it finds the pattern, it will beep and move the mouse cursor to the start (i.e. the left) of the pattern. Note: Acquire Search Pixels only works with real cursors, i.e. thr pointing arrow and not the "I" cursor found in word processors. QUICK START 1) Download or copy the two macros from here. Use the "Src for pixels in right-hand window" one instead of "Src for pixels in current window". 2) Define hotkeys for the macros. 3) We will test the macro on this webpage. Yes, this very page. We'll be searching for a button on this page. You can choose any of the buttons typically found in this forum - "Add Reply", "New Topic", "New Poll", "Quote", etc. Basically any button on the right of the window which is quite colorful or unique. 4) First we will acquire a search pattern. Just place the cursor on any button you like, but keep it near the left edge of the button - the script samples 25 pixels to the right of the cursor. Just hit the hotkey for Acquire Search Pixels, and the script should pop up a window titled "Pixels acquired" with some info. 5) To prove that the search really works, just move, resize, or scroll around in the window. This will move the position of the button. I recommend making the window smaller so that the search will be faster, but also make sure the button is still on the right side. 6) Now hit the hotkey for Search For Pixels, and if all goes well, the button will be found in a few seconds. You'll hear a beep and the cursor will be moved to the button (to the left of it, just like when you acquired pixels). To create these scripts, I had to work around some major shortcomings in the Macex script language, namely: 1) it lacks Arrays 2) it has a maximum no. of 99 variables, 3) and it is a strongly-typed language. I also wanted to create a script without dynamic execution (e.g. "Run Macro in Variable") and without any add-ons (sorry, Joe and company) or other external programs. The search does not have to be limited to the right-hand side. In fact, I've also included the macro for a full-window search. The search is currently quite slow, up to 6 seconds for a 360 x 300 grid on a P4 2.8GHz PC. The bigger the search area, the slower it takes. But this is version 1.0, so I hope to speed it up later. Would appreciate any ideas for improvements. -Lemming image_search.mex
  5. There's really no need for any 3rd party programs, or even MS Word. Win XP has all the tools by default. You can save formatted text using Wordpad (listed under Accessories). In fact, I find Wordpad preferable to Word for this purpose because pasting web content into Word seems to cause crashes on PCs (3 different ones so far, and same problem with Word 2000 and Word XP). Also note that copying formatted web content only seems to work using IE. If you copy any text from Firefox pages, it all becomes plain text. Another program you can use is the Windows XP Clipboard Viewer. For some reason MS made it hard to find and doesn't document it much. But it is installed by default - you can find it in C:\WINDOWS\system32\clipbrd.exe or do a search for clipbrd.exe To quote its help file: Using ClipBook Viewer, you can cut or copy information from another program and store it in a page that you can name, save, use again, and share with others. -Lemming
  6. As Cory has mentioned, you seem to have timing errors. You could look out for error messages, as he suggested, but you should also look out for "processing" messages and just plain blank screens (which I have occasionally encountered on some TEs). Another way out is to remove any potentially destructive actions from your macro. In your case, perhaps you could remove the "delete mail" part and just do that manually instead. That way at least, if your macro goes wrong it won't do so much damage.
  7. Hmm dunno if it works for you, but why not close windows right after you are done with them? Are all 30 windows required to be open at the same time? Perhaps you could insert "window closing" code at regular intervals. Assuming you know what windows to close, you could use the Activate Window command, followed by Wait for Window Title to Appear, and finally, Close Window. -Lemming
  8. This is usually a problem with the Task Scheduler, and not Macex. A couple of common errors can prevent Task Scheduler from working: 1) Username/password errors. Scheduled tasks need a valid user to execute. You can change this in the "Run as" and "Set password" boxes. 2) File/path errors. You can check this in the "Run" box. To troubleshoot Task Scheduler entries, just right-click on them and select "Run". If they don't run right away, then something is wrong. -Lemming
  9. Macex does work in most games, though it may not work properly in some cases. You should first check if your game has an option called "use system cursor" or "use system pointer". This will change the cursor to the default system one instead of the custom game cursor. That will usually make Macex more compatible with your game. However, quite a few games implement "click layers" in their GUI. For example, if the game pops up a dialog box or action box, Macex may not be able to click on it and will click on the background (scenery) under the box instead. Unfortunately, I haven't figured out a workaround for this problem. -Lemming
  10. Perhaps you could get your macro to do Ctrl-= (the 'equals' sign) instead of Ctrl-+. I noticed they share the same key, but to get + you normally have to press the shift key. -Lemming
  11. This is my general purpose routine for breaking out of a repeat loop without keyboard input. With this routine, you only need to move the mouse cursor to the upper left-hand corner of your screen to break out of a loop (or even your macro). The routine checks the current mouse cursor position, and if it's in the upper left-hand corner, a Break command (formerly Repeat Exit) will be issued, thus ending the loop. The routine actually checks a 3x3 (9 pixel) square starting from the upper left-hand corner (position 0,0). This is to account for "drifting" mice, and users with bad "aim". AFAIK, this routine is not processor-intensive, so you can stick it into multiple points in your repeat loops to ensure the mouse position is checked often. // --- Start mouse position checker --- Get Mouse Position Screen: %N7%, %N8% If Variable %N7% <= 2 AND If Variable %N8% <= 2 Break // break out of loop if upper left-hand corner End If // --- Ends mouse position checker --- Lemming <REM2:Author: Lemming - Company: Star Publications><REM2:A general purpose routine for breaking out of a repeat loop.><REM2:This checks the current mouse cursor position, and if it's in the><REM2:upper left-hand corner, a Break command (formerly Repeat Exit) will ><REM2:be issued, thus ending the loop.><REM2:><REM2:--- Start mouse position checker ---><MOUSEPOS:T:07:08><IFVAR2:2:07:6:2><AND><IFVAR2:2:08:6:2><BREAK><REM2:break out of loop if upper left-hand corner><ENDIF><REM2:--- Ends mouse position checker --->
  12. You might also consider the "Save to Environment Variable" capability under Variable Modify String. To read an env var, you can use the "Set Value from Environment Variable" under Variable Set String. -Lemming
  13. Viking, why not have your script pop up its own dialog box asking for the value to type in, then have the script type it into the said window? You can do this via: Variable Set String -> Prompt for value That way, the text is saved to a variable and there is no need for cut-n-paste. Lemming
  14. Yeah, I think that would be a great feature. In fact just being able to change the font size would be great. Right now, my system is running with a 17-inch monitor set at 1152 x 864 resolution. So the default (unchangeable) macex font in its dialog boxes looks really small. Lemming
  15. I find that bootup macro problems can usually be solved by adding a delay of a few seconds at the beginning. When Windows starts up, there is a lot of file and system activity, so any macro which is running at the same time may seem slow, or may not work properly. If you put in a delay of 10-15 seconds right at the beginning, that would delay your macro until windows has finished starting up. In fact, if you have many startup programs, you may want to extend the delay to 20-30 seconds. As for the Macro Playback Speed command you are using, I think it is not required. As stated in a previous reply, ME is already pretty fast. Also, I noticed that you have not selected the "Ignore Macro Speed Factor" option in your delays. This would affect the speed of your delays. for e.g. if your delay is 1 second, and the Macro Playback Speed is 100x, that would make your delay only 0.01 second, which is probably not what you intended. - Lemming
×
×
  • Create New...