MM Window Closes Automatically

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
User avatar
grande
Posts: 261
Joined: Tue Jun 28, 2011 4:46 pm

MM Window Closes Automatically

#1 Post by grande » Mon Jul 08, 2013 6:02 pm

First, want to say I did a forum search for "closes" and then searched text for "mm". I'm hunting for an answer to why the MM window would close by itself. I understand I get various errors which may result in the client crashing but shouldn't the MM window remain open? It would be so much easier to pick up where things left off if the mm window remained open. Usually it does remain open but more often lately the MM window closes by itself. Thanks for any thoughts on the topic.

I'm using MM for rombot... the rom script.

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: MM Window Closes Automatically

#2 Post by Administrator » Mon Jul 08, 2013 10:49 pm

It shouldn't be closing by itself, no. It could be crashing, but I doubt it. Chances are, it is part of the auto logout script or something along those lines that causes it to exit. I think rock5 or lisa would probably know more about this than myself.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: MM Window Closes Automatically

#3 Post by lisa » Tue Jul 09, 2013 12:25 am

I couldn't find anything in default bot that would close a MM window, there is for closing the game window but not MM window.

I think Rock did work on that sort of thing in his login userfunction, I guess it is possible something in there is doing it but yeah I couldn't find anything in default bot to close MM so I would say there is something in a userfunction causing it.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM Window Closes Automatically

#4 Post by rock5 » Tue Jul 09, 2013 12:27 am

It is set up so that when the client crashes and the bot detects it, it terminates the client then shuts down micromacro. I don't know why it does this. It's been this way since Nov 2011 when Administrator added it. I agree with you, micromacro should remain open. I seem to remember bringing it up once but I also couldn't find the post. If it's up to me I would change it so it doesn't close micromacro.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: MM Window Closes Automatically

#5 Post by lisa » Tue Jul 09, 2013 12:36 am

Hmm never had that happen with a crash, u can insta crash game easy.

Just make a macro using

Code: Select all

/script GetCraftItem(5,6,177)
Just tested it then and it is still trying to kill the same mob constantly even though the game crashed and has the crash report window.

It eventually got to 11 unstick tries and closed game successfully.

Code: Select all

Clearing target.
Unstick tries 11 greater then maximum allowed unstick tries 10.
07/09/13 15:37:55  Auto-logging out.
SUCCESS: The process with PID 4388 has been terminated.
Runes of Magic process successfully closed.
Did not find any crashed game clients.
3:37pm - Exiting: Auto-logout
Dumping profile data
Could just be timing of the crash I guess.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM Window Closes Automatically

#6 Post by rock5 » Tue Jul 09, 2013 12:43 am

That output didn't detect a crash. When it does you would get a messages like this.

Code: Select all

Found a crashed game client and killed it. (PID %d)
This instance of MicroMacro will automatically terminate in 30 seconds.
Press ENTER to end the script and prevent termination.
Instead of

Code: Select all

Did not find any crashed game clients
It's in the errorCallback function. Line 338 in functions.lua.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM Window Closes Automatically

#7 Post by rock5 » Tue Jul 09, 2013 1:31 am

I see what the problem is. For that code to be triggered the client needs to crash and the bot needs to error. Unfortunately the bot doesn't always error. Maybe there should be a check for client crash during the regular bot loop. Or maybe just a crash check added to the unstick functions.

BTW you can simulate the error by doing what you did Lisa (start a waypoint such as rbassist and enter "/script GetCraftItem(5,6,177)") then pressing ctrl-l to terminate the script. Then the client will close and you will get those error messages and MM will also close after 30s.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: MM Window Closes Automatically

#8 Post by Administrator » Tue Jul 09, 2013 2:01 am

I wouldn't be opposed to disabling it (I think it is just a call to os.exit()?). If I remember correctly, that was a feature you guys had requested.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM Window Closes Automatically

#9 Post by rock5 » Tue Jul 09, 2013 2:57 am

How about the idea of checking for crashed clients during unsticks. I don't think unsticks will always close the client, maybe only if CLOSE_WHEN_STUCK is true, but I think it should always terminate the client if a crash is detected. I was thinking maybe make a function that checks if the client crashed and closes it, then call that in errorCallback and when unsticking. I don't like that it doesn't check if the attached client is the crashed one so I'd probably add a getWindowParent in there too.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: MM Window Closes Automatically

#10 Post by Administrator » Tue Jul 09, 2013 3:48 pm

Sounds fine to me. I think the issue with detecting crashed clients was that sometimes the window would freeze for about 30 seconds before it actually crashed. MicroMacro would notice the unresponsiveness and check for the crash before it actually happened. Not sure what to do about that. I guess you can continue to keep checking for some time before eventually giving up (if no crash is detected).

User avatar
grande
Posts: 261
Joined: Tue Jun 28, 2011 4:46 pm

Re: MM Window Closes Automatically

#11 Post by grande » Tue Jul 09, 2013 9:20 pm

Hey there.. just wanted to pop in here and say thanks for discussing this. I think I'm at about 70% understanding level LOL. So I'll continue to watch and maybe learn a little. Looking forward to seeing how this develops.

Take care!

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM Window Closes Automatically

#12 Post by rock5 » Wed Jul 10, 2013 12:10 am

Administrator wrote: I think the issue with detecting crashed clients was that sometimes the window would freeze for about 30 seconds before it actually crashed. MicroMacro would notice the unresponsiveness and check for the crash before it actually happened. Not sure what to do about that.
Ah so you are saying that the bot might error before the crash report appears? I'm not sure what we could do about that unless we could find another crashing indicator. I don't think we can just wait an arbitrary amount of time because a character could end up dying. How about the ping rate? I've noticed sometimes that when the client is about to crash the ping rate goes through the roof. Of course the client might be crashing because it has lost communication with the server, hence the high ping. If it is crashing for some other reason the ping may not go up. But then again maybe those times that take 30s to crash are always about communication.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: MM Window Closes Automatically

#13 Post by rock5 » Tue Jul 16, 2013 11:53 am

I've been working on this. I created the function which I called 'isClientCrashed'. Used it in the error callback. I tried it in the unstick but I noticed that when I crashed the client it was easy to end up trying to repeat a task that never stops. So I put the crash check at the top of the main bot loop and it seem to work fine. Seems like whatever it's doing as soon as you crash the client it closes. I'm just wondering though, whether doing a findWindowsList every bot loop would be ok. It seems to take between 2-3ms on my system.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: MM Window Closes Automatically

#14 Post by Administrator » Tue Jul 16, 2013 3:16 pm

It should be acceptable, but you might be able to get it to only check once every 10th loop or something if it becomes a problem.

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests