Character dies when client crashes.

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

Character dies when client crashes.

#1 Post by rock5 »

I've been noticing that when I return to my PC and find the client has crashed, that the character has invariably died also. But if I'm there when the client crashes and finish closing the client, later when I log back in the character is still alive.

I deduce from this that when the client crashes, the server thinks you are still connected and mobs attack you until you are dead. It would be good that when the bot can't communicate with the client anymore there was an option to force shutdown the client.

I see the unsticking function calls the 'logout' function which can close the client and there is a TASKKILL command there but it only executes if there is no macro hotkey defined.

Is it possible to have an option to force shutdown the client when logout is called?
  • 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
Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: Character dies when client crashes.

#2 Post by Alkaiser »

I strongly second this notion. I've died countless times in this way... spent a mint of tokens undoing the damage.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Character dies when client crashes.

#3 Post by rock5 »

I could probably do this myself but I'm not 100% sure how it should work.

Let's see...
1. player:logout() should work as before taking you to the character selection screen.
2. I guess we still want the profile option "LOGOUT_WHEN_STUCK".
3. We need an option to say how it should log out when stuck. Something like,
LOGOUT_WHEN_STUCK_TYPE = "normal" -- just returns to the character selection (default value)
LOGOUT_WHEN_STUCK_TYPE = "close" -- attempts to just close the client normally
LOGOUT_WHEN_STUCK_TYPE = "force" -- forces the client to close with TASKKILL.

And I'd probably leave the 'LOGOUT_SHUTDOWN' option as it is.

How does that sound?
  • 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
Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: Character dies when client crashes.

#4 Post by Alkaiser »

A somewhat related problem that I have experienced is the blasted chat box. I often minimize ROM while botting and do other things on my computer. Sometimes the chat box pops up unseen where it gets filled with zeros, obviously the bot trying to use the macro - effectively disabling the bot. Is there a way for the bot to check to see if the chat box is open and to close it if it gets opened while the bot is running?
Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: Character dies when client crashes.

#5 Post by Alkaiser »

rock5 wrote:I could probably do this myself but I'm not 100% sure how it should work.

Let's see...
1. player:logout() should work as before taking you to the character selection screen.
2. I guess we still want the profile option "LOGOUT_WHEN_STUCK".
3. We need an option to say how it should log out when stuck. Something like,
LOGOUT_WHEN_STUCK_TYPE = "normal" -- just returns to the character selection (default value)
LOGOUT_WHEN_STUCK_TYPE = "close" -- attempts to just close the client normally
LOGOUT_WHEN_STUCK_TYPE = "force" -- forces the client to close with TASKKILL.

And I'd probably leave the 'LOGOUT_SHUTDOWN' option as it is.

How does that sound?
That sounds good. In case of a crash ... probably want to "force" it. Though, I wonder how long the server waits before pulling your character out when it happens.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Character dies when client crashes.

#6 Post by rock5 »

Alkaiser wrote:A somewhat related problem that I have experienced is the blasted chat box. I often minimize ROM while botting and do other things on my computer. Sometimes the chat box pops up unseen where it gets filled with zeros, obviously the bot trying to use the macro - effectively disabling the bot. Is there a way for the bot to check to see if the chat box is open and to close it if it gets opened while the bot is running?
Not really relevant to loggin out. If we could detect that, we would just close the chat and continue.

Instead of detecting it, maybe we could make it part of the recovery routine to press the ESC key. If I'm not mistaken that should close most things. But only as a last resort as it might bring up the system menu.
  • 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: Character dies when client crashes.

#7 Post by rock5 »

I'm working on this now.

I think I can simplify it further by just adding the 1 option to close the client when stuck. It will just use the forced command.

I'm at a loss as to what to call it. All the logout options start with LOGOUT so I thought LOGOUT_CLOSE but it's a 'when stuck' option so it should be something like LOGOUT_WHEN_STUCK_CLOSE but that's a bit long and a bit unclear. An obvious name would be CLOSE_WHEN_STUCK but that doesn't follow the other logout option names. Maybe LOGOUT_CLOSE_WHEN_STUCK, it's still long but more clear.

Any thoughts?
  • 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: Character dies when client crashes.

#8 Post by lisa »

LOGOUT_WHEN_CRASHED

