QUOTE(sickentide @ Apr 28 2020, 09:47)

i'm not sure what you're trying to do, but when i test your settings, they work as intended: casting imperil exactly once per keypress. if you want to use imperil continuously, you need to use Cast('Imperil') without the Impulse
I knew if I want to use imperil continuously, need to use Cast('Imperil') without the Impulse,
but that is not my mean.
(IMG:[
invalid]
style_emoticons/default/unsure.gif)
let me try to tell clear what I did:
1) clean the "local storage"
2) setup 1.3.2.0, and only change these at the code, others are all same as original script
CODE
// @match https://*.hentaiverse.org/*
turnDividers: true, // add horizontal row between turns
hoverShiftAction: "Impulse(Cast('Imperil'))", // alternate hover action when holding shift
3) enter GF
4) my operation and what happend:
[a] when I enter GF, mouse is outside the hover area, nothing happend, I think it's normal
[b.] push "shift" and holding it
[c] mouse go in the hover area, with still holding "shift"
[e]
first turn, Arcane Blow hit. (mouse still in the hover area, with still holding "shift")
[f] no stop,
second turn, imp hit. (mouse still in the hover area, with still holding "shift")
[g] no stop,
third turn, Arcane Blow hit. (mouse still in the hover area, with still holding "shift")
[h] no stop,
fourth turn, Arcane Blow hit. (mouse still in the hover area, with still holding "shift")
...
[i] mouse go out of the hover area, release "shift"
another operation and what happend:
[a] when I enter GF, mouse is outside the hover area, nothing happend, I think it's normal
[b.] push "shift" and holding it
[c] mouse go in the hover area, with still holding "shift", but this time, mouse go out of the hover area at once.(move in and move out very quickly)
[e]
first turn, Arcane Blow hit. (with still holding "shift")
[f] release "shift"
[g] push "shift" and holding it
[h] like [c], mouse move in and move out very quickly, with still holding "shift"
[i]
second turn, imp hit. (with still holding "shift")
[j] release "shift"
[k] push "shift" and holding it
[l] like [c], mouse move in and move out very quickly, with still holding "shift"
[m]
third turn, Arcane Blow hit.[n] release "shift"
[o] push "shift" and holding it
[p] like [c], mouse move in and move out very quickly, with still holding "shift"
[q]
fourth turn, imp hit. (with still holding "shift")
[r] release "shift"
...
I think it is not work as intended,
and it may should be:
[a] when I enter GF, mouse is outside the hover area, nothing happend
[b.] push "shift" and holding it
[c] mouse go in the hover area, with still holding "shift"
[e]
first turn, imp hit. (mouse still in the hover area, with still holding "shift")
[f] action stop (mouse still in the hover area, with still holding "shift")
[g] mouse go out of the hover area (still holding "shift")
[h] mouse go in the hover area, with still holding "shift"
[i]
second turn, imp hit. (mouse still in the hover area, with still holding "shift")
[j] action stop (mouse still in the hover area, with still holding "shift")
[k] mouse go out of the hover area (still holding "shift")
[l] mouse go in the hover area, with still holding "shift"
[m]
third turn, imp hit. (mouse still in the hover area, with still holding "shift")
[n] action stop (mouse still in the hover area, with still holding "shift")
[o] mouse go out of the hover area (still holding "shift")
...
[p] mouse go out of the hover area, release "shift"
maybe a little look like use "onmouseenter" instead of "onmouseover"...?
addEventListener('mouseenter', function)
addEventListener('mouseover', function)
Due to I don't know the rules very well, maybe this usage is not allowed? (IMG:[
invalid]
style_emoticons/default/unsure.gif)
***********************************************************************
and in my last post,QUOTE(3534 @ Apr 26 2020, 23:42)

