REQUEST: Crash detection at line 574 in functions.lua

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: REQUEST: Crash detection at line 574 in functions.lua

#21 Post by rock5 » Wed May 11, 2011 11:12 pm

Administrator wrote:Well, that is annoying. "Crash Report" is a bit too general for me. Can you double check the class name?

Code: Select all

local win = findWindow("Crash Report");
local class = getWindowClassname(win);
printf("Class: %s\n", class);
I got The same number.

Code: Select all

Class: #32770
Even if there was a way to make sure that it is a Runes of Magic crash, you still need to know which game client crashed if you have more than one running, wouldn't you? Isn't there any way to see what process opened the crash window? That's what you need to know which game crashed.
  • 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: REQUEST: Crash detection at line 574 in functions.lua

#22 Post by rock5 » Wed May 11, 2011 11:32 pm

I had a bit of a look at the process functions and it looks like it would work.

During the "selectGame()" function it gets the 'process' but eventually discards it. Couldn't it save it then when checking if the game has crashed do something like;

Code: Select all

if findProcess("Crash Report") == process then
   -- The game has crashed. Force close it.
end
  • 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: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: REQUEST: Crash detection at line 574 in functions.lua

#23 Post by Administrator » Thu May 12, 2011 12:17 am

Well, you could always check to make sure that the window is still valid. If not, then assume it was the one that crashed.

Code: Select all

if( findWindow("Crash Report", "#32770") and not windowValid(getWin()) ) then
 -- This must be the client that crashed.
end

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

Re: REQUEST: Crash detection at line 574 in functions.lua

#24 Post by rock5 » Thu May 12, 2011 1:12 am

How do you check to see if a window is still valid? When the crash report window appears the client window is still there.
  • 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: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: REQUEST: Crash detection at line 574 in functions.lua

#25 Post by Administrator » Thu May 12, 2011 1:49 am

Oh, hmm, that would prevent windowValid() from working, then. Does spy++ or Winspector have a function to check for parents? If so, that could be used.

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

Re: REQUEST: Crash detection at line 574 in functions.lua

#26 Post by rock5 » Thu May 12, 2011 3:33 am

I don't know, do they?
  • 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: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: REQUEST: Crash detection at line 574 in functions.lua

#27 Post by Administrator » Thu May 12, 2011 5:27 am

Doesn't look like Winspector does. I do not have spy++.

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

Re: REQUEST: Crash detection at line 574 in functions.lua

#28 Post by rock5 » Thu May 12, 2011 6:29 am

There is something about Parent on this tab. Is this what you want?
Attachments
Parent.jpg
  • 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: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: REQUEST: Crash detection at line 574 in functions.lua

#29 Post by Administrator » Thu May 12, 2011 8:11 am

That's it! Seems like the parent window handle is, in fact, the client's window that has crashed. I'll just have to add a function to MicroMacro to make use of this.

Go ahead and give the attached executable a try. The function is getWindowParent(). It returns nil if it does not have a parent or some error occured.

Code: Select all

local crashReport = findWindow("Crash Report", "#32770"); -- Something crashed
local crashedClientWin = getWindowParent(crashReport);
if( crashedClientWin == getWin() ) then
  -- The client we are controlling crashed; do something
end
Attachments
micromacro1.01.experimental.zip
(254.05 KiB) Downloaded 61 times

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest