Bug - Waiting for Info chatbotScript locks mafia

Not sure if this is exactly the problem, nor if there's an easy fix, but it seems to me that when I have a chatbotScript processing, no part of mafia updates. In fact, it appears to have completely locked (as I can't click through any frames nor type) but when Refreshing my charpane in the relay browser, I found that it was indeed still running.
 

icon315

Member
Not sure what you mean. I have my chatbotScript running on my multi all the time, but i can still do stuff when it is running.
 
I mean very specifically when it's executing.
I have one that, if a certain property is set, it just waits until the property is unset. Usually it doesn't take very long to unset, but come night time it waits until my_adventures is less than 130. While Script A was burning my turns, chatbotScript was invoked, saw that the resource was locked, and started to wait. When this happened my mafia completely locked. Once Script A finished burning, chatbotScript was allowed to continue and finish, then mafia was released from its hold.
 

holatuwol

Developer
Hard to say if this is a bug since chatbot scripts technically run in a synchronized code section (so anything that needs any data at all from chat will block and wait until the chatbot script is finished) and you should avoid doing anything that will take longer than a second or two inside of one.
 

Grotfang

Developer
This is why MrEdge's method of catching messages and outputting them to a file seems to work well. Means the chatbot script is active for a tiny amount of the time and another (non-chatbot) script can handle them.
 
Hard to say if this is a bug since chatbot scripts technically run in a synchronized code section (so anything that needs any data at all from chat will block and wait until the chatbot script is finished)

I've gotten used to the chat section locking, but I hadn't noticed before that all of mafia would lock up. Can't even change tabs.

I'll look at more data and see if this is really happening just because of the chatbotScript, or if there is a another condition that might be the culprit.
 

mredge73

Member
Mafia will lock up like that if your chabot script and your non-chatbot script hits the server at the same time.
If you want both scripts to corporate you may want to experiment with some handshake routines using preferences (my experiments failed, btw).
I would recommend that your chatbot script do very little to avoid problems like you are describing, my chatbot script no longer hits the server at all due to this kind of lockup.
My super simple one has worked flawlessly for 9 months now, all it does is log the incoming chat to a file for another script to do the interpreting.
 
Mafia will lock up like that if your chabot script and your non-chatbot script hits the server at the same time.
If you want both scripts to corporate you may want to experiment with some handshake routines using preferences (my experiments failed, btw).
I would recommend that your chatbot script do very little to avoid problems like you are describing, my chatbot script no longer hits the server at all due to this kind of lockup.
My super simple one has worked flawlessly for 9 months now, all it does is log the incoming chat to a file for another script to do the interpreting.

I -do- use a "handshake" routine, so that this doesn't happen. In fact, I made a nice ash script that I incorporate into pretty much everything that might change my character. See here.
 

Attachments

  • mutex.ash
    482 bytes · Views: 32
Top