I'm terrible when it comes to naming things lol
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: Character dies when client crashes.

#9 Post by rock5 »

lisa wrote:LOGOUT_WHEN_CRASHED
*giggle*... I don't know why I found that funny but I had a bit of a giggle at that.

But seriously, that's no good as the bot doesn't actually know if the client crashes, it just goes through the unstick routine until it gives up.

I already got it working. I ended up using 'CLOSE_WHEN_STUCK' as the option name. I've tested it by manually getting myself stuck. Works correctly. Next I'm going to run a waypoint file I have that often crashes the client (not sure why) and see if it closes the client ok. Then it will be ready to commit.
  • 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: Character dies when client crashes.

#10 Post by lisa »

nice work =)


I'm not sure why but I've never had crashing issues, only time I ever crash is when in seige with 40+ V 40+, less in seige and I don't crash but over 80 and crash every 5 mins.
Mind you I don't run more then 2 bots at a time, might have something to do with 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
Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: Character dies when client crashes.

#11 Post by Alkaiser »

rock5 wrote:
Alkaiser wrote:A somewhat related problem that I have experienced is the blasted chat box. I often minimize ROM while botting and do other things on my computer. Sometimes the chat box pops up unseen where it gets filled with zeros, obviously the bot trying to use the macro - effectively disabling the bot. Is there a way for the bot to check to see if the chat box is open and to close it if it gets opened while the bot is running?
Not really relevant to loggin out. If we could detect that, we would just close the chat and continue.

Instead of detecting it, maybe we could make it part of the recovery routine to press the ESC key. If I'm not mistaken that should close most things. But only as a last resort as it might bring up the system menu.
What I mean by somewhat related is that the character dies due to loss of bot control.
lisa wrote:nice work =)


I'm not sure why but I've never had crashing issues, only time I ever crash is when in seige with 40+ V 40+, less in seige and I don't crash but over 80 and crash every 5 mins.
Mind you I don't run more then 2 bots at a time, might have something to do with it.
I've had no in-combat crashes since rock5 made that fix in the most recent version.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Character dies when client crashes.

#12 Post by rock5 »

Alkaiser wrote: I've had no in-combat crashes since rock5 made that fix in the most recent version.
That's good to hear. :)
  • 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: Character dies when client crashes.

#13 Post by rock5 »

Ok, so I ran the waypoint file that always crashes to make sure the new options properly close the client when it crashes but of course it ran flawlessly all night :( . I guess I'll just release it as is with the testing I've already done.

One last issue to discuss. Normally I would leave the default behavior to what it was before the change ie. when you get stuck and logout is enabled, it returns to the character selection screen. But in this case I'm thinking the default should be to close the client, as peoples lives are at stake. :)

Does anyone have an opinion?
  • 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
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: Character dies when client crashes.

#14 Post by jduartedj »

Save the baby seals! Force it by default!
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates
Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: Character dies when client crashes.

#15 Post by Alkaiser »

rock5 wrote:peoples lives are at stake.
jduartedj wrote:Save the baby seals! Force it by default!
Ha! Yeah, force it.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Character dies when client crashes.

#16 Post by lisa »

jduartedj wrote:Save the baby seals! Force it by default!
agreed
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: Character dies when client crashes.

#17 Post by rock5 »

Ok, default behavior will be to close the client when stuck. Only if CLOSE_WHEN_STUCK = false will it just logout to the character selections screen.

I'll release it soon.
  • 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: Character dies when client crashes.

#18 Post by rock5 »

Ok I've released the changes to revision 555.
  • 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
Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: Character dies when client crashes.

#19 Post by Alkaiser »

Would it be reasonable to add the process termination function to CPawn:update() when it fails? I just had the bot crash on me with this error, and naturally, died.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Character dies when client crashes.

#20 Post by rock5 »

Alkaiser wrote:Would it be reasonable to add the process termination function to CPawn:update() when it fails? I just had the bot crash on me with this error, and naturally, died.
That opens up a whole kettle of beans. Do you realize how many times the 'error' function command is used in the bot? Potentially at each of those error points we might want it to close the client.

So maybe what you want is a 'logout on error' option? That would require either, the 'error' function to check the 'logout on error' option and logout before erroring, or another error function has to be created to do that and all the error commands replaced with that.
  • 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
Post Reply