Closed UncleBob800 closed 1 year ago
Oh...
This feature is nice if you think about the display stuff.
But he is changing a game variable "opponents_list". The sim info is added there (this is "cool" for us to use) but he also replaced the power value initialy there by the number of point you could expect to win. As he also remove the power info displayed in the screen there is no place anymore where I can found this info. Meaning my auto fight function is not working anymore with HH++ BDSM.
This function show me our script is doing something wrong here and I must find what. I will not copy his code/function to use on our script. As it is "stilling".
I understood KK is allowing this script and we could use it. This script have good stuff. But the fact it changed values and display in such drastic manners is preventing ours to work the same way as without script or with OCD one. For me this is a really bad way of doing.
I can impelment some condition to detect it but I'm afraid of sequence between scripts. Ie if ours is starting then in the same time BDSM modify the values. It will break completly the auto fight. And there is no way of doing it. The only way is to ensure BDSM is ended before our script starts (in tampermonkey settings) but this is not completly sure...
As the auto fight function look for the lowest power but here it should be the highest point (stored in power variable), I recommand you to not have both active at the same time to avoid wrong auto fight. You could only deactivate the simu option on BDSM or the auto fight.
For sure I will have a look how I can solve the power calc. But I don't have any idea yet to make compatible with this BDSM functionality :(...
@deuxge hmm, is there any way to check if player has anything from the HH++ BDSM script, for example, the same Sim Results header? And if your script finds such a header, then do an auto-attack based on this data. If there is no header, then do an auto-attack the old fashioned way. Simply put, a "switch" in a script that would adjust its work depending on the situation. Although it seems to me that it would be better to look at how Sim Results is implemented in him and do something similar in his own way (do not copy) Also, I don't really understand why you don't want to copy his code, in fact they have a ready-made solution for what you tried to do for PowerCalc earlier. Even -MM-, the creator of another Leagues script, is literally copying Sim from HH++ BDSM. I also see no reason to blame them for the implementation method, because: 1) your script is not approved by KK for obvious reasons, so other script creators don't care about compatibility with you 2) there is not enough space in the League table to place something else there. And in addition, also a script by -MM- that places the pre-battle elements in the form of a panel on the side, there is even less space left. And judging by some updates, the creator of HH++ BDSM and the creator of HH Leagues++ have started tweaking the script to work with each other.
I checked fights sorted by Kinkoid's Power and Zoo's Sim. And in my opinion, Sim better reflects the profitability of the attacks of certain opponents than Kinkoid's Power, which suggests that Sim is much more profitable to use. I also checked how the game looks like, if of all the scripts I have only HH Leagues++ enabled and I made sure that -MM- also uses Sim from HH++ BDSM (once again I will clarify that the HH++ BDSM script was disabled at that moment, and were also cleaned cookies for authenticity). And so I don't understand your reluctance to use this ready-made solution even more.
UPD
I have now joined their (HH++ BDSM) Discord and confirm they are working together. Also, given the fact that the official KK's Discord literally has a bot-command that gives a link to HH++ BDSM and from time to time it is sent to users, then there is a potential possibility that in the future you will receive even more messages from different players about the inoperability of which-either in your script and write to everyone "Don't use HH++ BDSM" I think it is not rational. Therefore, it seems to me that it is still better to reckon with the presence of this script than to ignore it. I don't consider it rational to support HH++ OCD for a number of reasons: 1) rarely and slower updated after the "wonderful" Kinkoid updates 2) in fact, Tom copies the work from all the same HH++ BDSM, because earlier I used the HH++ OCD script and the booster panel was never there, then I started using HH++ BDSM because of the more pleasant interface and features, there I noticed the presence of this a panel that hasn't been in HH++ OCD for many months. But then this panel appeared in the same form in HH++ OCD.
Tom himself is also present on the HH++ BDSM Discord server. And it's only a matter of time before Sim from HH++ BDSM appears in HH++ OCD. One way or another, you will inevitably run into this problem. And I think it's better to be prepared right away. P.S. in principle, Tom's script has always been considered a sort of HH++ BDSM in its own way. I also often observed that on the game forum and on the discord server, screenshots flashed with the HH++ BDSM interface, and not HH++ OCD. Don't consider this supposedly for advertising, I just analyzed and gave out the facts that I saw for a long time.
hmm, is there any way to check if player has anything from the HH++ BDSM script, for example, the same Sim Results header? And if your script finds such a header, then do an auto-attack based on this data. If there is no header, then do an auto-attack the old fashioned way. Simply put, a "switch" in a script that would adjust its work depending on the situation.
Yes this could be possible. This is what I wrote abote. The issue is the following.
If the scripts are processing in this order, no issue. HH++ BDSM => Work on sim and display HHAuto -> detect HH++ BDSM.
HHAuto use Sim value.
If then the script are in the other way HHAuto -> do not detect HH++ BDSM.
HHAuto -> start sorting opponent HHAuto use Power value. In the same time HH++ BDSM => Work on sim and display and change power values HHAuto -> sorting opponent is broken
Auto league will not fight correct opponent. There is no way I can prevent this. This order must be correct on All PC using HHAuto (in tampermonkey). The only thing I can do is stopping auto fight. Maybe in next loop it can be fine but this need investigation.
Although it seems to me that it would be better to look at how Sim Results is implemented in him and do something similar in his own way (do not copy) Also, I don't really understand why you don't want to copy his code, in fact they have a ready-made solution for what you tried to do for PowerCalc earlier.
Similar way yes, copy no, this is his property and there is no liscence on the repository mentioning we can use it elswhere.
Even -MM-, the creator of another Leagues script, is literally copying Sim from HH++ BDSM.
He did not copy, he is using it as is (assuming it is already in the browser) https://github.com/HH-GAME-MM/HH-Leagues-Plus-Plus/blob/main/HH-Leagues-Plus-Plus.dev.js#L349C1-L352C59 Doing the same will force every user to use this HH++ BDSM. I don't think it's a valid message.
I also see no reason to blame them for the implementation method
I know we are not approved by KK. But still, changing JS game variable (in a general way) is very dangerous things as we don't know how they are used by the game. And such edit can break the game or seen by them as tentative of cheating. Maybe for this specific use case it's ok.... Personnaly I never change any variable when doing user scripts. Also, I understand it is easier to do this way
"Don't use HH++ BDSM" I think it is not rational.
For sure we can't support all every possible script in the world. For the moment this change is not supported and until I found a solution I would encourage you to not use both feature at the same time.
The more script we supports the more work it is for me to make things working (This is a good example)
HH++ BDSM is not supporting transpornstarharem at the moment. (Even if I'm not playing it, HHAuto is supporting it)
I heard what you say. I understand more people will use HH++ BDSM. I never say I wont support this change, I just say I have no idea how right now.
@deuxge
I heard what you say. I understand more people will use HH++ BDSM. I never say I wont support this change, I just say I have no idea how right now.
Ok, I understood everything. Apparently there was a language barrier (English is not my native language) and I misunderstood the previous message. My apologies.
HH++ BDSM => Work on sim and display HHAuto -> detect HH++ BDSM.
HHAuto use Sim value.
If then the script are in the other way HHAuto -> do not detect HH++ BDSM.
HHAuto -> start sorting opponent HHAuto use Power value. In the same time HH++ BDSM => Work on sim and display and change power values HHAuto -> sorting opponent is broken
I have a hypothesis that this may be due to the fact that when the page loads, the script starts counting Sim and Power is replaced by Sim, which is why your script throws an error, because it does not understand which particular variable to work with. What if, when opening the League page, pause, for example, for 5-10 seconds (the last few days have shown us that damn KK servers can give such a delay when opening the League page, even on the best Internet). Thus, the page will fully open, Sim will be successfully calculated for HH ++ BSDM and you will be able to use this data. At the same time, you can check for the presence of HH ++ BSDM on the main page, because at least there is a button for their settings. Or, as a beacon, use any other interface element of their script, which they exclusively have. Then your script will always know that in the League it needs to rely on Sim, and not on Power. In theory, of course. I am not strong in JS and therefore I may not know the intricacies of this programming language. If that works, then maybe you can use the same trick that -MM- did in HH Leagues++ script to interact with the Sim. The very last option is to just make one global option "Use HH++ BSDM features". But it seems to me that in any case, you need to make a delay before interacting with opponents so that your script starts to act when all the Sims are counted. Here one trick comes to mind that I personally would do: search for the word Sim in the header of the table, if the word is not found - repeat the search (the main thing is that there is a delay of 1-3 seconds between repetitions, otherwise we may increase the load on the CPU and performance will drop) and not attack in the league. Once the word is found - interact with opponents based on their Sim. And limit the cycle to 30 repetitions so that there are no stuck on the page in the League and at least go to the main one, resetting the auto-attack timer of the League, so that the script does not immediately try to go to the League page again (so it will at least try again after 35 minutes) But this is subject to the presence of an HH ++ BSDM autodetector or a manual switch.
English is not my native language also.
Personnaly I like more the OCD one. I like some design of the BDSM but it miss some usefull feature For example, the links for activities and market going directly to the tab wanted, the direct link to the champion, and the red colors for the even eding in less than one day. I agree the troll popup shortcut is more pretty on BDSM.
We can ask to zoopokemon not to remove the initial value so you can use it again. I've sent a message to him. For OCD, there are no improvements yet because the author is in vacation, but when he'll return to business, he'll do something. I don't know what yet. I think it's important to respect some basic rules so the scripts not interfere.
I had a look to the sim functions used in HH++BDSM or OCD, they are the same (just adapted to their respective script) And ours seems also to be the one from OCD (as you can see here https://github.com/Roukys/HHauto/blob/main/HHAuto.user.js#L14393) from before. As OCD is in MIT licence, you can "use" part of it. This must why Roukys (or another previous author) used it and mentioned him. With this in mind, I can update the function from OCD to make the number. First try are really quicker. I will make the update soon.
As you mentioned OCD maybe updated later, then maybe this part will be useless after he did.
It doesn't solve the BDSM compatibility issue yet.
Update is done and merged.
HHAuto power calc displayed is faster. Auto fight is sorting by power as before or by points if replaced by HH++BDSM. If HH++BDSM update list in the middle, of building, restart all function with logging information. Values are taken from the html displayed.
@UncleBob800, you can use auto fight and HH++BDSM power cal together from 5.35.6.
@deuxge thanks a lot for your work. On the test server and the Comix Harem server, the battles were successful. For some reason, on the HentaiHeroes.com server, the script couldn't see the Sim values and as a result the attacks were randomly (the script just chose a random opponent) I also noticed that after each triple attack, for some reason, the league page is refreshed after every attack. But this was not the case in Comix Harem, where the attack took place sequentially on one page. I won’t be able to upload the log file itself so that Kinkoid wouldn’t be able to track who uses this script and arrange a “witch hunt”, so the log will be in the form of a screenshot with crossed out nicknames: (CIA, secret documents with crossed out text ... oh yeah, feel yourself as a Black Ops character)
@deuxge I think I found the reason. All because of the other localization that was enabled on this server. When I selected English localization, the attack in the league was successful, taking into account the Sim. At the same time, it is not clear why this happened, because in the league table the title of the Power column is not localized and it was already displayed in English language.
@deuxge thanks a lot for your work. On the test server and the Comix Harem server, the battles were successful. For some reason, on the HentaiHeroes.com server, the script couldn't see the Sim values and as a result the attacks were randomly (the script just chose a random opponent) I also noticed that after each triple attack, for some reason, the league page is refreshed after every attack. But this was not the case in Comix Harem, where the attack took place sequentially on one page.
When the script end a 3 times battle, it refresh the page. This is to ensure data in the page are updated and are up to date for next fight.
I don't get how your issue is happening... I have added a log and change the selector in case there is additional button in the opponent row to be safer.
Even with your game not in english it doesn't explain it. Tell me if you face it again...
What is your language selected ?
@deuxge
Even with your game not in english it doesn't explain it.
Perhaps this is due to the fact that in the English localization the fractional number is separated by a dot, while in others localization there is a comma instead of a dot. Also, I did not take into account that in other localizations the title of the Power column is translated into the selected language. The only localizations where the Power title remains are Japanese and Russian. Even the title Sim Results in some localizations is translated into the appropriate language. This suggests that another way of identifying when the HH++ BDSM script is active should be devised. In general, how realistic is it to read the value of a setting that is activated in HH++ BDSM? If this is real, then you can take the directly activated Sim option in the HH++ BDSM settings as a beacon (provided that your script can actually check the value of the variable of another installed script). I also checked by selecting any other localization language, where there will be a comma instead of a dot in the Sim number and I confirm my guess, the script cannot recognize the value.
I'm not looking to the title to detect BDSM but to a css class present inside the power cell. Meaning if there is only text (no script) or sim result.
@deuxge Now the script doesn't attack opponents
In english ?
In english ?
yep
I have added some logs in last version. I don't see why it do not found any opponent. I don't have issue on 3 games + test server
@deuxge I tested and noticed the following: in Deutsch, Español, Français, Italiano and Russian localization, the script recognizes the presence of HH++ BDSM, but does not recognize the Sim (NaN) value. In all localizations, instead of a dot, there is a comma.
In English and Japanese localization, the script recognizes HH++ BDSM and recognizes the value of Sim. There, the fractional value is displayed as a dot.
I also found a small bug. When I tested attacks under different localizations, on a hentaiheroes.com server with the selected Italian localization, the script did not recognize HH++ BDSM and sorted by Power. On the test server with the same localization, this was not the case (it recognized HH++ BDSM and displayed NaN in the Sim value). Perhaps due to server lags, the script did not wait for the Sim to appear and sorted by the Power value until the Sim was displayed.
I also found out the reason why the script stopped seeing opponents in the League. A bug has appeared in the latest versions of the script, and if the HH Leagues++ script is enabled with any game localization, then your script no longer sees opponents. I remember exactly that everything worked fine before. I started installing previous versions of the script and found that it normally recognizes opponents with English localization in version 5.35.7 and older. Starting with Add logs and be more specific for fight button #962 the script stopped working properly with HH Leagues++ enabled.
Even during a bug with Italian (as a result of which the script did not see HH++ BDSM and started attacking by the Power value before the Sim values appeared), I noticed that the script in log displayed 1,72M as 1720000, despite the fact that a comma was used in the fractional. Very strange.
I also came up with an idea for a trick on how to attack the most profitable opponents with Sim turned on, but without inverting the sort. Is it possible to use the formula 25 - player_sim
for each Sim value? (or 25.01 - player_sim, if the script will bug because of 0, if the player had his Sim equal to 25). And if your script can safely accept a comma in the Power value when multiplication is in progress, can it use this trick and simply multiply the Sim value by 100 to get rid of the fraction? Then the script will work with integer values. In combination with 25 - sim
, as well as multiplying by 100, and as a result, the script will work with these values in the same way as it worked with Power. I agree, it turns out some kind of crutch, but I think it should work.
I confirm, this part of the code breaks the script with HH Leagues++ enabled. In the most recent version, I returned the old line and the script works again with HH Leagues++ enabled. But only in English and Japanese localization, of course 😅
Thanks for your investigation. I just reverted this change.
The BDSM script can be not detected if the script runs after the HHAuto... This is what I mentioned above.
In this situation, there is no way I use the BDSM computation. I will have a look to use Sim from our script, but this is still in the todo list.
In this commit https://github.com/Roukys/HHauto/commit/15e90fd02cedc7b3f9ed048f4c7e10484938c4db I replace comma with dot. So it should supports other languages now. Tell me if it is not the case.
I may look in your idea with substraction. But if the script works in 5.36.2, I prefere look to bugs still not fixed....
@deuxge
In this commit 15e90fd I replace comma with dot. So it should supports other languages now. Tell me if it is not the case.
unfortunately this change doesn't work, everything also displays NaN in the log in all localization languages, except for English and Japanese. You can see for yourself by choosing absolutely any localization language, except for English and Japanese, only on these two localizations HHauto correctly reads values from Sim. I checked it in another, clean browser, where I reset all script settings, cookies and among the scripts there were only HHauto and HH++ BDSM.
It seems to me that it is worth trying to use the trick that I voiced earlier, because the script does not want to read Sim data in other localizations for some unknown reason, while Power, in the value of which there is a comma instead of a dot in all localizations except English and Japanese, but there are no reading problems with Power. It seems to me that everything is because there the script converts fractional numbers to integers, while Sim always remains fractional and when there is a point in the fractional, it can work, but when there is a comma in the fractional, the script doesn't work, although it allows multiplying by 1000000. Mystic.
First commit was for power, new one is for sim from HH++BDSM
For several days I checked the script and in most cases everything works correctly. There were sometimes cases when the classic Power was used instead of Sim, but this happened at those moments when the game server lagged (hence, the calculation of Sim in HH++ BDSM took longer than usual due to lags). But I'm not sure that anything can be done about this (if only to increase the pause before the attack so that the Sim has time to generate even when the game servers lag). But since your script can work correctly with Power before receiving Sim data, then in any case attacks occur against profitable opponents, which is definitely positive. Thanks a lot for your work
UPD
I forgot to additionally clarify that now attacks are always carried out in the form of 1 battle, even when there is more than enough energy and the opponent has unfinished battles more than one. I don’t know exactly at what point, but the script forgot how to do 2 and 3 battles with one attack.
The 2 times battle is not implemented. So it is expected.
The 3 times is. It looks at the league threshold, the league target (not to be promoted). Maybe if you have some logs, I can open a bug (You can hide the opponent name but keep the number of fights ^^)
I guess as we don't have any other comments from a week, we can close this one. For any issue found, please open a ticket ;).
I'm not sure that for such purposes it is advisable to create another ticket, but I will do it later. In this case, I close this ticket.
Today I noticed that there is an improvement in the HH++ BDSM script that changes
Power
toSim Results
. At the same time, the chances of winning on all opponents are displayed there quickly, almost instantly. Is there any way you can move this improvement into your script or upgrade the auto-attack behavior system so that your script readsSim Results
in first priority, whilePower
values take second priority if your script can't detectSim Results
?At the moment, this is a screenshot from a test server, where the number of opponents is much larger than on live servers, but when I opened the page, I had no problems waiting. In other words, HH++ BDSM has a very well implemented analogue of your old
PowerCalc
. It seems to me that it is worth using these developments to improve the algorithm for auto-attacking opponents.P.S. I want to additionally emphasize that at the moment the HH++ BDSM script is being developed by the developer zoop0kemon, who is a moderator on the official Kinkoid server. On this server, his script is displayed as approved by the developers themselves. In other words, KK does not interfere in any way with the functions that appear in HH++ BDSM, which is why it makes sense to make it possible to use certain functions from HH++ BDSM in your script