Alright. I made some adjustments (with a couple things from SideStep) and added a log statement at the top of my task. It still doesn't run when I'm using the FishBot. However, I left it enabled when I ran an orderbot profile and the task runs as expected (at least, spits out my log message). It seems that the FishBot itself prevents it from running. Is that the case? Updated code attached.
Fishbot is one of the oldest botbase and I forgot that it doesn't have treehooks added. I could add it, but you said you had a version that was working onpulse which should be fine as well.
Ahh, gotcha. I will do that, then. Thank you! Tbh I suppose I could just make some orderbot profiles to handle all of that for me i guess. When I place that same code into the onpulse method, I get some memory write errors because it gets pulsed several times before the yes/no window closes (verified with log messages). What's the best way to slow that down in onpulse so it doesn't get banged around?
You could run your own coroutine in the onpulse Code: if (_coroutine == null || _coroutine.IsFinished) { _coroutine = new Coroutine(() => yourasyncfunction); } try { _coroutine.Resume(); } catch (CoroutineException ex) { Logging.WriteException(ex); } define _coroutine outside of onpulse then you can use await/async stuff inside that.
I finally had some time to implement your suggestion to my little plugin. It works, but it still executes the task about 4 or 5 times and throws a memory exception (I can post a log tomorrow or so) similar to what I mentioned before. I must be doing something wrong, but RB seems like it tries to launch the task each time the plugin is pulsed. I added in another check that I haven't tested yet. In any case, thanks for the help so far mastahg