Hi, sickentide. (IMG:[
invalid]
style_emoticons/default/smile.gif)
@1.3.2.0
setting:
...
I am trying to guess the reason of what happened in the code, so I add some 'console.log' and test.
and I think that here, there is a little strange,
actually, I am not very understand the code meaning at here (IMG:[
invalid]
style_emoticons/default/heh.gif)
CODE
function Impulse(action) {
return function() {
if ( done ) return;
impulse = action;
if ( interruptHover || interruptAlert || !monsters[target] || !monsters[target].hasAttribute('onclick') ) {
action(); done = true; impulse = false; }};}
here it is:
CODE
( interruptHover || interruptAlert || !monsters[target] || !monsters[target].hasAttribute('onclick') )
first,
due to
CODE
startRoundWithHover: true, // have hoverplay active at the beginning of each round
interruptHover = !cfg.startRoundWithHover;
"interruptHover" most of time is "false".and "interruptAlert" is meaning the sparked or low vitals or something danger,
so, "interruptAlert" most of time is "false", too.and then,
"!monsters[target]"
"!monsters[target].hasAttribute('onclick')"
these two is influence by "target",
and due to
CODE
function ClearTarget() { target = false; }
CODE
var cfg = {}, profile = JSON.parse(localStorage.HVmbp || '{ "p":0,"s1":0,"s2":0,"s3":0,"s4":0,"s5":0,"s6":0,"s7":0,"s8":0,"s9":0 }'),
bindings = [], gem = [], target = false, cursor = -1, interruptHover, interruptAlert = false, hovering = false, override = false, impulse = false,
CODE
function SetTarget(i) { return function() {
target = i;
if ( (cfg.hoverAction || override) && !interruptHover && !interruptAlert && monsters[target].hasAttribute('onclick') ) {
Hover(); }};}
CODE
function Disengage() { target = false; override = false; }
when "target" is "false", the "!monsters[target]" is "true", "!monsters[target].hasAttribute('onclick')" will be error.CODE
( interruptHover || interruptAlert || !monsters[target] || !monsters[target].hasAttribute('onclick') )
it become
CODE
( false || false || true || error )
though there is an "error", it still mean "true".
and then
CODE
function Impulse(action) {
return function() {
if ( done ) return;
impulse = action;
if ( interruptHover || interruptAlert || !monsters[target] || !monsters[target].hasAttribute('onclick') ) {
action(); done = true; impulse = false; }};}
here, most of time RUNCODE
action(); done = true; impulse = false;
continue to track,
if "target" need to be something but not "false",
here it is:
CODE
function SetTarget(i) { return function() {
target = i;
if ( (cfg.hoverAction || override) && !interruptHover && !interruptAlert && monsters[target].hasAttribute('onclick') ) {
Hover(); }};}
yeah, here:
CODE
target = i;
and the "SetTarget(i)" will run in those 3 places:
(1)
CODE
function CursorHover() { if ( cursor >= 0 ) SetTarget(cursor)(); }
this is used by bind(), like that
CODE
// Bind(KEY_RIGHT, CursorHover);\ -- Hover on selected monster, recommended use with clearRound = true.
(2)
CODE
function BarEngage(i, actions) {
return function() {
if ( !monsters[i].hasAttribute('onclick') ) return;
override = StrongestBar(actions);
SetTarget(i)(); };}
this is used by MonsterBar(), like that
CODE
// mobile settings
clearRound: false, // clear target and reset hoverAction at round transition, to avoid lingering taps and make monsterBar safer
spacedBar: false, // increase spacing of quickbar and monster bar
monsterBar: [], // add skill/spell icons next to monsters, for single use or tap to engage/tap elsewhere to disengage, single skills and spell rotations
(3)
CODE
function Monsters() {
var monster;
for ( var i = 0; i < monsters.length; i++ ) {
if ( (monster = monsters[i]) && monster.hasAttribute('onclick') ) {
var area = monster.querySelector('.btm' + cfg.hoverArea) || monster;
area.addEventListener('mouseout', ClearTarget, true);
area.addEventListener('mouseover', SetTarget(i), true);
monster.addEventListener('mousedown', HandleClick(i), true);
monster.addEventListener('contextmenu', function(e) { e.preventDefault(); });
monster.addEventListener('wheel', HandleWheel(i), true);
if ( cursor >= 0 ) Cursor();
if ( target === i && (cfg.hoverAction || override) && !interruptHover && !interruptAlert ) {
Hover(); }
if ( cfg.submitScans && monsterData.recent[i] === false ) {
monster.querySelector('.btm2').style.background = cfg.colours.scan; }
else if ( cfg.monsterKeywords && monsterData.highlight[i] ) {
monster.querySelector('.btm2').style.background = cfg.colours.monster; }
if ( (cfg.showMonsterHP || cfg.shortenHPbars) && monsterData.hp[i] ) {
var bar = monster.querySelector('img[src$="nbargreen.png"]'),
ratio = parseInt(bar.style.width) / 120;
if ( cfg.showMonsterHP && !cfg.quickbarBesideMonsters && !cfg.condenseLeft ) {
var div = monster.appendChild(document.createElement('div'));
div.className = 'monsterhp';
div.innerHTML = 'HP: ' + Math.round(ratio * monsterData.hp[i]).toLocaleString() + ' / ' + monsterData.hp[i].toLocaleString(); }
if ( cfg.shortenHPbars && monsterData.hp[i] < monsterData.hp[10] ) {
var factor = monsterData.hp[i] / monsterData.hp[10],
border = monster.querySelector('img[src$="nbarfg.png"]'),
bg = monster.querySelector('.chbd');
bar.style.width = Math.round(ratio * factor * 120) + 'px';
border.style.width = Math.round(factor * 120) + 'px';
border.style.height = '12px';
bg.style.width = Math.round(factor * 120) + 'px'; }}
if ( cfg.colours.stun || cfg.colours.imperil || cfg.colours.stunimperil ) {
var status = monster.querySelector('.btm6'),
stun = status.innerHTML.indexOf('wpn_stun.png') > -1,
imperil = status.innerHTML.indexOf('imperil.png') > -1;
if ( cfg.colours.stunimperil && stun && imperil ) {
monster.style.background = cfg.colours.stunimperil; }
else if ( cfg.colours.stun && stun ) {
monster.style.background = cfg.colours.stun; }
else if ( cfg.colours.imperil && imperil ) {
monster.style.background = cfg.colours.imperil; }}}}}
I think here is the key point,
CODE
hoverArea: 6, // part of the monster that activates hover
// 1: whole box, 2: icon, 3: name, 4: vitals, 6: status effects
CODE
function Monsters() {
var monster;
for ( var i = 0; i < monsters.length; i++ ) {
if ( (monster = monsters[i]) && monster.hasAttribute('onclick') ) {
var area = monster.querySelector('.btm' + cfg.hoverArea) || monster;
area.addEventListener('mouseout', ClearTarget, true);
area.addEventListener('mouseover', SetTarget(i), true);
when
hoverArea == 6
i == 0
RUN
CODE
monster = monsters[0]
then
RUN
CODE
var area = monster.querySelector('.btm' + 6) || monster;
after this,
area == monster.querySelector('.btm' + 6)
then
RUN
CODE
area.addEventListener('mouseover', SetTarget(i), true);
after this,
when mouse move
over the "hoverArea6",
SetTarget(0) will be runed,
CODE
function SetTarget(i) { return function() {
target = i;
if ( (cfg.hoverAction || override) && !interruptHover && !interruptAlert && monsters[target].hasAttribute('onclick') ) {
Hover(); }};}
after this,
target == 0;
"!monsters[target]" become "false",
"!monsters[target].hasAttribute('onclick')" become "false"so
CODE
( interruptHover || interruptAlert || !monsters[target] || !monsters[target].hasAttribute('onclick') )
it become
CODE
( false || false || false || false )
it mean "false".
and then
CODE
function Impulse(action) {
return function() {
if ( done ) return;
impulse = action;
if ( interruptHover || interruptAlert || !monsters[target] || !monsters[target].hasAttribute('onclick') ) {
action(); done = true; impulse = false; }};}
here, most of time NOT runCODE
action(); done = true; impulse = false;
***
Sorry for so long.........
Maybe...
DJNoni and uareader are saying the same problem?..
This post has been edited by 3534: Apr 28 2020, 12:17