GuilleDiazFentanes / AutoClaim-AutoRoll-AutoReact-MudaeBot-2024

Mudae AutoClaim, AutoRoll, AutoReact working in 2024
38 stars 4 forks source link

Issues with Kakera Reactions and Troubleshooting Bot Functionality #1

Closed Furgoder closed 6 months ago

Furgoder commented 6 months ago
  1. The bot seems to have trouble recognizing when it rolls a Kakera. It doesn't appear to detect the Kakera and doesn't attempt to claim it.
  2. In the bot.py file, there is a syntax error in the import statement for the Vars module. The line timeString = ':'+ str(vars.repeatMinute) caused my bot to malfunction. I had to modify it to timeString = ':'+ str(Vars.repeatMinute) for the bot to function correctly.
  3. I've noticed that the bot sometimes decides to end the rolling process even when there are remaining rolls. I'm curious about how the bot calculates the number of rolls and determines when to conclude the rolling process. Could you please provide insights into the roll count calculation mechanism or any conditions that might lead to the premature termination of rolling? image image
GuilleDiazFentanes commented 6 months ago
  • The bot seems to have trouble recognizing when it rolls a Kakera. It doesn't appear to detect the Kakera and doesn't attempt to claim it.
  • In the bot.py file, there is a syntax error in the import statement for the Vars module. The line timeString = ':'+ str(vars.repeatMinute) caused my bot to malfunction. I had to modify it to timeString = ':'+ str(Vars.repeatMinute) for the bot to function correctly.
  • I've noticed that the bot sometimes decides to end the rolling process even when there are remaining rolls. I'm curious about how the bot calculates the number of rolls and determines when to conclude the rolling process. Could you please provide insights into the roll count calculation mechanism or any conditions that might lead to the premature termination of rolling? image image

Ty for trying it!! I will check all your points and give you an answer as soon as posible ^^

GuilleDiazFentanes commented 6 months ago

@Furgoder It´s all fixed now!! Thank you for noticing about the (V)vars. repeatMinute error! The array of kakeras had the first 'k' in capital letters so the comparation did not give any coincidences, it is now fixed. I have changed all the files to upgrade the bot and the console, now you should also notice that it doesnt stop when it has still some rolls to use ( the roll calculation was done by continuing to roll until you get a message with "content")

Furgoder commented 6 months ago

@Furgoder It´s all fixed now!! Thank you for noticing about the (V)vars. repeatMinute error! The array of kakeras had the first 'k' in capital letters so the comparation did not give any coincidences, it is now fixed. I have changed all the files to upgrade the bot and the console, now you should also notice that it doesnt stop when it has still some rolls to use ( the roll calculation was done by continuing to roll until you get a message with "content")

Thank you for the prompt response and the fixes! I appreciate your efforts in addressing the issues.

Syntax Errors in bot.py: In my previous message about syntax errors in bot.py, I forgot to mention that there is also an error in the first line: import vars. It should be import Vars. After the update, this issue remains unresolved and continues to trigger errors.

Kakera Reacts: While the fix for Kakera reacts didn't completely resolve the issue, I've noticed an improvement. The bot now recognizes when a character is already claimed, and a Kakera should spawn accordingly. However, the problem persists, and I'm wondering if there might be an issue in my Vars.py. For Kakera, I have set the values as follows: desiredKakeras = ['KakeraP','KakeraY','KakeraO','KakeraR','KakeraW','KakeraL'].

I haven't identified any other issues so far. Your attention to these matters is greatly appreciated.

Thank you once again for your time and assistance.

image image

Furgoder commented 6 months ago

I still have a question about the bot's functionality. Does the bot only manage rolls initiated by itself, or is it supposed to monitor and respond to rolls from other users as well?

Additionally, if it is intended to monitor rolls from other users, it seems that the bot is not currently performing this task.

GuilleDiazFentanes commented 6 months ago

Also changed!, you are a beast finding those types of errors, im so gratefull. As I said, the case sesitive array of kakeras must be ['kakeraP','kakeraY','kakeraO','kakeraR','kakeraW','kakeraL']. k and K are REALLY similar. It took me a lot of time to discover that the error was solved by doing this : KakeraY -> kakeraY (I also made the change in the readme and default Vars)

For the moment, the bot only records and manages its own rolls, it is posible to upgrade it in order to listen to other messages, but im still on it.

rahaaatul commented 6 months ago

Are you going to add desired waifus?

By the way, how would you pokeroll if the channel is different?

Also, my cmd is like this: it doesn't show if it's working or not, it's just stuck.

image

Is it supposed to be like this?

GuilleDiazFentanes commented 6 months ago

Are you going to add desired waifus?

By the way, how would you pokeroll if the channel is different?

Also, my cmd is like this: it doesn't show if it's working or not, it's just stuck.

image

Is it supposed to be like this?

Hi!!, the bot pokerolls in the same channel (after all the rolls), or do you mean that you want to pokeroll in a different channel by other reason?

About the console, that is completely normal until you reach the minute "repeatMinute = 'xx' " In a practical example, if i have the var like this : repeatMinute = '30', the console would be stuck until its 14:30, and then again until 15:30 etc etc, check the minute and if u want to test it put 2-3 minutes more than the actual hour and wait

About the desired waifus: Yes! im working in all the advanced features, not just that one!

rahaaatul commented 6 months ago

By the way, there's a problem, When the script rolls, it expects a message but if someone else sends a message or the bot sends other message like 'kakera recieved', the script completely ignores the roll message it was expecting. What's the solution for it? @GuilleDiazFentanes

Do you know a way to monitor all messages, when it runs?

rahaaatul commented 6 months ago

Hi!!, the bot pokerolls in the same channel (after all the rolls), or do you mean that you want to pokeroll in a different channel by other reason?

Yes, we have seperate channels for each. Pokerolls are in different channel.

About the console, that is completely normal until you reach the minute "repeatMinute = 'xx' " In a practical example, if i have the var like this : repeatMinute = '30', the console would be stuck until its 14:30, and then again until 15:30 etc etc, check the minute and if u want to test it put 2-3 minutes more than the actual hour and wait

Thanks, I've figured that out. I modified it a bit to start when i start the script. No repeats.

About the desired waifus: Yes! im working in all the advanced features, not just that one!

Well, looking forward to it. Although, I modified the code a bit, and created a wishlist text to match and react:

if cardSeries in Vars.desiredSeries or cardName in wishList:

By the way, I kinda find it slow. It reacts really slow, shouldn't it react as quickly as possible?

Also, it didn't react to any kakera's, I wonder why! Can you check?

GuilleDiazFentanes commented 6 months ago

By the way, there's a problem, When the script rolls, it expects a message but if someone else sends a message or the bot sends other message like 'kakera recieved', the script completely ignores the roll message it was expecting. What's the solution for it? @GuilleDiazFentanes

Do you know a way to monitor all messages, when it runs?

Did u update to the last version, that shouldnt be happening more! the bot should roll all the times he can , if not i can make another change. Try the new version!!

Yes, we have seperate channels for each. Pokerolls are in different channel. With the actual code, im afraid that wont be possible, I can change it in a future though!

Thanks, I've figured that out. I modified it a bit to start when i start the script. No repeats.

Perfect! Now you can test it better! After u have it all carrectly settled the auto repeat is sooo comfortable

Well, looking forward to it. Although, I modified the code a bit, and created a wishlist text to match and react:

if cardSeries in Vars.desiredSeries or cardName in wishList:

That is a good, start, but u need to change a bit more code for that, im on it in the advanced version!

By the way, I kinda find it slow. It reacts really slow, shouldn't it react as quickly as possible?

Also, it didn't react to any kakera's, I wonder why! Can you check?

Yeah my friend, im afraid you 100% have the old version, thanks to @Furgoder I could solve all that u are saying, update ALL the files for the problems to be solved!! ( you will have to put the data again )

rahaaatul commented 6 months ago

Did u update to the last version, that shouldnt be happening more! the bot should roll all the times he can , if not i can make another change. Try the new version!!

I downloaded it for the first time yesterday after your latest commit. I'd like to ask for an option to make it roll infinitely but stop when a message like this is given: the roulette is limited to. For now, this is how i'm doing it, but it's not perfect:

# Check if the message is present in the response
        if 'content' in jsonCard[0] and 'the roulette is limited' in jsonCard[0]['content'].lower():
            print("Roulette limit reached. Stopping the rolling process.")
            break  # Exit the loop if the message is found

Perfect! Now you can test it better! After u have it all carrectly settled the auto repeat is sooo comfortable

I'm not confident with the auto repeat yet, because I need to monitor when it rolls, and what it rolls, because it completely ignores the kakera, and rolls, when there are other messages in between.

That is a good, start, but u need to change a bit more code for that, im on it in the advanced version! I did add more codes to it. But, yeah waiting for your version.

Yeah my friend, im afraid you 100% have the old version, thanks to @Furgoder I could solve all that u are saying, update ALL the files for the problems to be solved!! ( you will have to put the data again )

I downloaded it yesterday, 24 hours did not occur yet. So I think I'm on the latest version. I directly downloaded the zip file.

GuilleDiazFentanes commented 6 months ago

I downloaded it for the first time yesterday after your latest commit. I'd like to ask for an option to make it roll infinitely but stop when a message like this is given: the roulette is limited to. For now, this is how i'm doing it, but it's not perfect:

That solution is perfect, indeed, for my personal use, its the one I use, but for a common github repository there is a problem, different languages. As this should be a solution for everyone, i cant use english only code reception, so i need to do things like checking content is null or similar.

I'm not confident with the auto repeat yet, because I need to monitor when it rolls, and what it rolls, because it completely ignores the kakera, and rolls, when there are other messages in between.

Put here in the answer your desiredKakeras array, and your line 26-27 of Function.Py bot.triggerSlashCommand(botID, Vars.channelId, Vars.serverId, data = rollCommand) time.sleep(1.8) to see what time sleep do u have

rahaaatul commented 6 months ago

That solution is perfect, indeed, for my personal use, its the one I use, but for a common github repository there is a problem, different languages. As this should be a solution for everyone, i cant use english only code reception, so i need to do things like checking content is null or similar.

Oh wow! I didn't know this, I thought Mudae was a English only bot. Maybe you could add a dictionary to match with for different languages.

Put here in the answer your desiredKakeras array, and your line 26-27 of Function.Py bot.triggerSlashCommand(botID, Vars.channelId, Vars.serverId, data = rollCommand) time.sleep(1.8) to see what time sleep do u have

Mine is 1.8 too... Everything is in default as you coded. Nothing here is changed.

By the way, can't we go faster? It seems that I can react faster than this script.

rahaaatul commented 6 months ago

Video Demo:

https://github.com/GuilleDiazFentanes/AutoClaim-AutoRoll-AutoReact-MudaeBot-2023/assets/86149861/bc39e9be-2da9-4c2f-b13a-5de1fc726d85

GuilleDiazFentanes commented 6 months ago

Maybe you could add a dictionary to match with for different languages.

There are a lot of languages but yes, thats my plan

By the way, can't we go faster? It seems that I can react faster than this script.

The time.sleep 1.8 it´s quite fast, indeed, discord has teorically a maximum of 2 slashroll commands per 5 seconds, you can put a number inferior than 1.8 but it will have some errors. If you use the "$" command you can do it faster, but u wont have the bonus kakera or wish probability.

Video Demo: As I see in the video, the kakera you want to react is a 'kakeraT' and in the example we have in the code that one is not included, the complete list of kakeras is:
"kakera", "kakeraP", "kakeraT", "kakeraG", "kakeraY", "kakeraO", "kakeraR", "kakeraW", "kakeraL"

I also changed the number of messages to make it stop from 2 to 3, so it will be less probable to end rolls while there are still rolls without being used.

rahaaatul commented 6 months ago

The time.sleep 1.8 it´s quite fast, indeed, discord has teorically a maximum of 2 slashroll commands per 5 seconds, you can put a number inferior than 1.8 but it will have some errors. If you use the "$" command you can do it faster, but u wont have the bonus kakera or wish probability.

I don't care if the roll is slow, but the claiming has to be faster. It didn't claim any in the video, otherwise I would have showed you. It reacts quite slow, and that's a big problem.

Video Demo: As I see in the video, the kakera you want to react is a 'kakeraT' and in the example we have in the code that one is not included, the complete list of kakeras is: "kakera", "kakeraP", "kakeraT", "kakeraG", "kakeraY", "kakeraO", "kakeraR", "kakeraW", "kakeraL"

Thanks for providing the full list. I thought the one you provided was the complete one. I'm at the early stage of the game, so I need all the kakera I can get.

I also changed the number of messages to make it stop from 2 to 3, so it will be less probable to end rolls while there are still rolls without being used.

I did not understand this, can you clarify, please? Thank you.

GuilleDiazFentanes commented 6 months ago

I don't care if the roll is slow, but the claiming has to be faster. It didn't claim any in the video, otherwise I would have showed you. It reacts quite slow, and that's a big problem.

Can I see your desired series list? It may have not claim something because its not in your desiredSeries

if cardSeries in Vars.desiredSeries:
               print('Trying to Claim '+ cardName)

The bot isnt even trying to claim because its not printing that, check the array

I did not understand this, can you clarify, please? Thank you. The bot needs to get 3 messages like the ones u said (kakera reacted) in order to stop, before it were only 2.

rahaaatul commented 6 months ago

I don't care if the roll is slow, but the claiming has to be faster. It didn't claim any in the video, otherwise I would have showed you. It reacts quite slow, and that's a big problem.

Can I see your desired series list? It may have not claim something because its not in your desiredSeries

They were not on my list. True. But I'm not talking about that, I'm talking about how much time it takes to claim. At least 3 seconds. That's enough for someone else to snipe the card.

By the way, can you fix this issue:

Traceback (most recent call last):
  File "C:\File\To\Bot.py", line 14, in <module>
    simpleRoll()
  File "C:\File\To\Function.py", line 52, in simpleRoll
    cardName = (jsonCard[0]['embeds'][0]['author']['name'])
                ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'author'

It appears after rolling the new free card from Mudae: image

Btw, can I get the Kakera value here: image

GuilleDiazFentanes commented 6 months ago

They were not on my list. True. But I'm not talking about that, I'm talking about how much time it takes to claim. At least 3 seconds. That's enough for someone else to snipe the card.

Im afraid it can not be faster, discord offers the message send/reception and pythons treats them , if you dont have time.sleep to remove (i didnt put it) you cant do it faster. A thing u can do is put in mudae a 4 second personal protect claim time.

By the way, can you fix this issue:

I changed Function.Py to try to handle also those erros, it should work ,also kakera value should appear now

Consider giving a Star to the repository!! @rahaaatul

Furgoder commented 6 months ago

Also changed!, you are a beast finding those types of errors, im so gratefull. As I said, the case sesitive array of kakeras must be ['kakeraP','kakeraY','kakeraO','kakeraR','kakeraW','kakeraL']. k and K are REALLY similar. It took me a lot of time to discover that the error was solved by doing this : KakeraY -> kakeraY (I also made the change in the readme and default Vars)

For the moment, the bot only records and manages its own rolls, it is posible to upgrade it in order to listen to other messages, but im still on it.

I apologize for not noticing the syntax issue with Kakera. After the changes, everything is working now. The functionality I reported for the most part is operational, so we can probably consider this matter resolved.

However, I've observed a non-critical issue: when a character with a double Kakera drops, the bot doesn't seem to react to it. I've attached a screenshot for your reference. image (Before this roll, was roll with free kakera, bot claimed it)

GuilleDiazFentanes commented 6 months ago

However, I've observed a non-critical issue: when a character with a double Kakera drops, the bot doesn't seem to react to it. I've attached a screenshot for your reference.

yeah, i knew that issue, the button syntax for that case is different from a normal one and i didnt stop to investigate, in my opinion it might react to the first kakera maybe, but not the second, i might put it on a future but not in my current plan ( a bit difficult hihi) image In case of some of my bots they got the first one only

rahaaatul commented 6 months ago

Im afraid it can not be faster, discord offers the message send/reception and pythons treats them , if you dont have time.sleep to remove (i didnt put it) you cant do it faster. A thing u can do is put in mudae a 4 second personal protect claim time.

That's a way to do it. Thanks.

I changed Function.Py to try to handle also those erros, it should work ,also kakera value should appear now

Thank you, for adding the cardPower, it was really necessary.

Consider giving a Star to the repository!! @rahaaatul

Sorry, I was so in the coding. I forgot to do it. By the way, can you open the discussion tab, so we could discuss codes there or to ask questions too? @GuilleDiazFentanes

rahaaatul commented 6 months ago

Bro, look at the close call:

image

If I wasn't there, it'd be claimed by someone else, it didn't record Mikasa Ackerman, then another one. Because someone was doing bot commands. and it missed two of the cards. You need to do something about it, please @GuilleDiazFentanes

GuilleDiazFentanes commented 6 months ago

Im afraid it can not be faster, discord offers the message send/reception and pythons treats them , if you dont have time.sleep to remove (i didnt put it) you cant do it faster. A thing u can do is put in mudae a 4 second personal protect claim time.

That's a way to do it. Thanks.

I changed Function.Py to try to handle also those erros, it should work ,also kakera value should appear now

Thank you, for adding the cardPower, it was really necessary.

Consider giving a Star to the repository!! @rahaaatul

Sorry, I was so in the coding. I forgot to do it. By the way, can you open the discussion tab, so we could discuss codes there or to ask questions too? @GuilleDiazFentanes

Discussions created!

GuilleDiazFentanes commented 6 months ago

If I wasn't there, it'd be claimed by someone else, it didn't record Mikasa Ackerman, then another one. Because someone was doing bot commands. and it missed two of the cards. You need to do something about it, please @GuilleDiazFentanes

I will think a form for the bot to do it, but if someone is spamming messages the message management that discord offers won’t be very solid to handle it

Tegarcs142 commented 3 weeks ago

Also changed!, you are a beast finding those types of errors, im so gratefull. As I said, the case sesitive array of kakeras must be ['kakeraP','kakeraY','kakeraO','kakeraR','kakeraW','kakeraL']. k and K are REALLY similar. It took me a lot of time to discover that the error was solved by doing this : KakeraY -> kakeraY (I also made the change in the readme and default Vars) For the moment, the bot only records and manages its own rolls, it is posible to upgrade it in order to listen to other messages, but im still on it.

I apologize for not noticing the syntax issue with Kakera. After the changes, everything is working now. The functionality I reported for the most part is operational, so we can probably consider this matter resolved.

However, I've observed a non-critical issue: when a character with a double Kakera drops, the bot doesn't seem to react to it. I've attached a screenshot for your reference. image (Before this roll, was roll with free kakera, bot claimed it)

here a code if i not forgot: 'components': [{'type': 1, 'id': 1, 'components': [{'type': 2, 'id': 2, 'custom_id': '1253698927929200741p1113134416726851594.2', 'style': 2, 'emoji': {'id': '1197130196357234698', 'name': 'yellowmoon'}}, {'type': 2, 'id': 3, 'custom_id': '1253698927929200741p1113134416726851594.2p2', 'style': 2, 'emoji': {'id': '1197130201700773939', 'name': 'purplemoon'}}, {'type': 2, 'id': 4, 'custom_id': '1253698927929200741p1113134416726851594.2p3', 'style': 2, 'emoji': {'id': '1197130196357234698', 'name': 'yellowmoon'}}]}] thats with 3 kakera reacts

Tegarcs142 commented 2 weeks ago

Also changed!, you are a beast finding those types of errors, im so gratefull. As I said, the case sesitive array of kakeras must be ['kakeraP','kakeraY','kakeraO','kakeraR','kakeraW','kakeraL']. k and K are REALLY similar. It took me a lot of time to discover that the error was solved by doing this : KakeraY -> kakeraY (I also made the change in the readme and default Vars) For the moment, the bot only records and manages its own rolls, it is posible to upgrade it in order to listen to other messages, but im still on it.

I apologize for not noticing the syntax issue with Kakera. After the changes, everything is working now. The functionality I reported for the most part is operational, so we can probably consider this matter resolved.

However, I've observed a non-critical issue: when a character with a double Kakera drops, the bot doesn't seem to react to it. I've attached a screenshot for your reference. image (Before this roll, was roll with free kakera, bot claimed it)

Looks like i got fix for it