What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Trying to use windows too fast can result in read / write exceptions.

Neverdyne

Community Developer
Joined
Sep 12, 2014
Messages
650
Reaction score
20
I've noticed that even if a window's manager tells you the window is open (i.e. SelectIconString.IsOpen) if you try to do something with it too fast it'll throw a process read / write exception. You can test this with a simple PrioritySelector:

Code:
var interact = new Action(r => Core.Player.CurrentTarget.Interact()));
var choose = new Decorator(req => SelectIconString.IsOpen, new Action(r => Logging.Write(SelectIconString.Lines())));
var behavior = new PrioritySelector(choose, interact);

Target a Merchant & Mender and run it. Just calling SelectIconString.Lines() without doing anything with it will throw the exception. I'm guessing this is because on that moment, Rebornbuddy has read that the window is open from the game's process, but still hasn't read the window's string lines, maybe that information is not yet visible. Anyways, a simple Sleep() composite is usually enough, but in case the exception still happens is it fine to simply catch it, give some time, and try again? Or will the exception still mess something in Rebornbuddy even if caught on our code?
 
Last edited:
How about you post the error log?

Edit:
Also give your entire code please.

Code:
new Decorator(r => SelectIconString.IsOpen, new Action(r => { SelectIconString.ClickLineEquals(QuestName);  })),
I use this pattern all over the place and haven't had a single issue so you must be doing something wrong.
 
Sorry for not attaching the log, here it is. TestBot.cs is a quick botbase I made to test it in isolation. No plugins were enabled during the test. Just target a Merchant & Mender (I was using the one on Black Brush Station) and run the botbase.
 

Attachments

Last edited:
Back
Top