Jump to content
Macro Express Forums

ellinarac

Members
  • Posts

    26
  • Joined

  • Last visited

Posts posted by ellinarac

  1. 11 minutes ago, terrypin said:

    It would be easier to use decimals. Try this:

    
    // Change the following start date and time to your requirement, e.g. 07/08/19 05:00:00
    Date/Time: Set %dtStart% to "07/08/19 16:00:00" // Set start = 4pm = 16:00
    Convert Date/Time to Decimal: %dtStart% => %dStart%
     
    // Change the following end date and time to your requirement, e.g. 07/08/19 07:30:00
    Date/Time: Set %dtEnd% to "07/08/19 16:58:00" // Set end = 16:44
    Convert Date/Time to Decimal: %dtEnd% => %dEnd%
     
    Date/Time: Set %dtCurrent% to the current date/time
    Convert Date/Time to Decimal: %dtCurrent% => %dCurrent%
    Text Box Display:  // TEMP, remove after testing
    If Variable %dCurrent% Is Greater Than or Equal To "%dStart%"
      AND
    If Variable %dCurrent% Is Less Than or Equal To "%dEnd%"
      Text Box Display: Continue
    Else
      Text Box Display: Close // TEMP, remove after testing
      Macro Stop
    End If

     

     

     

    CODE

    
    <COMMENT Value="Change the following start date and time to your requirement, e.g. 07/08/19 05:00:00"/>
    <DATE/TIME Flags="\xB1" Date="07/08/19 16:00:00" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Prompt="What is the start time for macro running?" Left="Center" Top="Center" Monitor="0" Variable="%dtStart%" IsDateVar="TRUE" _COMMENT="Set start = 4pm = 16:00"/>
    <CONVERT DATE/TIME TO DECIMAL Source="%dtStart%" Dest="%dStart%"/>
    <COMMENT/>
    <COMMENT Value="Change the following end date and time to your requirement, e.g. 07/08/19 07:30:00"/>
    <DATE/TIME Flags="\xB1" Date="07/08/19 16:58:00" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Prompt="What is end time for macro running?" Left="Center" Top="Center" Monitor="0" Variable="%dtEnd%" IsDateVar="TRUE" _COMMENT="Set end = 16:44"/>
    <CONVERT DATE/TIME TO DECIMAL Source="%dtEnd%" Dest="%dEnd%"/>
    <COMMENT/>
    <DATE/TIME Flags="\xB0" Date="07/08/19 15:48:26" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="0" Variable="%dtCurrent%" IsDateVar="TRUE"/>
    <CONVERT DATE/TIME TO DECIMAL Source="%dtCurrent%" Dest="%dCurrent%"/>
    <TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil Tahoma;}{\\f1\\fnil\\fcharset0 Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 dtCurrent\\f1  = \\f0 %dtCurrent%\\f1  (Date/Time format)\\f0 \r\n\\par dCurrent\\f1  = \\f0 %dCurrent%\\f1  (Decimal format)\r\n\\par \r\n\\par dtStart = %dtStart% (Date/Time format)\r\n\\par dStart = %dStart%\r\n\\par \\f0 \r\n\\par \\f1 dtEnd = %dtEnd% (Date/Time format)\\f0 \r\n\\par \\f1 dEnd = %dEnd%\r\n\\par \r\n\\par \\f0 \r\n\\par \r\n\\par \r\n\\par \r\n\\par }\r\n" Left="584" Top="485" Width="515" Height="296" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE" _COMMENT="TEMP, remove after testing"/>
    <IF VARIABLE Variable="%dCurrent%" Condition="\x04" Value="%dStart%" IgnoreCase="FALSE"/>
    <AND/>
    <IF VARIABLE Variable="%dCurrent%" Condition="\x05" Value="%dEnd%" IgnoreCase="FALSE"/>
    <TEXT BOX DISPLAY Title="Continue" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Current time is inside the allowed period of\r\n\\par %dtStart% to %dtEnd%\r\n\\par \r\n\\par so run the rest of your macro here.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>
    <ELSE/>
    <TEXT BOX DISPLAY Title="Close" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 Current time is outside the allowed period, so the macro will now stop.\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _COMMENT="TEMP, remove after testing"/>
    <MACRO STOP/>
    <END IF/>

     

    ok, I'll give this a shot. question, being it has the date as well as the time in this, will I have to change the date in the code every day? or can this be done with strictly time and not  have the date at all? or does this automatically adjust for the date, or does the date not matter at all? sorry, making "time based" macros is completely new to me. the most I have really done until a few months ago was basically doing "screen recordings" and then editing that as needed lol

  2. 28 minutes ago, terrypin said:

    It looks as if you're stopping the macro if it meets the conditions for running?

     

    And presumably those TBD commands at the end are temporary? (BTW, why such an odd time delay? Come to that, why a delay at all?)

    this is being used for an application that goes off line around 6am and then comes back online around 6:30am, thats why the weird times. I start it before I go to bed (usually around 1am) and let it run until I wake up (usually around 10 or 11am) and then if I am not home of a day I let it run as well. the way I originally had it set up it would stop the macro at 5:30am, but then after that you could not run it at all unless you disabled those commands in the macro because I guess since anything after 5:30am is greater than that set time up until 12am. so basically I was just messing around trying to figure out how to have it stop at 5:30 and then restart at 7. 

  3. ok, back to this again. I have noticed that the above isn't exactly doing what I want it to do after all. it is set to stop the macro if the time is equal to or greater than 5:30am, well, the problem I have is the macro will not run at all with this setup until it's after 12am and then stops at 5:30, so it won't run during the day. what I really need is the command for the macro to stop running between 5:30am and then start back up at 7am.
    what I tried was this, seems to do nothing at all lol

    <VARIABLE SET INTEGER Option="\x00" Destination="%TargetHour%" Value="5"/>
    <VARIABLE SET INTEGER Option="\x00" Destination="%TargetMinute%" Value="30"/>

    <VARIABLE SET INTEGER Option="\x00" Destination="%TargetHour2%" Value="7"/>
    <VARIABLE SET INTEGER Option="\x00" Destination="%TargetMinute2%" Value="00"/>
    <VARIABLE SET INTEGER Option="\x13" Destination="%Hour%"/>
    <VARIABLE SET INTEGER Option="\x14" Destination="%Minute%"/>
    <IF VARIABLE Variable="%Hour%" Condition="\x04" Value="%TargetHour%" IgnoreCase="FALSE"/>
    <AND/>
    <IF VARIABLE Variable="%Hour%" Condition="\x05" Value="%TargetHour2%" IgnoreCase="FALSE"/>
    <AND/>
    <IF VARIABLE Variable="%Minute%" Condition="\x04" Value="%TargetMinute%" IgnoreCase="FALSE"/>
    <AND/>
    <IF VARIABLE Variable="%Minute%" Condition="\x05" Value="%TargetMinute2%" IgnoreCase="FALSE"/>
    <TEXT BOX DISPLAY Title="Closing" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs24 Closing Macro \r\n\\par Due to Time\\b0\\f1\\fs16 \r\n\\par }\r\n" Left="641" Top="360" Width="167" Height="143" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x02" Delay="0"/>
    <DELAY Flags="\x03" Time="1857"/>
    <TEXT BOX CLOSE Header="Closing"/>
    <MACRO STOP/>
    <END IF/>

  4. kunkel321
    yea, I know the EnfIf doesn't "end the macro" it just ends the if condition. ran a test on mine for a few hours using variable times, so far seems to be working. now to incorporate it into other areas of my macros. This was simple and effective enough

    <VARIABLE SET INTEGER Option="\x00" Destination="%TargetHour%" Value="5"/>
    <VARIABLE SET INTEGER Option="\x00" Destination="%TargetMinute%" Value="30"/>
    <VARIABLE SET INTEGER Option="\x13" Destination="%Hour%"/>
    <VARIABLE SET INTEGER Option="\x14" Destination="%Minute%"/>
    <MACRO PLAYBACK SPEED Speed="1"/>
    <IF VARIABLE Variable="%Hour%" Condition="\x04" Value="%TargetHour%" IgnoreCase="FALSE"/>
    <AND/>
    <IF VARIABLE Variable="%Minute%" Condition="\x04" Value="%TargetMinute%" IgnoreCase="FALSE"/>
    <TEXT BOX DISPLAY Title="Closing" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs24 Closing Macro \r\n\\par Due to Time\\b0\\f1\\fs16 \r\n\\par }\r\n" Left="641" Top="360" Width="167" Height="143" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x02" Delay="0"/>
    <DELAY Flags="\x03" Time="1857"/>
    <TEXT BOX CLOSE Header="Closing"/>
    <MACRO STOP/>
    <END IF/>

     

  5. this may have been covered, but I haven't found it yet. 
    Anyway, what I want to do sounds like it would be easy enough, but I haven't been able to get it working. I have a 40 part macro, each part calls the next macro in line. I am trying to get it to stop the macro all together at the first part if the time of day is 6AM to 7AM. it can either completely stop at 6am, or if possible, stop at 6AM and restart at 7AM, either way. I saw something a while back (seems like years ago) that mentioned something along those lines but haven't been able to find it again. 

  6. On 7/21/2019 at 8:20 PM, kunkel321 said:

    What do you mean by "image recognition?"  Do you really need it to look at a picture and say, that's a house.  That's a tree.  That's a face.  Or is it actually Optical Character Recognition (OCR) that you want?  Or do you actually want to compare multiple images against each other?  Of course ME can't directly do any of that directly, but maybe you could get it to talk to other apps that can.  If you want OCR, there's a pretty cool freebie http://capture2text.sourceforge.net/   I used to have an AutoHotkey script that called Cap2Text.  I'm not sure if you could programatically get information back from it though..  There are free image-comparison tools too.  I don't know if any are automatable though.  

    as in, scan screen for an image, if image found, click on image, if image not found, wait for image. I have a second app that does support this function and have the 2 apps working together. just thought it would be nice to have everything working in ME than having to install and use 2 programs for 1 macro lol

  7. Yea, I really like the ease of ME for the most part. I may end up looking into the other app and rebuild my macros for it so I don't need 2 apps for one macro lol, I'm also considering looking into the pixel color option and having it do a repeat  search for a color, or range of colors with in an area of the screen, then when color found continue macro, have it repeat this search for a certain number of times, then if color not found jump to section of macro. a lot to learn lol. getting the pixel color at a pixel that constantly makes changes with in what appears to be a set variable, the same cycle of number codes seem to repeat, just in random orders and it might throw in a random color number that isn't there often or is swapped with another random number at various times. they change pretty quick as well, and hitting print screen over and over again a few dozen times, you may or may not get one you already got a screen shot of lol.... damn, just had an idea lol. I could use my screen capture to record the numbers as they change, then play the video frame by frame to get the cycle of numbers.... feel like an idiot for not thinking of that earlier lol.

  8. I'm wondering if ME can do "image recognition", I know you can do pixel color searches and things of that nature, but what about actual image capture and search?

    the reason I ask is because right now, I am using 2 macro applications and the other app is strictly being used for the image search function, nothing else. I would like to be able to have ME perform everything without the need for a second app but so far I don't see that happening being I see no options for an actual "image recognition" , "Image search" or "image capture" in ME and "pixel color" is pretty much useless for a lot of instances in my macro because the actual pixel colors have random color variations (very slight variations, but enough to make it not work right) but the image recognition in the other app works great because you can select the area of the screen to capture the image, compare it to the full screen capture, set a tolerance level for color range in the image you are looking for and it works nearly 100% of the time. basically the code for the other app looks like this but haven't figured out a way to get this effect in ME as of yet.


    SetFocus>cellinarac Atruin
    Wait>1.5
    GetScreenRes>sx,sy
    ScreenCapture>0,0,sx,sy,C:\Users\cellinarac\Documents\Test Macro\screen.bmp
    FindImagePos>C:\Users\cellinarac\Documents\Test Macro\Image1.bmp,C:\Users\cellinarac\Documents\Test Macro\screen.bmp,30,1,XPos,YPos,imgs
    If>imgs>0
    MouseMove>XPos_0,YPos_0
    Wait>1.0
    LDown
    Wait>0.2
    LUp
    Wait>1.5
    Endif
    Wait>2.5
    Press CTRL
    Wait>0.2
    SendText>m
    Wait>0.1
    Release CTRL
    Exit

  9. On 7/16/2019 at 9:34 PM, kunkel321 said:

     

     

    Also note:  It looks like you've recorded a bunch of mouse moves and pauses...  Would the macro still work if those were culled-out, or are they needed?  I'm not sure what "cellinarac Atruin" even is, so I don't know if they are needed...  BTW Google thinks you spelled it wrong....   Did you mean: cellinarac Atrium  LOL. 

     

    yes, I removed all the mouse movements and used actual co-ords now and it works smoother. 
    LOL, no I didn't mean "Cellinarac Atruim" lol , Cellinarac Atruin was actually a random generated IGN from a game I played years ago, and since it's not something people use, I use it for most games or accounts.... though, I seemed to have missed the "C" all together when I created my account here....😕

  10. 33 minutes ago, kunkel321 said:

    If you want to visually see LTimer's value decrease, then I think you'll need a loop within a loop, where the inner loop shows your countdown once for ever time the outer loop loops.  

    For example  if VarNum gets set to 14, then that LTimer will appear 14 times.  Each time it appears, it will count down from some value between approx. 54 and 57 seconds. 

    Question: Do want LTimer to be reset with a different number 14 times?  Or do you want it to keep using the same start value for each of the 14 loops of VarNum?   

     

    Edit:  Actually... I'm not positive if MacExpPro can even do a loop within a loop (sub-loop).  Experimenting now....

    what I am trying to get is a timer that displays the seconds left before moving on to the next part of the macro. in this case, the macro presses (F1) and (F2) then waits for a variable of 54 to 57 seconds before pressing those keys again, it repeats this process for 12 to 15 cycles and then moves on to the next steps in the macro. what I am trying to do, and "some what" got working, is to have a little timer box sitting in the corner that shows time left between the second set of key presses.  what I have so far works for the first cycle, but when it goes to the second cycle it starts the countdown at -1 instead of resetting to the variable of %LTimer%. this in turn removes the <DELAY Flags="\x03" Time="%LTimer%"/> because the displayed timer will replace the "delay". the first cycle works all the way down to "0" on the countdown display, then when the macro goes into it's second cycly of %VarNum% the box doesn't actually update or reset and starts off at -1 causing it to just rapidly press the keys. hopefully this all makes sense. here is what I have now.

     

    <VARIABLE SET INTEGER Option="\x05" Destination="%VarNum%" Minimum="12" Maximum="15"/>
    <VARIABLE SET INTEGER Option="\x05" Destination="%LTimer%" Minimum="54" Maximum="58"/>
    <DELAY Flags="\x02" Time="415"/>
    <TEXT BOX DISPLAY Title="Pattern 1" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 Cycles Remaining\r\n\\par \\f1 %VarNum%\\b0\\fs16 \r\n\\par }\r\n" Left="613" Top="35" Width="197" Height="88" Monitor="0" OnTop="TRUE" Keep_Focus="FALSE" Mode="\x02" Delay="0"/>
    <REPEAT UNTIL Variable="%VarNum%" Condition="\x02" Value="1"/>
    <WINDOW ACTIVATE Title="cellinarac Atruin" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
    <DELAY Flags="\x02" Time="645"/>
    <MOUSE MOVE Option="\x01" X="994" Y="152" _PROMPT="0x000A"/>
    <DELAY Flags="\x02" Time="348"/>
    <MOUSE MOVE Option="\x01" X="995" Y="149" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="500"/>
    <MOUSE LEFT CLICK/>
    <DELAY Flags="\x03" Time="327"/>
    <TEXT TYPE Action="0" Text="<F1>"/>
    <DELAY Flags="\x03" Time="500"/>
    <TEXT TYPE Action="0" Text="<F2>"/>
    <REPEAT UNTIL Variable="%LTimer%" Condition="\x02" Value="1"/>
    <TEXT BOX DISPLAY Title="Timer" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20  Cycle Time Remaining\r\n\\par \\f1 %LTimer%\\f0  sec\\b0\\f1\\fs16 \r\n\\par }\r\n" Left="602" Top="107" Width="197" Height="88" Monitor="0" OnTop="TRUE" Keep_Focus="FALSE" Mode="\x02" Delay="0"/>
    <DELAY Flags="\x03" Time="994"/>
    <VARIABLE MODIFY INTEGER Option="\x01" Destination="%LTimer%" Value1="%LTimer%" Value2="1"/>
    <UPDATE TEXTBOX Header="Timer" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20  Cycle Time Remaining\r\n\\par \\f1 %LTimer%\\f0  sec\\b0\\f1\\fs16 \r\n\\par }\r\n"/>
    <TEXT BOX CLOSE Header="Timer"/>
    <END REPEAT/>
    <WINDOW ACTIVATE Title="cellinarac Atruin" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
    <DELAY Flags="\x03" Time="500"/>
    <TEXT TYPE Action="0" Text="<F1>"/>
    <DELAY Flags="\x03" Time="500"/>
    <TEXT TYPE Action="0" Text="<F2>"/>
    <DELAY Flags="\x03" Time="500"/>
    <VARIABLE MODIFY INTEGER Option="\x01" Destination="%VarNum%" Value1="%VarNum%" Value2="1"/>
    <UPDATE TEXTBOX Header="Mining Pattern 1" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 Cycles Remaining\r\n\\par \\f1 %VarNum%\\b0\\fs16 \r\n\\par }\r\n"/>
    <END REPEAT/>
    <TEXT BOX CLOSE Header="Pattern 1"/>
    <DELAY Flags="\x03" Time="349"/>
    <DELAY Flags="\x03" Time="367"/>
    <MACRO RUN Use_ID="FALSE" Name="Pattern 2" ID="-1" Wait="TRUE"/>
    <DELAY Flags="\x03" Time="362"/>
    <MACRO STOP/>

  11. Ok, so what I am trying to do this time, is make a msg box that appears and shows a countdown timer from a variable. this macro already has a repeat function and the location I need this countdown to display in inside the repeat perimeters that is already there, for example.
     <VARIABLE SET INTEGER Option="\x05" Destination="%VarNum%" Minimum="12" Maximum="15"/>
    <VARIABLE SET INTEGER Option="\x05" Destination="%LTimer%" Minimum="54987" Maximum="57143"/>
    <DELAY Flags="\x02" Time="415"/>
    <TEXT BOX DISPLAY Title="Pattern 1" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 Mining Cycles Remaining\r\n\\par \\f1 %VarNum%\\b0\\fs16 \r\n\\par }\r\n" Left="613" Top="35" Width="197" Height="88" Monitor="0" OnTop="TRUE" Keep_Focus="FALSE" Mode="\x02" Delay="0"/>
    <REPEAT UNTIL Variable="%VarNum%" Condition="\x02" Value="1"/>
    <WINDOW ACTIVATE Title="cellinarac Atruin" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
    <DELAY Flags="\x02" Time="645"/>
    <MOUSE MOVE Option="\x01" X="994" Y="152" _PROMPT="0x000A"/>
    <DELAY Flags="\x02" Time="348"/>
    <MOUSE MOVE Option="\x01" X="995" Y="149" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="500"/>
    <MOUSE LEFT CLICK/>
    <DELAY Flags="\x03" Time="327"/>
    <TEXT TYPE Action="0" Text="<F1>"/>
    <DELAY Flags="\x03" Time="500"/>
    <TEXT TYPE Action="0" Text="<F2>"/>
    <DELAY Flags="\x03" Time="%LTimer%"/>
    THIS IS WHERE I WANT THE TIMER TO POP UP AND COUNTDOWN FROM THE %LTIMER% VARIABLE TO SHOW REMAINING TIME
    <WINDOW ACTIVATE Title="cellinarac Atruin" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
    <DELAY Flags="\x03" Time="500"/>
    <TEXT TYPE Action="0" Text="<F1>"/>
    <DELAY Flags="\x03" Time="500"/>
    <TEXT TYPE Action="0" Text="<F2>"/>
    <DELAY Flags="\x03" Time="500"/>
    <VARIABLE MODIFY INTEGER Option="\x01" Destination="%VarNum%" Value1="%VarNum%" Value2="1"/>
    <UPDATE TEXTBOX Header="Pattern 1" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 Mining Cycles Remaining\r\n\\par \\f1 %VarNum%\\b0\\fs16 \r\n\\par }\r\n"/>
    <END REPEAT/>
    <TEXT BOX CLOSE Header="Pattern 1"/>
    <MACRO RUN Use_ID="FALSE" Name="Pattern 2" ID="-1" Wait="TRUE"/>
    <MACRO STOP/>

  12. 24 minutes ago, kunkel321 said:

    Ellinarac, I'm curious if Line 62 is working as expected.  It seems like it is going to actually type MacExp code into something(?)  

    <TEXT TYPE Action="0" Text="<UPDATE TEXTBOX Header=\"Current Value\" Content=\"{\\\\rtf1\\\\ansi\\\\ansicpg1252\\\\deff0\\\\deflang1033{\\\\fonttbl{\\\\f0\\\\fnil\\\\fcharset0 Tahoma;}{\\\\f1\\\\fnil Tahoma;}}\\r\\n\\\\viewkind4\\\\uc1\\\\pard\\\\qc\\\\b\\\\f0\\\\fs20 Mining Cycles Remaining\\r\\n\\\\par \\\\f1 %VarNum%\\\\b0\\\\fs16 \\r\\n\\\\par }\\r\\n\"/>\r\n"/>
     

    So it's actually going to send "<UPDATE TEXTBOX Header=\"Current...." to the keyboard, if I'm understanding correctly.  

    As I paste it into this forum post, I'm noticing extra backslaches \\\\ not sure what's up with that.  

     

    Also note:  It looks like you've recorded a bunch of mouse moves and pauses...  Would the macro still work if those were culled-out, or are they needed?  I'm not sure what "cellinarac Atruin" even is, so I don't know if they are needed...  BTW Google thinks you spelled it wrong....   Did you mean: cellinarac Atrium  LOL. 

     

    it appears that it sends it to the textbox, so I don't know. all I know is it works lol. now I do have "F1" and "F2" keys being sent. but other than that nothing is sent to the KB function that I am aware of

  13. 4 minutes ago, ellinarac said:

    the Multiple boxes appearing is why I used the "floating text box" put it above the repeat command so that it just appears once and doesn't appear every repeat, and then the "update text box" is near the end of the Macro so that it actually says how many are left after this cycle, so if it's on the last cycle it says "0". then have a "close text box" after the "end repeat" command so that it closes the box after it finishes doing it's Repeat variable, it then launches another macro by name and closes this macro. then each macro does the same. I have about 20 Macros that launch each other and based on the running macros function, repeats a certain variable of times, then launches another macro. thats why I was looking for a way to make a display box that would show remaining cycles for a given macro so that I knew when the best time to "break the cycle" was if I needed to do so. Everything seems to be working fine now after doing some slight tweaking. I do have a couple bugs now and then, but I think it's more to do with my mouse movement settings in the macro. Now, if only I could figure out some type of image recognition in ME lol. I actually have a few things that require it, but have another Macro App I am currently using for that which then launches the needed ME macro in the line. would be nice to have everything running from ME though.

    this is one of the Macros I used the "countdown" for..

    <VARIABLE SET INTEGER Option="\x05" Destination="%VarNum%" Minimum="11" Maximum="15"/>
    <VARIABLE SET INTEGER Option="\x05" Destination="%Timer%" Minimum="54987" Maximum="57143"/>
    <MACRO PLAYBACK SPEED Speed="1"/>
    <TEXT BOX DISPLAY Title="Current Value" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 Mining Cycles Remaining\\f1 \r\n\\par %VarNum%\\b0\\fs16 \r\n\\par }\r\n" Left="598" Top="26" Width="197" Height="123" Monitor="0" OnTop="TRUE" Keep_Focus="FALSE" Mode="\x02" Delay="0"/>
    <REPEAT UNTIL Variable="%VarNum%" Condition="\x02" Value="1"/>
    <WINDOW ACTIVATE Title="cellinarac Atruin" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
    <DELAY Flags="\x03" Time="134"/>
    <MOUSE MOVE Option="\x02" X="957" Y="153" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="14"/>
    <MOUSE MOVE Option="\x02" X="959" Y="149" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="19"/>
    <MOUSE MOVE Option="\x02" X="963" Y="147" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="14"/>
    <MOUSE MOVE Option="\x02" X="967" Y="145" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="19"/>
    <MOUSE MOVE Option="\x02" X="971" Y="142" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="14"/>
    <MOUSE MOVE Option="\x02" X="974" Y="140" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="21"/>
    <MOUSE MOVE Option="\x02" X="977" Y="139" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="11"/>
    <MOUSE MOVE Option="\x02" X="978" Y="138" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="33"/>
    <MOUSE MOVE Option="\x02" X="979" Y="138" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="19"/>
    <MOUSE MOVE Option="\x02" X="981" Y="138" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="14"/>
    <MOUSE MOVE Option="\x02" X="983" Y="138" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="19"/>
    <MOUSE MOVE Option="\x02" X="986" Y="136" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="112"/>
    <MOUSE MOVE Option="\x02" X="987" Y="136" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="22"/>
    <MOUSE MOVE Option="\x02" X="988" Y="136" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="44"/>
    <MOUSE MOVE Option="\x02" X="989" Y="136" _PROMPT="0x000A"/>
    <MOUSE MOVE Option="\x02" X="990" Y="136" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="17"/>
    <MOUSE MOVE Option="\x02" X="996" Y="136" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="16"/>
    <MOUSE MOVE Option="\x02" X="1005" Y="139" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="18"/>
    <MOUSE MOVE Option="\x02" X="1009" Y="140" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="14"/>
    <MOUSE MOVE Option="\x02" X="1012" Y="140" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="19"/>
    <MOUSE MOVE Option="\x02" X="1013" Y="140" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="180"/>
    <MOUSE LEFT BUTTON DOWN/>
    <MOUSE LEFT BUTTON UP/>
    <DELAY Flags="\x03" Time="600"/>
    <TEXT TYPE Action="0" Text="<F1>"/>
    <DELAY Flags="\x03" Time="500"/>
    <TEXT TYPE Action="0" Text="<F2>"/>
    <DELAY Flags="\x03" Time="%Timer%"/>
    <WINDOW ACTIVATE Title="cellinarac Atruin" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
    <DELAY Flags="\x03" Time="500"/>
    <TEXT TYPE Action="0" Text="<F1>"/>
    <DELAY Flags="\x03" Time="500"/>
    <TEXT TYPE Action="0" Text="<F2>"/>
    <VARIABLE MODIFY INTEGER Option="\x01" Destination="%VarNum%" Value1="%VarNum%" Value2="1"/>
    <UPDATE TEXTBOX Header="Current Value" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 Mining Cycles Remaining\r\n\\par \\f1 %VarNum%\\b0\\fs16 \r\n\\par }\r\n"/>
    <DELAY Flags="\x03" Time="500"/>
    <MOUSE MOVE Option="\x02" X="1009" Y="146" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="15"/>
    <MOUSE MOVE Option="\x02" X="1009" Y="148" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="16"/>
    <MOUSE MOVE Option="\x02" X="1007" Y="150" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="18"/>
    <MOUSE MOVE Option="\x02" X="1007" Y="151" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="36"/>
    <MOUSE MOVE Option="\x02" X="1006" Y="153" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="11"/>
    <MOUSE MOVE Option="\x02" X="1006" Y="154" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="16"/>
    <MOUSE MOVE Option="\x02" X="1006" Y="155" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="18"/>
    <MOUSE MOVE Option="\x02" X="1006" Y="156" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="16"/>
    <MOUSE MOVE Option="\x02" X="1005" Y="158" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="254"/>
    <MOUSE MOVE Option="\x02" X="1005" Y="159" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="%Delay Short%"/>
    <MOUSE MOVE Option="\x02" X="1005" Y="160" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="29"/>
    <MOUSE MOVE Option="\x02" X="994" Y="166" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="14"/>
    <MOUSE MOVE Option="\x02" X="985" Y="173" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="17"/>
    <MOUSE MOVE Option="\x02" X="980" Y="177" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="14"/>
    <MOUSE MOVE Option="\x02" X="978" Y="179" _PROMPT="0x000A"/>
    <DELAY Flags="\x03" Time="21"/>
    <MOUSE MOVE Option="\x02" X="977" Y="180" _PROMPT="0x000A"/>
    <END REPEAT/>
    <TEXT BOX CLOSE Header="Current Value"/>
    <MACRO RUN Use_ID="FALSE" Name="Send Home" ID="-1" Wait="TRUE"/>
    <DELAY Flags="\x03" Time="795"/>
    <MACRO STOP/>
     

  14. 7 hours ago, acantor said:

    When I have used updating text boxes, Macro Express created a new text box each time. So if the updates occur every second for five minutes, Macro Express opens 300 new windows. All windows close when the script completes, but I prefer not to see dozens (or hundreds or thousands) of extra windows. So I usually incorporate a "Text Box Close " into the loop.

     

    You can see the difference by running this script in two ways: with the "Text Box Close" line disabled, and with it enabled. The new windows appear on the task bar.

     

    
    <VARIABLE SET INTEGER Option="\x00" Destination="%Count%" Value="1"/>
    <REPEAT START Start="1" Step="1" Count="10" Save="FALSE"/>
    <TEXT BOX DISPLAY Title="Progress" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %Count%\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x02" Delay="1"/>
    <DELAY Flags="\x02" Time="1000"/>
    <VARIABLE MODIFY INTEGER Option="\x07" Destination="%Count%"/>
    <TEXT BOX UPDATE Header="Progress" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n"/>
    <TEXT BOX CLOSE Header="Progress" _ENABLED="FALSE"/>
    <END REPEAT/>

     

    the Multiple boxes appearing is why I used the "floating text box" put it above the repeat command so that it just appears once and doesn't appear every repeat, and then the "update text box" is near the end of the Macro so that it actually says how many are left after this cycle, so if it's on the last cycle it says "0". then have a "close text box" after the "end repeat" command so that it closes the box after it finishes doing it's Repeat variable, it then launches another macro by name and closes this macro. then each macro does the same. I have about 20 Macros that launch each other and based on the running macros function, repeats a certain variable of times, then launches another macro. thats why I was looking for a way to make a display box that would show remaining cycles for a given macro so that I knew when the best time to "break the cycle" was if I needed to do so. Everything seems to be working fine now after doing some slight tweaking. I do have a couple bugs now and then, but I think it's more to do with my mouse movement settings in the macro. Now, if only I could figure out some type of image recognition in ME lol. I actually have a few things that require it, but have another Macro App I am currently using for that which then launches the needed ME macro in the line. would be nice to have everything running from ME though.

  15. 34 minutes ago, kunkel321 said:

    Ah yes.  That's what Cory meant when he mentioned the 'Update textbox' command.  Here, this appears to be closer to what you're describing..  

     

    <VARIABLE SET INTEGER Option="\x05" Destination="%VarNum%" Minimum="4" Maximum="12"/>
    <TEXT BOX DISPLAY Title="Current Value" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}{\\f1\\fnil\\fcharset0 Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs28 The variable, \"VarNum\" currently has the value %VarNum%.  \\f1 (BEFORE LOOP)\\f0\\fs16 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x02" Delay="0"/>
    <REPEAT UNTIL Variable="%VarNum%" Condition="\x02" Value="1"/>
    <DELAY Flags="\x01" Time="1"/>
    <TEXT BOX UPDATE Header="Current Value" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}{\\f1\\fnil\\fcharset0 Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs28 The variable, \"VarNum\" currently has the value %VarNum%.  \\f1 (DURING LOOP)\\f0\\fs20 \r\n\\par }\r\n"/>
    <VARIABLE MODIFY INTEGER Option="\x01" Destination="%VarNum%" Value1="%VarNum%" Value2="1"/>
    <END REPEAT/>
     

    I made the text bigger so I could see it.  Also, I got rid of one of the delays and put (BEFORE) and (DURING) in the dialogs, so you can actually see when the loop kicks-in.  

     

    Tip:  Remember that MacExpPro has an excellent context-smart help system.  For example when you are editing a command such as 'update textbox' you can press "F1" and it will go right to that section of the help file.  

     

    cool, thanks.
    yea the "delay" was just a "place holder" so I could actually see it count. it was zipping through the counter without them lol. I have it integrated into one macro so far. had to do a little tweaking, but it is functioning the way I wanted it to now. 

  16. kunkel321, thanks for the help, it took a little "reworking" but I finally got the effect I was looking for doing a test script. now to integrate it into my macro.

    yours gave me the basics and worked great! the only issue was, I needed something that remained on the screen and updated a single box instead of having the box close, re-open, close, re-open lol. so here is what I finally got working. if you can think of a better way of doing this or a way to clean up the code any, please let me know.

    <VARIABLE SET INTEGER Option="\x05" Destination="%VarNum%" Minimum="4" Maximum="12"/>
    <TEXT BOX DISPLAY Title="Current Value" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 The variable, \"VarNum\" currently has the value %VarNum%.  \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x02" Delay="0"/>
    <REPEAT UNTIL Variable="%VarNum%" Condition="\x02" Value="1"/>
    <UPDATE TEXTBOX Header="Current Value" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 The variable, \"VarNum\" currently has the value %VarNum%.  \r\n\\par }\r\n"/>
    <DELAY Flags="\x01" Time="1"/>
    <VARIABLE MODIFY INTEGER Option="\x01" Destination="%VarNum%" Value1="%VarNum%" Value2="1"/>
    <DELAY Flags="\x01" Time="2"/>
    <END REPEAT/>
    <TEXT BOX CLOSE Header="Current Value"/>

     

  17. 6 hours ago, Cory said:

    Sorry, short response. Not much time. You need to update the text box each time. Did you do that. 

    Yes the text box update is right under the repeat command so that it updates each time the repeat starts, the show box command is above the repeat since it was creating a new box each time. that didn't seem to work. about to try the method kunkel321 posted and see if that works.

  18. 1 hour ago, kunkel321 said:

    It looks like you have the Repeat command right inside the textbox.  I suspect your setup will need to be more like:

     

    Set Number Variable (NumVar) to random number.

    Repeat until NumVar is less than 1.

    -Textbox: Loops remaining is %NumVar%

    -Modify variable NumVar by "-1"

    End repeat

     

    Or something like that.  (I haven't actually tried this.)

    Still no luck...

     

  19. ok, so I just started using Macro Express again after nearly 8 years of not doing anything. I am working on a multi-part macro that has sections that repeat a random number of times. what I am trying to do is get a msg box that pops up and shows the remaining "cycles". so for example the macro will call "Repeat Start (Repeat %Repeat% times)" where %Repeat% is a random number between 10 and 15. what I want the box to do is display the number of "cycles" left. I get it to display the initial cycle from %Repeat% but no count down. I added an "Update Textbox" with the same header name as my "Floating box until end of macro". both of these have the %Repeat% variable set under "box contents" since I figured it would update from the repeat variable when it counts down. Any Idea what I am doing wrong here? I have tried to google this but not having much luck.

    Thanks in advance!

    Help!.bmp

  20. 2 hours ago, Samrae said:

    Something like this might work:

    
    Variable Set Integer %MacroNumber% to a random value between 1 and 8
    Switch( %MacroNumber% )
    Case: 1
      Macro Run: Macro 1
    End Case
    Case: 2
      Macro Run: Macro 2
    End Case
    Case: 3
      Macro Run: Macro 3
    End Case
    Case: 4
      Macro Run: Macro 4
    End Case
    Case: 5
      Macro Run: Macro 5
    End Case
    Case: 6
      Macro Run: Macro 6
    End Case
    Case: 7
      Macro Run: Macro 7
    End Case
    Case: 8
      Macro Run: Macro 8
    End Case
    End Switch

     

    so, going by this, I am assuming the %macronumber% refers to the macro index number in the macro list?

    macro list.bmp

×
×
  • Create New...