Hi, sickentide. (IMG:[
invalid]
style_emoticons/default/smile.gif)
@1.3.2.0
setting:
CODE
turnDividers: true, // add horizontal row between turns
hoverShiftAction: "Impulse(Cast('Imperil'))", // alternate hover action when holding shift
when I holding shift and hover on the monster, it is not always cast Imperil,
it will become like this, much Arcane Blow and less Imperil:
QUOTE
Ether Tap restores 34 points of magic.
Your spike shield hits Bakorra for 228 points of wind damage.
Bakorra crits you for 1048 slashing damage.
Void Strike hits Bakorra for 2283 void damage.
Elec Strike hits Bakorra for 1865 elec damage.
Arcane Blow hits Bakorra for 3883 void damage.
Your spike shield hits Bakorra for 210 points of wind damage.
Bakorra hits you for 968 slashing damage.
You gain the effect Ether Tap.
Void Strike hits Bakorra for 2027 void damage.
Elec Strike hits Bakorra for 2189 elec damage.
Arcane Blow crits Bakorra for 7105 void damage.
Your spike shield hits Bakorra for 200 points of wind damage.
Bakorra hits you for 921 slashing damage.
Bakorra parries your attack.
Cooldown expired for Cure
Bakorra gains the effect Turbulent Air.
Your spike shield hits Bakorra for 894 points of wind damage.
Bakorra uses Diurnal Butterflies, and crits you for 4120 slashing damage
Your spirit shield absorbs 850 points of damage from the attack into 12 points of spirit damage.
Bakorra gains the effect Coalesced Mana.
Bakorra gains the effect Imperiled.
You cast Imperil.
You evade the attack from Bakorra.
Void Strike hits Bakorra for 1835 void damage.
Elec Strike hits Bakorra for 1793 elec damage.
Arcane Blow crits Bakorra for 5569 void damage.
so I try to read the code,
still @1.3.2.0
setting:
CODE
turnDividers: true, // add horizontal row between turns
clickRight: "Impulse(Cast('Imperil'))",
hoverShiftAction: "Impulse(Cast('Imperil'))", // alternate hover action when holding shift
code change (just add console.log *5 ):
CODE
function Impulse(action) {
return function() {
if ( done ) return;
impulse = action;
console.log('interruptHover:'+interruptHover); //add here
console.log('interruptAlert:'+interruptAlert); //add here
console.log('!monsters[target]:'+target+':'+!monsters[target]); //add here
console.log(target+':'+!monsters[target].hasAttribute('onclick')); //add here
console.log('-'); //add here
if ( interruptHover || interruptAlert || !monsters[target] || !monsters[target].hasAttribute('onclick') ) {
action(); done = true; impulse = false; }};}
test:
1) right click on the monster A (out of hover area):
CODE
interruptHover:false
interruptAlert:false
!monsters[target]:false:true
Uncaught TypeError: Cannot read property 'hasAttribute' of undefined
no imp no Arcane Blow, nothing happened.
2) refresh and try the "hoverShiftAction", holding shift and hover on the monster B.
CODE
interruptHover:false
interruptAlert:false
!monsters[target]:1:false
1:false
and Arcane Blow hit
go on holding shift and hover on the monster B.
console.log gived nothing,
and imp cast.
go on holding shift and hover on the monster B.
console.log gived nothing,
and Arcane Blow hit.
go on holding shift and hover on the monster B.
console.log gived nothing,
and Arcane Blow hit.
go on holding shift and hover on the monster B.
console.log gived nothing,
and Arcane Blow hit.
...
3) refresh and try the "hoverShiftAction", holding/release shift and hover on the monster B.
CODE
interruptHover:false
interruptAlert:false
!monsters[target]:1:false
1:false
and Arcane Blow hit
release shift
continue on holding shift and hover on the monster B.
console.log gived nothing,
and imp cast.
release shift
continue on holding shift and hover on the monster B.
CODE
interruptHover:false
interruptAlert:false
!monsters[target]:1:false
1:false
and Arcane Blow hit
release shift
continue on holding shift and hover on the monster B.
console.log gived nothing,
and imp cast.
release shift
continue on holding shift and hover on the monster B.
CODE
interruptHover:false
interruptAlert:false
!monsters[target]:1:false
1:false
and Arcane Blow hit
...
..............................................................................................................................
I guess it is ...(?)
1)
target == false
so,
!monsters[target].hasAttribute('onclick')
gived the "Uncaught TypeError"
2)
Script RUN
CODE
document.addEventListener('keydown', handleKeys, true);
push shift
release == false
CODE
handleKeys(e) {...}
hover monster B
CODE
area.addEventListener('mouseover', SetTarget(i), true);
i==1
CODE
function SetTarget(i) { return function() {
target = i;
if ( (cfg.hoverAction || override) && !interruptHover && !interruptAlert && monsters[target].hasAttribute('onclick') ) {
Hover(); }};}
impulse==false
CODE
function Hover() {
if ( hovering ) return;
hovering = true;
if ( impulse ) {
impulse();
done = true;
impulse = false; }
else if ( override ) {
override(); }
else if ( shiftHeld && cfg.hoverShiftAction ) {
cfg.hoverShiftAction(); }
else if ( ctrlHeld && cfg.hoverCtrlAction ) {
cfg.hoverCtrlAction(); }
else if ( altHeld && cfg.hoverAltAction ) {
cfg.hoverAltAction(); }
else {
cfg.hoverAction(); }
monsters[target].click(); }
CODE
cfg.hoverShiftAction();
CODE
hoverShiftAction: "Impulse(Cast('Imperil'))",
done==false
interruptHover || interruptAlert || !monsters[target] || !monsters[target].hasAttribute('onclick') == false
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; }};}
impulse == Cast('Imperil')
CODE
Hover() {...
monsters[target].click();}
Arcane Blow hit
next turn
CODE
area.addEventListener('mouseover', SetTarget(i), true);
CODE
function SetTarget(i) { return function() {
target = i;
if ( (cfg.hoverAction || override) && !interruptHover && !interruptAlert && monsters[target].hasAttribute('onclick') ) {
Hover(); }};}
impulse == Cast('Imperil')
CODE
function Hover() {
if ( hovering ) return;
hovering = true;
if ( impulse ) {
impulse();
done = true;
impulse = false; }
else if ( override ) {
override(); }
else if ( shiftHeld && cfg.hoverShiftAction ) {
cfg.hoverShiftAction(); }
else if ( ctrlHeld && cfg.hoverCtrlAction ) {
cfg.hoverCtrlAction(); }
else if ( altHeld && cfg.hoverAltAction ) {
cfg.hoverAltAction(); }
else {
cfg.hoverAction(); }
monsters[target].click(); }
done == true
impulse == false
and imp hit.
next turn
CODE
area.addEventListener('mouseover', SetTarget(i), true);
CODE
function SetTarget(i) { return function() {
target = i;
if ( (cfg.hoverAction || override) && !interruptHover && !interruptAlert && monsters[target].hasAttribute('onclick') ) {
Hover(); }};}
impulse == false
CODE
function Hover() {
if ( hovering ) return;
hovering = true;
if ( impulse ) {
impulse();
done = true;
impulse = false; }
else if ( override ) {
override(); }
else if ( shiftHeld && cfg.hoverShiftAction ) {
cfg.hoverShiftAction(); }
else if ( ctrlHeld && cfg.hoverCtrlAction ) {
cfg.hoverCtrlAction(); }
else if ( altHeld && cfg.hoverAltAction ) {
cfg.hoverAltAction(); }
else {
cfg.hoverAction(); }
monsters[target].click(); }
CODE
cfg.hoverShiftAction();
CODE
hoverShiftAction: "Impulse(Cast('Imperil'))",
done == true
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; }};}
CODE
Hover() {...
monsters[target].click();}
Arcane Blow hit
next turn
impulse == false
done == true
like the last turn, Arcane Blow hit
...
3)
Script RUN
as same as 2) first turn
CODE
document.addEventListener('keydown', handleKeys, true);
push shift
release == false
CODE
handleKeys(e) {...}
hover monster B
CODE
area.addEventListener('mouseover', SetTarget(i), true);
i==1
CODE
function SetTarget(i) { return function() {
target = i;
if ( (cfg.hoverAction || override) && !interruptHover && !interruptAlert && monsters[target].hasAttribute('onclick') ) {
Hover(); }};}
impulse==false
CODE
function Hover() {
if ( hovering ) return;
hovering = true;
if ( impulse ) {
impulse();
done = true;
impulse = false; }
else if ( override ) {
override(); }
else if ( shiftHeld && cfg.hoverShiftAction ) {
cfg.hoverShiftAction(); }
else if ( ctrlHeld && cfg.hoverCtrlAction ) {
cfg.hoverCtrlAction(); }
else if ( altHeld && cfg.hoverAltAction ) {
cfg.hoverAltAction(); }
else {
cfg.hoverAction(); }
monsters[target].click(); }
CODE
cfg.hoverShiftAction();
CODE
hoverShiftAction: "Impulse(Cast('Imperil'))",
done==false
interruptHover || interruptAlert || !monsters[target] || !monsters[target].hasAttribute('onclick') == false
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; }};}
impulse == Cast('Imperil')
CODE
Hover() {...
monsters[target].click();}
Arcane Blow hit
next turn
CODE
document.addEventListener('keyup', handleKeyup, true);
release shift
CODE
function handleKeyup(e) {
shiftHeld = e.shiftKey;
ctrlHeld = e.ctrlKey;
altHeld = e.altKey;
override = false;
release = true;
if ( cfg.hoverAutoresume ) {
interruptHover = false;
if ( (cfg.hoverAction || override) && !interruptAlert && monsters[target] && monsters[target].hasAttribute('onclick') ) {
Hover(); }}
}
release == true
push shift and hover
CODE
document.addEventListener('keydown', handleKeys, true);
CODE
function handleKeys(e) {
if ( release ) {
done = false;
release = false; }
saveKeyDown();
shiftHeld = e.shiftKey;
ctrlHeld = e.ctrlKey;
altHeld = e.altKey;
var bind;
for ( var i = 0; i < bindings.length; i++ ) {
bind = bindings[i];
if ( e.keyCode == bind.keyCode && bind.modifier(e) ) {
bind.action();
return; }}
loadKeyDown(); }
done == false
release == false
CODE
area.addEventListener('mouseover', SetTarget(i), true);
CODE
function SetTarget(i) { return function() {
target = i;
if ( (cfg.hoverAction || override) && !interruptHover && !interruptAlert && monsters[target].hasAttribute('onclick') ) {
Hover(); }};}
impulse == Cast('Imperil')
CODE
function Hover() {
if ( hovering ) return;
hovering = true;
if ( impulse ) {
impulse();
done = true;
impulse = false; }
else if ( override ) {
override(); }
else if ( shiftHeld && cfg.hoverShiftAction ) {
cfg.hoverShiftAction(); }
else if ( ctrlHeld && cfg.hoverCtrlAction ) {
cfg.hoverCtrlAction(); }
else if ( altHeld && cfg.hoverAltAction ) {
cfg.hoverAltAction(); }
else {
cfg.hoverAction(); }
monsters[target].click(); }
done == true
impulse == false
and imp hit.
next turn
CODE
document.addEventListener('keyup', handleKeyup, true);
release shift
CODE
function handleKeyup(e) {
shiftHeld = e.shiftKey;
ctrlHeld = e.ctrlKey;
altHeld = e.altKey;
override = false;
release = true;
if ( cfg.hoverAutoresume ) {
interruptHover = false;
if ( (cfg.hoverAction || override) && !interruptAlert && monsters[target] && monsters[target].hasAttribute('onclick') ) {
Hover(); }}
}
release == true
push shift and hover
CODE
document.addEventListener('keydown', handleKeys, true);
CODE
function handleKeys(e) {
if ( release ) {
done = false;
release = false; }
saveKeyDown();
shiftHeld = e.shiftKey;
ctrlHeld = e.ctrlKey;
altHeld = e.altKey;
var bind;
for ( var i = 0; i < bindings.length; i++ ) {
bind = bindings[i];
if ( e.keyCode == bind.keyCode && bind.modifier(e) ) {
bind.action();
return; }}
loadKeyDown(); }
done == false
release == false
CODE
area.addEventListener('mouseover', SetTarget(i), true);
CODE
function SetTarget(i) { return function() {
target = i;
if ( (cfg.hoverAction || override) && !interruptHover && !interruptAlert && monsters[target].hasAttribute('onclick') ) {
Hover(); }};}
impulse == false
CODE
function Hover() {
if ( hovering ) return;
hovering = true;
if ( impulse ) {
impulse();
done = true;
impulse = false; }
else if ( override ) {
override(); }
else if ( shiftHeld && cfg.hoverShiftAction ) {
cfg.hoverShiftAction(); }
else if ( ctrlHeld && cfg.hoverCtrlAction ) {
cfg.hoverCtrlAction(); }
else if ( altHeld && cfg.hoverAltAction ) {
cfg.hoverAltAction(); }
else {
cfg.hoverAction(); }
monsters[target].click(); }
CODE
cfg.hoverShiftAction();
CODE
hoverShiftAction: "Impulse(Cast('Imperil'))",
done==false
interruptHover || interruptAlert || !monsters[target] || !monsters[target].hasAttribute('onclick') == false
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; }};}
impulse == Cast('Imperil')
CODE
Hover() {...
monsters[target].click();}
Arcane Blow hit
next turn
like the last imp turn, imp hit
...
*****************
is it a bug?
or I make something bad?
(IMG:[
invalid]
style_emoticons/default/unsure.gif)
This post has been edited by 3534: Apr 27 2020, 09:24