Jump to content
Macro Express Forums

Wingman

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by Wingman

  1. Was toying around with Cory's idea of a main macro and time delay triggers, would have to read more about the repeat statements and macro disable/enable.

     image.png.22a305358d9b636aae9bcee2ce2b4590.png

     

     

    1 hour ago, rberq said:

    The "Variable Set Integer" command allows to you load month/day/year/hour/minute/second into variables.  One technique I have used is to convert the present date and time into an approximate number of seconds elapsed since the year zero and time zero.  That's simply a matter of multiplying minutes by 60, hours by 3600, days by 86400, and so on, and adding all the products together.  Of course this does not accurately account for leap years and the meddling of Pope Gregory, but for the 30 minutes you care about it's close enough.  You could do it at the beginning of your macro, and again during each repeat of the processing loop, thereby keeping all the logic within your single macro.  Simply subtract the initial stored value from the recomputed value, and you know how many seconds have elapsed.

     Thanks rberq, I'll try that method tomorrow, if I can keep all login in one macro that would be swell. Can you please share a screenshot of how your "Variable Set Integer" command would look like?

     

     

  2. Asking because I don't know how to start on this timer I wish to add to my macro. 

    In essence, the flow would be the steps below, with no other input from me hopefully.

    - start the macro, timer1 and timer2 should start also

    - loop steps I've declared already (attached in picture earlier),

    - when timer1 reaches 30min tick > goto loopX then restart hunting and reset timer1

    - when timer2 reaches tick > goto loopY (exit game and end macro)

    I was thinking perhaps declaring a time variable @ the beginning of the macro and checking in each if statements whether time variable reached the tick, don't know how to do this though.

  3. 15 minutes ago, Cory said:

    Whenever I have something with very long delays and several (Meaning distinct and different) tasks, I make multiple macros that work in concert. So instead of having a macro that sits around 30 minutes and then does something, I would instead schedule it to run every 30 minutes. See the "Schedule" activation options. Also I will often have one master macro respond to and control the others. Sometimes passing information in the registry or using the controls of actual macro dialog boxes. Sometimes really handy to pass a result back from a control of a MessageBox, and one can use the "Wait for control" command. 

     

    I'll try your suggestion later, bit busy @work now, I'll create a master macro that controls the other tasks (the hunt/heal, repair and exit game macros).

    How should I tackle the token idea? 

    Is there no time variable to work with?

  4. 1 hour ago, acantor said:

    To debug your script, consider moving the mouse cursor to the pixel you're checking. This will help you confirm the pointer is exactly over the correct pixel:

     

    Mouse Move: 1577, 961 Relative to Screen

    Get Pixel Color from Beneath the Mouse into %Healthlevel%

    If Variable %Healthlevel% Does not Equal "756951"

    etc.

    Thanks for the debug idea workaround, sparked a lightbulb in there :)

    Managed to fix it by adding the selected line (Get pixel color and rewrite variable) and works ingame also.

    Only have to figure out the timing now, to pause these steps @ 30min interval and run other set of commands (I'll configure below these lines) and finally, @ 2h10min marker run other steps I'll configure and stop macro.

     

    image.png.8629fc8c2b2a7bb46a143bbbb18d15b2.png

  5. 9 hours ago, Cory said:

    I'll look at this later when I have time. In the mean time you might check to see if yoru Get Pixel is relative to a window, absolute or what. 

    Selected absolute, I've typed in the coords.

     

    9 hours ago, Cory said:

    To terminate the macro I would make another macro that places a token in the registry or in a file when you run it. Then in your loop in the main macro, check to see if that token exists and abort if so. 

    Could this be done in the same macro? At the very beginning place token in registry, then, inside if statements check time since that token was created, would this work?

     

    6 hours ago, rberq said:

    Another way to stop a macro:
    Options | Preferences | Playback | Miscellaneous tab allows you to set one of several hotkey combinations that stop running macros.  

    Thanks for the idea, stop all macros does exactly what I'm looking for.

     

    I've got no xp with variables, specially with this macro recorder, what color code would be stored inside the variable? Am I checking for the wrong one?

    image.png.3855cf7881c48f39dabad4937339d019.png

  6. Hey Cory, 

     

    Thanks for your answer, sorry for placing all my issues in same post, I am new to macro building and got close to 0 skill in coding/variables.

    I've attached the mex file, please take a look. Simply put, I'm trying to automate hunting/healing and repairing inside a game. 

    Start, select game window, check health, heal if wounded, start hunting otherwise, check health again and keep hunting if health is there (doing this with pixel color about 45% in the life bar, trying to place that pixel color inside variable and compare it to what color code should be when healthy, not sure I'm using the right colorcode number though).

    Debugging the macro with notepad in the foreground it starts with 1 and keeps hitting 4 forever, even if I cycle notepad in fullscreen or 50% of screen to let the life bar be visible (simulating lifebar color change).

    Game runs in fullscreen so I'm not able to click the running man :), I need a key combination to stop the macro.

    Repairing should occur every 30min and loop a different set of keystrokes (I've not configured yet) and finally, after 2h of runtme, to execute some steps to exit game and stop script (I've not configured yet).

    Is all this doable with Macro Express Pro?

     

    auto-hunt-heal-repair.mex

  7. Hey guys,

     

    I'm using macro express pro demo and trying to build a macro that automates some clicks and keystrokes depending on pixel color, however, testing the script with notepad in the foreground it doesn't work as expected. 

    Logic is check pixel color and place the value inside a variable, then use if statement to check the variable value vs the color. What am I doing wrong please?

    Also, once I start the script with hotkey or from menu, is there a way to stop it using a hotkey aswell?

    Once I get this the right way, I also need to implement some timer variable that every 30 min to jump to a loop steps collection and then resume the main sequence, and finally after 2h of running to jump to another loop that actually exits the program and stops the macro.

    Please please help me. 

    Dan

×
×
  • Create New...