Masuzu / SarasaBot

A GBF bot for automated raid farming with scriptable behaviour
https://gbtools.azurewebsites.net/SarasaBot/en/Home
27 stars 4 forks source link

Lua script error since latest update #239

Closed arjan127 closed 5 years ago

arjan127 commented 5 years ago

Hello,

ever since the update I get lua script errors, without fail, after using two character skills. It says:

"Failed to parse lua script C;\path\to\script.lua: runtime error device or resource busy: device or resource busy". First I thought perhaps I cocked up my Lua script, so I made a very simplified one. Still getting the issue, sadly.

The Lua script this happens on:

EnableChargeAttack()

if character_1.name == "mainCharacter" and enemy_1.charge_diamonds >= 1 then
    character_1:UseSkill(1)
end
if character_2.name == "Vaseraga" then
    character_2:UseSkill(3)
    character_2:UseSkill(2)
    character_2:UseSkill(1)
end
if character_1.name == "mainCharacter" then
    character_1:UseSkill(3)
    character_1:UseSkill(2)
    character_1:UseSkill(1)
end
character_3:UseSkill(3)
character_3:UseSkill(2)
character_3:UseSkill(1)

character_4:UseSkill(3)
character_4:UseSkill(2)
character_4:UseSkill(1)

[obviously replaced my character's name for mainCharacter]

ghost commented 5 years ago

I'm not an expert but I think this error occurs when you have too much things going on your computer. Try to close few programs and retry?

arjan127 commented 5 years ago

I wasn't running any program that I wasn't running before the update, but I tried it straight after booting up the PC (IE: not running any other program at all). Same problem still, sadly.

Masuzu commented 5 years ago

Hello, This is a first. I will try and look into it. Does this happen with the previous version as well? This would also affect Zooey bot but I got no such reports.

arjan127 commented 5 years ago

I can't say I've tried with a previous version yet so I'd have to look into how to get one. At a glance I can only see the latest version available to download so will require some digging, I guess.

There was one occasion with a previous update where I opted not to update the bot as I had to leave for an hour or so, so I intended to just run it while I wasn't at the PC. However, when doing so it told me that my license had expired so I just assumed that old versions cannot correctly retrieve your license status and you're always required to run the newest version.

Edit: yeah, so I cannot seem to find any older version to download. I have however (once again) tried to just completely reinstall everything, including the chrome extension but no luck.

appleloli commented 5 years ago

Hello also getting this error, only happening with 2.2 no issues with 2.1.3

jucky330 commented 5 years ago

hi I confirmed the same phenomenon,occurs when using viramate.

Masuzu commented 5 years ago

Hello, This time around I can't find any explanation for the error: it would just have happened in the previous version 2.1.3 as well, which is enclosed there: sarasa-bot-v2.1.3.zip

In any case, a new build of the last version 2.2 was re-released under version 2.2.1.

Runaris commented 5 years ago

Sarasabot is also not counting up its turn counter either from what I've noticed, which is affecting lua scripts that have a requirement for "if turn 2" or "if turn 3"

I've also been getting this error at times, on a laptop that is next to my main computer. But the lua scripts not counting turns up has actually wrecked my strategy on numerous raids. Especially when farming four pendants or trying to get minimums for HL points/blue box chance.

arjan127 commented 5 years ago

Hello, I tried running both the newest build as well as the older version. The new version gives the same error, whereas the old version seems no longer capable of joining a raid. It sat there for 10 minutes attempting and failing to join any raid.

Masuzu commented 5 years ago

Unfortunately it looks like the problem is isolated and only you seem to experience it. I can't reproduce it either. However, regarding the turn count not incrementing as reported by @Runaris , that is something I will look into.

Runaris commented 5 years ago

https://puu.sh/CEkRh/0285164263.png

here is an image of the turn counter not incrementing. Seems to be affecting skills as well as it will sometimes constantly tap skills thinking it can use them but it can't.

Masuzu commented 5 years ago

Thank you, from the console logs I can see why the turn stayed as 1 after the first attack but it should not have been the case for the other turns 🤔 v2.3.1 addressed a certain bug which prevented turn increments. However, in your case, it seems that you have some other extensions running which mess up with your turn count (or it could be that you left open some other devtools window somewhere else, or the viramate sync turn option for instance). On a side note, you should maybe consider using ReloadPageOnLastBattle=true if the raids you join are cleared too fast.

Runaris commented 5 years ago

sync turn option is off, synchronize difference between raid windows is also off.

https://puu.sh/CF1qP/3b5d920774.png still happening.

I have removed every extension from chrome, there should be nothing interfering with it anymore.

There is only one chrome window open. I usually restart the laptop running this before I do anything on it.

Something weird though : if ReloadPageAfterBattle is set to True, turns count up normally. I don't understand why.

Masuzu commented 5 years ago

Ah, that's unfortunate that the bug still persists with v2.3.1. That helps narrowing the root cause though. Thank you for the feedback.

Runaris commented 5 years ago

back to the original thread though, I am still getting "Lua script error : device or resource busy : resource busy" error as stated above

this time with an ULTRA SIMPLE lua script, something which just clicks skills and then presses attack for 5 turns before terminating the battle. I can't get much done with the lua error that is now rife. I can usually get about 7 or 8 raids joined before the error pops up, if that helps. But its almost completely random.

I think to trace this you need to include an option in the ini that allows sarasabot to dump a log file. so you can see where exactly this happens. We'll also be able to submit our own logs to help in tracking it down.

arjan127 commented 5 years ago

As far as I can tell, the error only happens when you tell it to use skills. Perhaps it's an issue that happens alongside Viramate (IE: using the shortcuts). I haven't been able to test it without as my license expired unfortunately.

404Utopia commented 5 years ago

I can confirm that the issue is still persisting and only happens when Viramate use is true.

Masuzu commented 5 years ago

If it is about dumping logs to a file, https://www.google.com/amp/s/helpdeskgeek.com/how-to/redirect-output-from-command-line-to-text-file/amp/ gives some examples to do so. The error "device or resource busy" is actually very likely due to a concurrency issue, tricky to fix but it will have to be addressed.

Masuzu commented 5 years ago

Stability improvements regarding this issue were added in the last version 2.3.2.

Runaris commented 5 years ago

2.3.2 freezes or stalls after "good to go" appears on the command window

doesn't seem to progress past this.

Masuzu commented 5 years ago

I apologize for the delay in the response, v2.3.3 should have addressed these issues.

Masuzu commented 5 years ago

However, I acknowledge that this time around this must be one of the most inextricable bug reported, and that the provided solution is more or less guesswork and addresses additional edge cases. For instance, I still do not see how the UseViramate parameter would change anything regarding whether that exception is raised or not.

Runaris commented 5 years ago

maybe its time to look at how your program is interfacing with viramate. If just one option causes the error which in this case is "UseViramate" it might be the way your program interfaces with viramate, or it might be something in viramate that could be messing with it. Viramate's update which changed a bunch of things did have some effect (split hotkeys into various sections) on this program so maybe its worth an investigation by tearing into viramates files.