vivinano / MudaeAutoBot

python bot that uses strictly the **Discord API** to Roll,Claim,and Kakera Snipe in Mudae. 5/10/21 project converted over to discum library
Apache License 2.0
152 stars 49 forks source link

React to specific Kakera #1

Closed zAzazyel closed 3 years ago

zAzazyel commented 3 years ago

Is there a way to react only to some types of Kakera, such as Yellow, Orange, Light ... Or will the bot react to everything that spawns? Sorry if this is already included in the settings, but I didn't find something like that

vivinano commented 3 years ago

I can probably add a way to get it to react to specfic ones. Currently how it works is that it check with there is "Kakera" that was added by mudae as reaction. So give me a bit and I will do some testing and close this issue when I figure out a solution

zAzazyel commented 3 years ago

Ok then. The outdated MudaeFarm from phosphene47 has a way to do it, but since it's all in C# idk if it would help you. There's no way to react to Light Kakera with MudaeFarm too because it's from a new mudae update.

vivinano commented 3 years ago

alright. Ive made changes to the code which should support Kak sniping.

Ive added a array variable within settings_Mudae.json for kak_list currently it has all the kak possibilities all listed out. Just delete the lines of kakera variations you dont want to snipe.

Don't worry about case Sensitivity as I factored for that user error so there wouldn't be any issues

I haven't tested the code so let me know if it still needs refining as its late and I wasn't able get a kakeraloot to appear in my rolls across servers

Do let me know If you need any other feature let me know and if I can close this issue

Thank you =)

zAzazyel commented 3 years ago

I tested it quickly and it is working with Light and ignoring the ones I removed. Later I will test with the others and bring other feedback. Thanks for the implementation!

zAzazyel commented 3 years ago

As I said, I am giving feedback after several tests. The new function is working very well with all the selected kakeras, I just have one last question. If I add the name of a custom or new emote, such as "candle" from new event, will the bot recognize and react as well? I think this is important in case new Mudae updates don't require a lot of code changes.

vivinano commented 3 years ago

How to code is set up as long as It is

  1. A Custom emoji
  2. Name of the emoji is in the list

So how I orginally did the testing was with the "wright" and "wleft" emote provided by mudae so as long as its added into to list it will work

there could be a issue if let say mudae adds like CandleC , CandleD and you have only "candle" in the list if i remember correctly since candle is in the list then it will react to both C and D also

it the issue with "kakera" also since kakera is technically in All variations of kakeraP , kakeraL etc ... so if naming gets more intensive ill have to look into it further.

zAzazyel commented 3 years ago

I tested it once adding "candle" to the list and it didn't work. But as it is not something that appears frequently, I have not been able to test it many times. I will try a few more times and give u a feedback

just to be sure I’ll add a screenshot of how it was set up when the candle didn’t work the first time Capturar

vivinano commented 3 years ago

I see that candle is not a custom emoji in discord

Is there a reason u need candle to be checked for ?

image

zAzazyel commented 3 years ago

Not specifically. In the Mudae event now you need to react to the "candle" first, but I already completed that. I was testing for future events like this.

vivinano commented 3 years ago

Ive never participated in a mudae event so I have no knowledge of how those work. Is it always react to candle ?

or is it like mudae react to this post ? If u have a screenshot of the thing i might be able to implement something but at the moment im unsure of the steps I would take to get to the goal of the event

zAzazyel commented 3 years ago

It works like a kakera reacts, u react to candle and collect it Capturar

vivinano commented 3 years ago

alright so I made changes to the code

instead of checking if its a custom emoji I made it check if the user is mudae bot

also keep in mind I also changed the Settings_mudae.json value from kak_list >>> emoji_list to avoid any confusion

and changed the code instead of checking for if it is "in" it has to be "equal to" to avoid it reacting to CandleC or CandleD in my example case

so check it out now and let me know as usual

thank you =)

vivinano commented 3 years ago

oh wait there still an issue currently so the reason why I didnt account for non custom emojis is that candle or heart isnt recognized by its name like candle you actually have to use 🕯️ or ❤️ so this might take some thought

vivinano commented 3 years ago

Okay so i've again made changes to the code this time it works the kakera snipes are staying the same let me know if that still works

but the event emoji's since they are not custom emoji's then they will have to be added within the mudaebot.py code

sorry I couldnt make it simple as just adding the name of the emoji but "partialemojis" do not have names which cant be added in json but directly in the code

zAzazyel commented 3 years ago

I got it, I thought I was missing something in the settings, but it turned out to be more difficult than I thought. I will close and go to test now, thanks for all your attention.

Event reactions tested and working as it should 🕯️

zAzazyel commented 3 years ago

I'm reusing this place a lot ... So, kakera and snipe event are working, as well as snipe from the series list, but I still haven't managed to get Kakera's value claim snipe to work. Can you help me set this up?

vivinano commented 3 years ago

that is fine so the kakera value claim snipe Ive updated slightly from the original release to include getting a base value from only the like rank or the claim rank or both currently I have it set to be anything higher than 200 kak it will snipe

also depening on when you cloned the code I commented out the "snipe portion" for testing purposes so that could be a reason that its not sniping and just printing "Possible Claim" in the window

vivinano commented 3 years ago

Also the only other code that could possible stop the snipping is that it is checking for "React with any emoji to claim" within the embed to avoid reacting to users when they managing characters

zAzazyel commented 3 years ago

I did a few more tests and it worked on one channel, but not on others. Is there any necessary setting on channel as a prerequisite to sniping? The character even appears in the cmd logs, but does not snipe (i'm sure it's not togglesnipe bc it doesn't react and i already checked that it's on togglesnipe 0)

vivinano commented 3 years ago

do other channels have toggle like rank , toggle claim rank or togglekakera roll on ?

zAzazyel commented 3 years ago

The channel that is working has only togglekakera, the one that is not working has the three. The value even appeared in the logs, so it's identifying. I just don't know why it's not reacting.

vivinano commented 3 years ago

can you send a img of the thing that wasnt sniped ? cause the server I made it for has all 3 enabled and it hasnt given me any issues i even tested with a server that only has like and/or claim value

vivinano commented 3 years ago

i guess for good measure send me the img of the thing that was also sniped so I can compare between the 2 or figure out what is going wrong

zAzazyel commented 3 years ago

Can we talk in an email or something to make it easier?

vivinano commented 3 years ago

we can. I can join a discord server or do discord DM's if that is easier for you

vivinano commented 3 years ago

Issues were with language other than english

the code was checking for english only which cause issues with the code

this was change to check for the "commands" instead as they are universal across mudae

Closing for now as this has been fixed