Jump to content
Macro Express Forums

Quick question


nastorrian
 Share

Recommended Posts

Hey guys im new to this. Got it set up pretty well but i cant figure out how to make my macro work then shut off.

 

Here is what i have. I have a macro that repeats none stop. I need it to turn off at like 3:55am and turn back on at 5:30am and run allday till 3:55am again. I trued the shedual part and changing up the times and man i dont know why but its not working. I mean it just runs none stop just wont shut off then back on when i want it to. SHould be easy enough for you guys. Thanks

 

Nast

Link to comment
Share on other sites

Scheduling a macro is related to starting, not stopping. Using the Scheduler "Other" setting will not turn anything off. You can start the macro on a Daily schedule for 5.30am. If the macro does not stop itself by reaching its end, then you have to provide commands to do it. I can see two methods:

 

In a Repeat loop, compare the current time with the time you want to stop (3.55am). When the times are equal stop the macro. "Date and Time" is more flexible but Variable Set Integer to Hour/Minute should be fine too because it's already Integer. ME uses 24 hour clock for this function so the hour being 3 must be morning. Remember, it's going to be turned off the next day but that is not a problem. Compare using (If hour=3 and minutes equal or greater than 55) in case there is a chance the macro may be busy at 3.55. Adding a Repeat may be difficult. If there is an existing loop that has to be used, you may not be able to look at the time every minute or less.

 

The second method is if the macro starts things running and can then can wait a time delay (Delay or Timed Delay or Wait Time Elapse) until 5.30am. The Delay uses more CPU. The Timed Delay and Wait Time Elapse uses very little CPU but cannot be stopped until the end of the time without a reboot.

 

I've not used this type of schedule other than the second method for a max of 3 hours. Both the above methods prevent any other macros running during the period.

Link to comment
Share on other sites

The code would look something like this. If the loop does not exist or has no time delay, then the time delay should be a minute or less. Too short a delay and you use more CPU; too long and you won't catch the minute.

 

(Repeat Start)

 

Variable Set Integer %N75% from Current Hour

Variable Set Integer %N76% from Current Minute

If Variable %N75% = 3

AND

If Variable %N76% >= 55

Macro Stop

End If

 

(time delay

Repeat End)

 

How well this works depends on what you have in your macro and how it fits with a Repeat loop.

Link to comment
Share on other sites

You have over 3200 lines of mouse actions, only a few of which result in a mouse click. I assume you recorded this macro. You could probably get rid of 3000 lines of code. I don't know the application but you only need the mouse move immediately before the click. You may want to leave in a time delay between the mouse move and mouse click. I suggest you do all the editing on a copy of the macro in case you mess something up. What I posted was just text, you have to program yourself. You can't just paste it in as text. I've coded the instructions:

 

Variable Set Integer %N75% from Current Hour
Variable Set Integer %N76% from Current Minute
If Variable %N75% = 3
 AND
If Variable %N76% >= 55
 Macro Stop
End If
Delay 15 Seconds

<IVAR2:75:20:><IVAR2:76:21:><IFVAR2:2:75:1:3><AND><IFVAR2:2:76:5:55><MSTOP><ENDIF><DELAY:15>

Completely remove the Text Type that you added and paste the single line of code using the Direct Editor, immediately above the End Repeat. I've set the timer to go round the loop every 15 secs. If you want it to be something else, change it. You could try reading some of the Help information. You are playing with fire if you do not understand what you are doing. ME can do nasty things in the wrong hands.

Link to comment
Share on other sites

I just ran it myself and it works fine. Did you change your Schedule to Daily? If you left it on Other it's probably restarting itself. You can test quickly by changing the times eg if it's 10am, set the Daily start to 10.05am and N75 and 76 to say 10 and 8 so it will stop at 10.08am (remember to save changes). You can disable all the mouse stuff if you don't want the macro to actually do anything. Watch the running man icon to see it start and stop. I added a sound file (ding) so I could hear the macro running every 15 secs.

Link to comment
Share on other sites

dude i dont know what the problem is. I have it set like you said i think. I changed it to

<IVAR2:75:20:><IVAR2:76:21:><IFVAR2:2:75:1:3><AND><IFVAR2:2:76:11:21><MSTOP><ENDIF><DELAY:15><ENDREP>

to test it and nothing.

 

It doesnt help i dont know how to change it. And i have no idea what that little thing is next to 75:1:3 <-- dont know about you but i see a like spinning slot machine wheel thing. So yeah. i see the 75:1:3 but dont know what is after that.

Might be the issue. Anyway if u can give me a revised one from the original one so i can see the difference on how to test it properly that would help

 

Can we just make it if the program the macro is for isnt running then stop the macro till the time it says to start?

 

Should the play indef box be checked?

Link to comment
Share on other sites

(Edit) In the rush to test I forgot I was working with MEPro. I've revised all the code and mex file to ME3 in case someone checks it out in the future.

 

You can't run just that snippet of code. You have to have the Repeat Start.

 

There are two ways you can test. If you have put that single line into your existing program as I told you, all you have to do is disable all the mouse commands (select commands and press the Enable/Disable button) and set the DAILY Schedule, N75 and N76 as I showed in my last post. Regurgitating last post, If it's 2pm, set the Daily start to 2.05pm and N75 and 76 to say 14 (2pm) and 8 so it will stop at 2.08pm (remember to save changes).

 

Your code should look like this:

 

Repeat Start (Repeat 99999 times)

Macro Playback Speed: 1.00 times faster than normal

<<<<<about a billion mouse commands here>>>>>>

Variable Set Integer %N75%: Set to the Current Hour

Variable Set Integer %N76%: Set to the Current Minute

If Variable %N75% Equals "3"

And

If Variable %N76% Is Greater Than or Equal To "55"

Macro Stop

End If

Delay: 15 seconds

End Repeat

 

Try your code first. I'm trying not to confuse the issue. If you are unable to do that try the attached file that I used for testing. Download the mex file. Then File/Import Macro. Regurgitating last post, If it's 2pm, set the Daily start to 2.05pm and N75 and 76 to say 14 (2pm) and 8 so it will stop at 2.08pm (remember to save changes).

 

Repeat Start (Repeat 100 times)
 Sound Wave File: ding.wav
 // Your game commands go in here
 Variable Set Integer %N75% from Current Hour
 Variable Set Integer %N76% from Current Hour
 If Variable %N75% = 8
AND
 If Variable %N76% >= 25
Macro Stop
 End If
 Delay 15 Seconds
Repeat End

 

 

 

For your proper macro, you would set the DAILY schedule to 5.30am, N75 to 3 and N76 to 55.

Edited by JohnS
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...