glitch when running script

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
MackAus
Newbie
Posts: 7
Joined: Fri Jan 20, 2017 9:08 am

glitch when running script

Post by MackAus » Fri Jan 20, 2017 9:31 am

When i run script it appears to glitch even though the trace option goes over the line but fails to execute action this happens occasionally not always. This is making the marco i have written very unstable to run.
Also when i leave microsheduler on my pc running and come back in few hours it appears to do random things like clicking on random areas of the screen in return executing unwanted functions .
Even though im not running the script it appears the macro is randomly running.
Im not a expert at this so maybe im missing some option or something within your application that would stop this random action.

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: glitch when running script

Post by Marcus Tettmar » Fri Jan 20, 2017 10:50 am

Hi,

I've never heard of anything like this. Macros don't just run without being scheduled or started normally. And it can only ever play back the steps that you have written/recorded. Are you able to share your macro here? Have you enabled logging to see what steps were executed?

Trace/debug will always execute each step it runs over. There's no way to prevent it from doing so. However, in some contexts it may *appear* like it's not doing anything. E.g. if you have this line:

Send>hello

And you don't have anything to ensure focus is switched then when you debug it the debugger itself has focus and therefore Send will try to type hello to IT but since it is in read only mode nothing will appear to happen. This is just a conundrum of debugging things which require focus. What I do is put a SetFocus line before a block of text sending and a breakpoint after and run to break point from the SetFocus line.

This may help:
http://help.mjtnet.com/article/7-using-the-debugger
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

MackAus
Newbie
Posts: 7
Joined: Fri Jan 20, 2017 9:08 am

Re: glitch when running script

Post by MackAus » Fri Jan 20, 2017 1:08 pm

Thanks for the reply. Like i said Im new to this and learning new things everyday.
Its been over 20 years since i did programming of any kind. I will try the logger etc and see if i can figure out whats going on.

I suspected the macrosheduler is running because i have stopped the script and when i leave the PC for a while next to me I noticed that a small "running" window appears on the windows taskbar where the macrosheduler logo appears which says "running ".
i know its not running nor have I scheduled any time for the script to run at this stage.

Iam actually writing this for a Game app and the odd clicks that seem to appearing from the script does things not intended and the program becomes unstable. Im not certain why this is . At this stage Im making assumption based on 2 reasons
Reason1
I have tried keeping game app open without microshedular running complete shutdown and for 12 or more hours running game app there does not seem to be any activity in the game app.
Reason2
I have tried running game app with microshedular open in the background but not running or executing the script i wrote and notice the screens of the game app change due to clicks.

Microshedular is the best application I have found thus far that seems to have all the tools i will require to write the script i need. I am using trial mode at this stage to see its capabilities.

Im unable to send or share the script at this stage as its a personal project that I'm keeping confidential and do not wish to share it at this stage.

Thanks for the reply I shall try the suggestions you have made and will go through the links provided.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Re: glitch when running script

Post by CyberCitizen » Mon Jan 23, 2017 2:13 am

Without seeing the script it makes it very hard to debug etc.. , are you using FindImagePos or just mouse moves and click, etc. A bit of background as to what your trying to do helps. Even a screenshot when its doing strange things. Turn on logging to check whats actually happening that includes date and time stamps etc. Is it the macro scheduler gear head icon in the system tray flashing (indicating its running), whats running in task manager?

Been using MS for many years and most of the time it's user / script error. Couples of times its been the app with a quick update etc. But more likely it's user error.
FIREFIGHTER

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: glitch when running script

Post by Dorian (MJT support) » Mon Jan 23, 2017 6:50 pm

If you still need help with this and don't wish to make your script public, you're more than welcome to contact us in the support department. We frequently handle confidential data/scripts/logins. We'd probably need to actually see the script though. :)
Yes, we have a Custom Scripting Service. Message me or go here

MackAus
Newbie
Posts: 7
Joined: Fri Jan 20, 2017 9:08 am

Re: glitch when running script

Post by MackAus » Sun Jan 29, 2017 9:14 am

Hello,
I managed to find the macro script running and the cause of it. As always end user issue lol.
I have just done mouse moves and clicks so far and managed to get most things working.
There is one section that I have been struggling with from day one and that is using keyboard entries.
Especially the press LCTRL and press left or right or Enter key entry.
also i need better control of this iam not certain if the press timing is key to better control.

when i trace the macro at 1 sec interval 4 out of 10 times it works.
When i run the trace at 0 sec intervals 10 out of 10 times it fails

What iam trying to do is use mouse Ldown and move mouse to new location within bluestack window application .
The mouse moves but the desired screen movement does not seem to work basically the Ldown move and Lup does not seem to work

i have tried locating image and then mouse move between mouse moves but the item im trying to move does not work

I have tried using a variation of the pixel offset the Xcordinates and that did not work also
Unfortunately this part is critical for me to browse menus etc to make things work.

When i do the same with mouse or using keyboard entry it appears to work fine.
just the macro seems to miss steps
EXAMPLE My Macro "Press up" 6 times and sometimes only 2 "Press up" work and sometimes 3.
when i run trace with 0 interval between steps the press does not work even when i see the trace on it.

Same with the clicks during the macro but I managed to get the image recognition to loop till desired result and this seems to at least get the result needed.

But the same of missing steps seems to happen there also.

If you can help me get the keyboard entry more stable i would be greatly appreciative.
Thanks in advance.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Re: glitch when running script

Post by CyberCitizen » Sun Jan 29, 2017 11:59 am

Being as your using BlueStacks, I guess your emulating something like an Android OS.

Are you using Press Down * 3 etc, maybe try press down wait 1 press down etc. Put timings in your script or use STEP_DELAY.
FIREFIGHTER

MackAus
Newbie
Posts: 7
Joined: Fri Jan 20, 2017 9:08 am

Re: glitch when running script

Post by MackAus » Wed Feb 01, 2017 11:51 am

I found out where the problem was
when using mouse interface with touch pad emulator
the movements do not send the info correctly
I managed to get the macro to move in a way to compensate for the touch pad.

example when moving from point 1 to point 50 the mouse can move quickly from one to another
but when moving on a touch pad from point 1 ( then the speed of the movement ) to 50
the speed of the movement is the critical part that was the issue.

Im having another issue now when running the macrosheduler

wait>5
let>WW_TIMEOUT=5
WaitWindowOpen>BlueStacks App Player
wait>20
MoveWindow>BlueStacks App Player,1,1
ResizeWindow>BlueStacks App Player,523,718

the macro stalls at the movewindows point when i run or do trace with 0 intervals
when i run trace with 1 second interval it seems to go forward every once in a while
i have tried switching the resize and move window both operation appear to work but macro stalls at the exact same line or point on either operations . something happens at this exact line.
i wave tried with wait 1 second delay between each line still same issue.
i have tried restarting pc and application just in case

Any ideas on what may be the cause of this on this line only
it was working ok yesterday and i haven't changed anything
its weird
thanks in advance for your help

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts