|
|
|
HV Script Thread, Discuss your creations. Includes guidelines and infos for script creation (2020-02-28 upd) |
|
Jul 4 2017, 01:38
|
na-mi-da
Newcomer
Group: Members
Posts: 44
Joined: 19-June 14
|
Has anyone made an updated mod that changes the hp bar of monsters with how much they have like in reloader? Or at least displays the number on the hp bar?
|
|
|
Jul 4 2017, 02:12
|
Superlatanium
Group: Gold Star Club
Posts: 7,577
Joined: 27-November 13
|
QUOTE(na-mi-da @ Jul 3 2017, 23:38) Has anyone made an updated mod that changes the hp bar of monsters with how much they have like in reloader? Or at least displays the number on the hp bar? Scroll up, one is HV Battle Reloaded with resizeHPBars True
|
|
|
|
|
|
Jul 4 2017, 04:20
|
ThunderAlways
Group: Gold Star Club
Posts: 463
Joined: 7-June 13
|
QUOTE(sigo8 @ Jul 4 2017, 05:43) XHR isn't faster than Ajax, They're different parts of the same thing. Saying one is better than the other is nonsense, like say a sword is better than Kendo.
QUOTE XMLHttpRequest in the raw browser object that jQuery wraps into a more usable and simplified form and cross browser consistent functionality. from [ stackoverflow.com] stackoverflow. And encapsulation always make code slower. QUOTE(End Of All Hope @ Jul 4 2017, 02:28) In simple terms, the script lol posted, makes your round advance without reloading the page. Nothing related to ajax being slower than xhr. Only an entire page reload (round change) replaced with ajax reload. Stop.
His script still replace large amount of innerHTML text with innerHTML text, which I believe is a problem now. to transfer battle data, json is enough at all, and only data needs replacing in page. Currently hv use lots of innerHTML replacement to update battle state, I guess thy Tenboro does this is to reduce the change of the server.
|
|
|
|
|
|
Jul 4 2017, 04:30
|
sigo8
Group: Gold Star Club
Posts: 3,450
Joined: 9-November 11
|
QUOTE(atashiyuki @ Jul 3 2017, 20:20) from [ stackoverflow.com] stackoverflow. And encapsulation always make code slower. Neither the old reloader script nor 0.85 use jquery, both use the native XHR objects directly.
|
|
|
|
|
|
Jul 4 2017, 04:38
|
ThunderAlways
Group: Gold Star Club
Posts: 463
Joined: 7-June 13
|
QUOTE(sigo8 @ Jul 4 2017, 10:30) Neither the old reloader script nor 0.85 use jquery, both use the native XHR objects directly.
Or maybe I used a strange version of reloader... CODE $('#LoadingText').show(); function SubmitAction() { // Prevent a display glitch when using an item unsafeWindow.battle.toggle_default_pane();
if (!semaphore) { semaphore = true;
// Selectively replace elements on the screen $('#LoadingText').show(); var loadStart = (new Date()).getTime(); $.ajax({ type: 'POST', url: '', data: $('#battleform > input').serialize() }) .done(function(data) {.......
|
|
|
Jul 4 2017, 05:17
|
Muddybug
Group: Gold Star Club
Posts: 463
Joined: 28-March 17
|
Ok, so what's the trick to get Monsterbation to run on Firefox-like browsers?
thx in advance.
|
|
|
Jul 4 2017, 06:45
|
friggo
Group: Gold Star Club
Posts: 2,134
Joined: 9-October 14
|
QUOTE(Superlatanium @ Jun 28 2017, 11:00)
Percentile_Ranges_1.2.1.user.js.txt ( 16.24k )
Number of downloads: 13830This script now properly calculates forged values; the error is now on the order of 0.01-0.03 rather than up to 10%. Thanks to Scremaz for the data. Possible bug: Cotton pieces with "Curse-weaver" and "Earth-walker" suffixes don't display values properly. Getting these messages: QUOTE no htmlname for Prof no match for (item name)
|
|
|
|
|
|
Jul 4 2017, 13:41
|
Usagi =
Group: Gold Star Club
Posts: 2,923
Joined: 29-October 13
|
QUOTE(atashiyuki @ Jul 4 2017, 10:20) His script still replace large amount of innerHTML text with innerHTML text, which I believe is a problem now. to transfer battle data, json is enough at all, and only data needs replacing in page. Currently hv use lots of innerHTML replacement to update battle state, I guess thy Tenboro does this is to reduce the change of the server.
I remember TenB mentioning that this is just the first pass and there will be further improvements to the way objects are replaced in the future. Maybe slimmer JSONs. As for my script, from my testing I think it probably saves around 300ms per round due to not having to rebuilt the page and also completely eliminates flashing.
|
|
|
|
|
|
Jul 4 2017, 14:53
|
hc br
Group: Catgirl Camarilla
Posts: 3,684
Joined: 18-October 15
|
QUOTE(sickentide @ Jun 29 2017, 01:39)
HentaiverseMonsterbation.1.1.2.1.user.js.zip ( 8.59k )
Number of downloads: 240features: - cooldowns
- move player effect to above monsters
- effect durations, including stacks
- change background or quickbar colour according to alert conditions
- hide battle log
- skip end of round popup, unless you want to stop at battle end or on equipment drop
- quickbar extender, including gem icon
- bind actions to perform on monsters to mouse buttons and wheel
- hoverplay, both for melee and spell rotation, with option to stop under conditions like spark, channelling etc.
- key bindings
- support for default and custom fonts
- drop tracker
- round/turn/speed counter
thanks to FiniteA, sigo8 and simrock87 for the parts of their code that i have used [attachembed=105204] Line 32 CODE quickbarExtend = [ 1,'ikey_1','ikey_2','ikey_3','ikey_4','ikey_5','ikey_6','ikey_10','ikey_11','ikey_12','ikey_s1','ikey_s2','ikey_s3','ikey_s4','ikey_s5','ikey_n1' ], This post has been edited by hc br: Jul 4 2017, 14:55
|
|
|
|
|
|
Jul 4 2017, 16:33
|
manga522
Group: Gold Star Club
Posts: 517
Joined: 2-January 17
|
QUOTE // ==UserScript== // @name HV - Ignore Flicker // @namespace tatarime // @description Ignore: effect expire // @include https://hentaiverse.org/*// @version 0.1 // ==/UserScript== if (document.getElementById('togpane_log')) { var css = document.createElement("style"); css.innerHTML = ".bte > img, .btm6 > img{opacity: 1!important}"; document.getElementsByTagName('head')[0].appendChild(css); } could some one code master fix this please ? no function with 0.85 (IMG:[ invalid] style_emoticons/default/blush.gif)
|
|
|
|
|
|
Jul 4 2017, 17:25
|
simrock87
Group: Members
Posts: 647
Joined: 12-June 11
|
QUOTE(LOL50015 @ Jul 4 2017, 11:41) As for my script, from my testing I think it probably saves around 300ms per round due to not having to rebuilt the page and also completely eliminates flashing.
Page render times were about 7-12ms for me when i checked during .84, you just notice the flicker as the bg color is white instead of beige, with beige as bg color the flicker isn't nearly as noticeable. The downside of making rounds also use xhr is that you're pushing off garbage collection and if a script has some leaks they will then keep building. Even with the DOMContentLoaded you're throwing, there are some practical issues with scripts as they assume that they start from a blank state, so you possibly may get some multiple initializations. (forgot to multi-quote ...) Regarding the battle script: Yes, they are minified/uglified and a pain to read, but the original usually is pretty readable it just gets cut down to save on resources (simply traffic and how long a socket is blocked during transfer, smaller files -> quicker transfer). If you're aware what some function is supposed to be doing it's still quite easy to decipher. QUOTE His script still replace large amount of innerHTML text with innerHTML text, which I believe is a problem now. to transfer battle data, json is enough at all, and only data needs replacing in page. Currently hv use lots of innerHTML replacement to update battle state, I guess thy Tenboro does this is to reduce the change of the server. Also direct html makes the replacement easier and you need to do less js-fu to delete/(re)create/update elements. Also pretty sure the innerhtml replacement works in more browsers, or at least with less polyfills than something more advanced. As a side-effect it makes bot-development a bit more annoying as you need to parse the html with all stuff already processed instead of just getting the raw data you'd want from a REST interface.
|
|
|
|
|
|
Jul 4 2017, 17:39
|
Taylia
Newcomer
Group: Gold Star Club
Posts: 35
Joined: 8-March 16
|
QUOTE(atashiyuki @ Jul 4 2017, 12:20) His script still replace large amount of innerHTML text with innerHTML text, which I believe is a problem now. to transfer battle data, json is enough at all, and only data needs replacing in page. Currently hv use lots of innerHTML replacement to update battle state, I guess thy Tenboro does this is to reduce the change of the server.
It's accepted wisdom that constructing* a string in javascript and replacing the innerHTML is faster than manipulating the DOM. I've certainly seen this in updating table rows and my expectation is if Tenboro sent the full state in JSON and then each of the text/hp bar nodes was individually updated with the information from the exchanged JSON, the resultant script would be significantly slower than the current bulk-replacement of the contents of the enclosing element and triggering a single re-render/re-flow/re-paint. There might be some savings to use an incremental JSON update on the quickbar and buffs, but the innerHTML replacement for the monsters is almost certainly faster. *related note, apparently V8 now does "a" + "b" + ... + "z" faster than ["a", ..., "z"].join('') (IMG:[ invalid] style_emoticons/default/blink.gif)
|
|
|
|
|
|
Jul 4 2017, 18:07
|
Sapo84
Group: Gold Star Club
Posts: 3,332
Joined: 14-June 09
|
QUOTE(Taylia @ Jul 4 2017, 17:39) It's accepted wisdom that constructing* a string in javascript and replacing the innerHTML is faster than manipulating the DOM. I've certainly seen this in updating table rows and my expectation is if Tenboro sent the full state in JSON and then each of the text/hp bar nodes was individually updated with the information from the exchanged JSON, the resultant script would be significantly slower than the current bulk-replacement of the contents of the enclosing element and triggering a single re-render/re-flow/re-paint. There might be some savings to use an incremental JSON update on the quickbar and buffs, but the innerHTML replacement for the monsters is almost certainly faster.
It's also significantly slower to generate the HTML server-side vs just sending a JSON with the new raw data (and Tenboro is paying for the server resources). It's also slower to transfer more data via HTTP (and even slower with HTTPS). And how much would it take for a modern browser to update 60 DOM Elements (I don't think it will ever be more than ~60 elements to update)? 5ms with an old pc? It makes no difference whatsoever unless one is playing on something like IE7 (not like HV works with IE7). The only reason it's still setting the innerHTML is because it would have been more complicated to just move everything to raw data + DOM manipulation.
|
|
|
|
|
|
Jul 4 2017, 18:35
|
Mahiro-kyun
Group: Gold Star Club
Posts: 343
Joined: 8-May 12
|
QUOTE(manga522 @ Jul 4 2017, 17:33) could some one code master fix this please ? no function with 0.85 (IMG:[ invalid] style_emoticons/default/blush.gif) This should work, I think. CODE // ==UserScript== // @name HV - Ignore Flicker // @namespace tatarime // @description Ignore: effect expire // @match *://*.hentaiverse.org/* // @version 0.85 // ==/UserScript==
if (document.getElementById('pane_log')) { var css = document.createElement("style"); css.innerHTML = ".btm6 > img, #pane_effects > img{opacity: 1!important}"; document.head.appendChild(css); }
|
|
|
|
|
|
Jul 4 2017, 19:01
|
manga522
Group: Gold Star Club
Posts: 517
Joined: 2-January 17
|
QUOTE(Mahiro-kyun @ Jul 4 2017, 18:35) This should work, I think. CODE // ==UserScript== // @name HV - Ignore Flicker // @namespace tatarime // @description Ignore: effect expire // @match *://*.hentaiverse.org/* // @version 0.85 // ==/UserScript==
if (document.getElementById('pane_log')) { var css = document.createElement("style"); css.innerHTML = ".btm6 > img, #pane_effects > img{opacity: 1!important}"; document.head.appendChild(css); } great thanks very much (IMG:[ invalid] style_emoticons/default/happy.gif) it's really help me out there if something i can do for you just call me (IMG:[ invalid] style_emoticons/default/wink.gif)
|
|
|
|
|
|
Jul 5 2017, 01:30
|
Usagi =
Group: Gold Star Club
Posts: 2,923
Joined: 29-October 13
|
QUOTE(simrock87 @ Jul 4 2017, 23:25) Page render times were about 7-12ms for me when i checked during .84, you just notice the flicker as the bg color is white instead of beige, with beige as bg color the flicker isn't nearly as noticeable. The downside of making rounds also use xhr is that you're pushing off garbage collection and if a script has some leaks they will then keep building. Even with the DOMContentLoaded you're throwing, there are some practical issues with scripts as they assume that they start from a blank state, so you possibly may get some multiple initializations.
I used a ping script to calculate time between turns and while normally I get ~350ms, on loading a new round I get ~600ms. Well, even reloader didn't work with all existing script right off the bat. This post has been edited by LOL50015: Jul 5 2017, 01:31
|
|
|
|
|
|
Jul 5 2017, 01:46
|
Scremaz
Group: Gold Star Club
Posts: 24,304
Joined: 18-January 07
|
QUOTE(LOL50015 @ Jul 5 2017, 01:30) Well, even reloader didn't work with all existing script right off the bat.
progress comes with mistakes. btw, updates on the .85 hovering. involved/interested coders may want to check post #2 on that thread
|
|
|
|
|
|
Jul 5 2017, 08:14
|
ThunderAlways
Group: Gold Star Club
Posts: 463
Joined: 7-June 13
|
QUOTE(Taylia @ Jul 4 2017, 23:39) It's accepted wisdom that constructing* a string in javascript and replacing the innerHTML is faster than manipulating the DOM. I've certainly seen this in updating table rows and my expectation is if Tenboro sent the full state in JSON and then each of the text/hp bar nodes was individually updated with the information from the exchanged JSON, the resultant script would be significantly slower than the current bulk-replacement of the contents of the enclosing element and triggering a single re-render/re-flow/re-paint. There might be some savings to use an incremental JSON update on the quickbar and buffs, but the innerHTML replacement for the monsters is almost certainly faster. *related note, apparently V8 now does "a" + "b" + ... + "z" faster than ["a", ..., "z"].join('') (IMG:[ invalid] style_emoticons/default/blink.gif) you are right but it's not what I'm talking about. for modifying tables, especially create large amount of new rows, directly modify innerHTML can be much faster. This may avoids lots of JS function calls, use more native ways to generate the elements and attach it to certain node. but all the child elements was fully destroyed and regenerated in this way. this is not always a must, especially when the elements inside are heavy and does only small change. for monster pane, each turn only hp, mp, sp and buffs needs refreshing, I believe simply change the values should be much more faster than remove the elements, clean, parse the html text and construct those elements, add event listeners, finally attach them to document. Each moster's html text has about 1k bytes length, and 1K for effect pane, 4K for quick bar, 4K for vatals/skills. this is really not a must, at least skills and buffs's descriptions are not a must.
|
|
|
|
|
|
Jul 5 2017, 13:44
|
sickentide
Group: Catgirl Camarilla
Posts: 1,355
Joined: 31-August 10
|
stopOnBuffsExpiring is back in, there is now a setting to change or disable individual alert colours, MonsterAction has been replaced with HoverAction which accomplishes the same while being more user-friendly, and it should be compatible with LOL50015's ajax round advance script
HentaiverseMonsterbation.1.1.3.user.js.zip ( 8.77k )
Number of downloads: 160This post has been edited by sickentide: Jul 5 2017, 15:37
|
|
|
Jul 5 2017, 14:48
|
adz
Group: Members
Posts: 170
Joined: 19-June 15
|
As of today, no scripts are working for me in battle for HV. I'm using Chrome with Tampermonkey. All Scripts meant for Bazaar, Forge etc. are still working fine.
The issue does not occur with Firefox.
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
|
|
|
|
|