Jump to content
Macro Express Forums

rberq

Members
  • Content count

    705
  • Joined

  • Last visited

  • Days Won

    30

rberq last won the day on April 16

rberq had the most liked content!

Community Reputation

12 Good

About rberq

  • Rank
    Expert

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. rberq

    Multiple Choice Question

    In what way is it not working? Do you mean the second and third boxes never appear? Are you having the multiple choice box return the TEXT of the selected item, or the VALUE of the selected item?
  2. rberq

    win key not working

    I am using mex 3.9.0.1 on Windows 7. Texttype win does not work for me, either. Edit: Also does not work for me with ME Pro.
  3. rberq

    Simple one-off alarm fails

    I am on Windows 7.
  4. rberq

    Simple one-off alarm fails

    I tried it with an MP3 file. At the scheduled time the macro ran, sounded a chime, then displayed the text box. The MP3 file was a short piece of music, so I'm not sure why it chimed instead of playing the music -- probably because ME doesn't know what program to associate with the MP3 file type.
  5. rberq

    HEX Variables

    Sixteen IF statements in all, to place a displayable text character into a text variable: If Variable %N1% = 0 Variable Set String %T10% "0" End If If Variable %N1% = 1 Variable Set String %T10% "1" End If .... If Variable %N1% = 10 Variable Set String %T10% "A" End If .... If Variable %N1% = 15 Variable Set String %T10% "F" End If
  6. rberq

    HEX Variables

    Yes, integer arithmetic would give a whole number quotient. To isolate the remainder you could multiply the quotient by 16 and subtract the product from the original random number -- again entirely with integer arithmetic. Or as you say, just generate two separate random numbers, one for each character you want to end up with. I tried "Variable Set to ASCII Char" and it did not product a useful result. I was assuming that you want displayable characters -- for example, random number 26 is hexadecimal x'1A', so you want two displayable characters, '1' and 'A'. You are right about having to work hard only for generating characters 'A' through 'F'. The test macro below will properly produce a text string for value '9' but will NOT produce an 'E' for value 14. Run it and see. Variable Set Integer %N1% to 9 Variable Modify Integer: Convert %N1% to text string %T1% Variable Set Integer %N2% to 14 Variable Modify Integer: Convert %N2% to text string %T2% Text Box Display: %T1% %T2% But you don't know ahead of time whether you will be generating a numeric character or a letter character. The series of IF statements I suggested will handle both cases.
  7. rberq

    HEX Variables

    A hex value expressed by two characters can be anything from x'00' to x'FF', which is decimal 0 to 255. So you could (1) Generate a random integer from 0 to 255. (2) Using Macro Express's integer arithmetic, divide the generated integer by 16, ignoring the remainder, and you will have a quotient from 0 to 15 representing the leftmost hex character. (3) The remainder from the above division will likewise be an integer from 0 to 15 repesenting the rightmost hex character. (4) Use a simple lookup array, or a series of IF statements, to convert the two integers to letters/numbers. IF QUOTIENT = 0 THEN LEFTLETTER = '0' IF QUOTIENT = 1 THEN LEFTLETTER = '1' ... ... IF QUOTIENT = 14 THEN LEFTLETTER = 'E' IF QUOTIENT = 15 THEN LEFTLETTER = 'F' ... ... IF REMAINDER = 0 THEN RIGHTLETTER = '0' IF REMAINDER = 1 THEN RIGHTLETTER = '1' etc. There is probably a more elegant way to do it, but I'm into brute force this morning.
  8. rberq

    Macro stops at login

    On a couple occasions I set up ME on an always-active network server to do off-hours functions like this. Depends whether you have such servers available, whether you have permission to use them, and so on. You might not even need ME if you can use the Windows scheduler on the server to start the job.
  9. From Samrae's example -- would this work, to launch it directly from ME without a batch file? Program Launch: "Powershell.exe"
  10. rberq

    Tips for beginners

    Go methodically through the commands and use them one by one in very simple macros. Use the Help system. When you do something for learning purposes, make frequent use of Text Box Display so you can see the result. Sounds tedious and probably is, but I should have done it early on. I still occasionally find command options that I have never used. A couple simple examples: // Variable Set String %T1% " ABCD " Variable Set String %T2% " EFGH " Variable Modify String: Append %T2% to %T1% Text Box Display: T1 result is ***%T1%*** Variable Modify String: Trim %T1% Text Box Display: T1 result is ***%T1%*** // Variable Set String %T1% "000123" Text Box Display: T1 result is %T1% Variable Modify String: Convert %T1% to integer %N1% Text Box Display: N1 result is %N1% Variable Modify Integer: Convert %N1% to text string %T1% Text Box Display: T1 result is %T1% //
  11. Didn't you already ask the first question in another thread? I believe the answer was, the scheduled macro will not run again if the previous instance is still running. I would recommend you do some testing to make sure that is true. For your related question, this should work: 1) When your macro starts, create a temp file -- let's call it marker.txt. 2) Start the batch script. 3) Use a Repeat loop to check over and over for the existence of marker.txt. Do not exit from the Repeat loop as long as the file exists. Somewhere inside the Repeat loop, include a few seconds delay -- this is just so looping won't chew up so much processor time. 4) As the last step in your batch script, delete marker.txt. 5) Next time the macro goes through the Repeat loop, the file will no longer exist, so exit from the Repeat and the macro can continue with whatever else it needs to do.
  12. rberq

    Program macro at random interval

    This is what I think Cory is saying, simplified just a little: :BEGIN (generate a random number between 60 and 120) Repeat until RAND > 60 Variable Set Integer (random) RAND (max 120) Repeat end Repeat until RAND = 0 Wait for time to elapse (1 minute) Subtract 1 from RAND Repeat end Do whatever stuff the macro is intended for GOTO :BEGIN This will ALWAYS wait between one and two hours, though you said you want it USUALLY to wait that long. You can expand the random number range if desired to get some times less than an hour or more than two hours.
  13. rberq

    Beginner's question

    The Macro Express Help feature is good for looking up something like this. I found the following note: Note 1: If a macro is scheduled to run every 1 second and the macro takes 5 seconds to execute, then this function will not operate properly. A bit ambiguous. I tested with a very simple macro scheduled to run every 15 seconds and display a text box that went away only when I clicked OK. If I did not click to allow the macro to end, a second text box did not appear no matter how long I waited. Don't know if the second (or third or fourth etc.) instance was queued, or was running but frozen, or what. You could set up a test macro and experiment with various timings to get a better feel.
  14. rberq

    Program macro at random interval

    Take a look at Cory's suggestion, though -- his is simpler to program. Execute the macro only once, so it does its thing then idles for the random time before doing its principle function again, generating a new random interval, and so on. You don't even have to intervene to start it running, just schedule it to run when Macro Express is started. My thinking is kind of stuck at the Macro Express 3 level which doesn't allow for more than one macro to run at a time -- therefore I missed the option of having your macro run only once for a duration of many hours or even days. With ME3 if the macro runs continuously, then no other macros can run. With ME Pro a long-running macro doesn't block other macros from running.
  15. rberq

    Program macro at random interval

    Schedule your macro (with Macro Express) to run every 1 minute. Durin each run of the macro: If "timer file" does not exist, generate a random number between 60 and 120 (because you want between 1 and 2 hours). Store the number in a text file ("timer file"). If "timer file" DOES exist, read it, decrement the number by 1, and check whether the number has reached zero. If not, store the new (decremented) number in "timer file" and exit from the macro without doing anything else. If time HAS reached zero, delete "timer file" and do whatever other stuff the macro is intended for. Because you have deleted "timer file", next time the macro runs 1 minute later the whole scheduling process will begin again. If you have Macro Express run your macro every 5 minutes, instead of every 1 minutes, then the decrement described above would be 5, not 1. And so on -- since you have a fairly broad time range for your random runs, it is not really necessary to check "timer file" as often as every minute. Somebody will probably embarrass me with a much simpler method, but that's all I have come up with for now.
×