Welcome Guest ( Log In | Register )

291 Pages V « < 200 201 202 203 > »   
Reply to this topicStart new topic
> HV Script Thread, Discuss your creations. Includes guidelines and infos for script creation (2020-02-28 upd)

 
post Jun 24 2017, 16:02
Post #4008
boulay



Noob
********
Group: Gold Star Club
Posts: 2,675
Joined: 27-June 11
Level 500 (Godslayer)


One done (IMG:[invalid] style_emoticons/default/faint.gif)

HV Dark, v1.4

see below

Changelog:
Fixed > everything related to HV 0.85
added > grey hp bar when using Spark of Life
added > alternative design for said bars, didn't like the new ones (IMG:[invalid] style_emoticons/default/tongue.gif)
added > a bit of code to fit sickentide's script (mainly duration readability)
retired > bits of code related to pre-0.85 scripts, as they're all broken anyway
retired > temporarily: HV Dark Lite NoScript, I need to rework it

Do tell me if something isn't displaying properly, I'll work on it asap.


probably going to fix deep sea next...

This post has been edited by boulay: Jun 24 2017, 16:21
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 16:12
Post #4009
FabulousCupcake



Casual Poster
****
Group: Gold Star Club
Posts: 497
Joined: 15-April 14
Level 451 (Dovahkiin)


CODE

// ==UserScript==
// @name         HV | Chain Attack
// @namespace    http://fabulous.cupcake.jp.net
// @version      0.1
// @description  Keep attacking as long as you keep hovering on the monster
// @author       FabulousCupcake
// @match        https://hentaiverse.org/?s=Battle&ss=ar&page=2
// @grant        unsafeWindow
// @run-at       document-end
// ==/UserScript==

function getMonsterUnderCursor(X, Y) {
    var el = document.elementFromPoint(X, Y);
    var result = false;

    // Check `el` and iteratively its parents until we hit body or found monster
    while(!result) {
        if(el.nodeName.toLowerCase() === 'body') break;
        result = ( el.id.match('mkey') ? el : false );
        el = el.parentElement;
    }

    return result;
}

(function() {
    'use strict';
    
    let X, Y;
    document.addEventListener("mousemove", (e) => { X = e.pageX; Y = e.pageY; });
    
    
    function chain_commit(index) {
        const el = getMonsterUnderCursor(X, Y);
        if (!el) return;
        if (!el.onclick) return;
        
        const id = el.id.substr(-1);
        unsafeWindow.battle.commit_target(id);
    }
    
    
    const logs = document.querySelector("#textlog > tbody");
    const config = { childList: true };
    const observer = new MutationObserver( mutations => {
        chain_commit();
    });
    observer.observe(logs, config);
    
})();


Whoever wants to modify or extend it (like, start attacking immediately when you hover, stop attacking Spark of Life triggered, or use spell instead of attack), feel free to do so ¯\_(ツ)_/¯
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 16:18
Post #4010
Juggernaut Santa



Living in HV 0.83 until Tenboro adds the Tower to Persistent
***********
Group: Gold Star Club
Posts: 11,150
Joined: 26-April 12
Level 500 (Ponyslayer)


QUOTE(boulay @ Jun 24 2017, 16:02) *
snip


Is Lite supposed to be unreadable? (IMG:[invalid] style_emoticons/default/huh.gif)

Attached Image

The "proper" one is fine.

Except for the fact that in battle every round blinks back to the normal colors before reapplying the theme (IMG:[invalid] style_emoticons/default/wacko.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 16:19
Post #4011
boulay



Noob
********
Group: Gold Star Club
Posts: 2,675
Joined: 27-June 11
Level 500 (Godslayer)


QUOTE(End Of All Hope @ Jun 24 2017, 16:18) *

Is Lite supposed to be unreadable? (IMG:[invalid] style_emoticons/default/huh.gif)

Attached Image

The "proper" one is fine.

Except for the fact that in battle every round blinks back to the normal colors before reapplying the theme (IMG:[invalid] style_emoticons/default/wacko.gif)

nope (IMG:[invalid] style_emoticons/default/faint.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 16:20
Post #4012
Sapo84



Deus lo vult
********
Group: Gold Star Club
Posts: 3,332
Joined: 14-June 09
Level 500 (Ponyslayer)


QUOTE(Sapo84 @ Jun 24 2017, 15:24) *

99% my last (public) update on this

Yeah, sure.

NOTE: Tested on Firefox 48.0.2 only

Hoverplay + spell rotation + advance round + hide battle log + right click heal + disable hover on HP, MP and SP limit
Since a imperil script already exists it should cover the basic mage functionality

Everyone, feel free to take it and modify the hell out of it (probably if integrated with FabulousCupcake's code it should work ok with Chrome)

CODE
// ==UserScript==
// @name        MouseMagelee 0.85
// @namespace   hentaiverse.org
// @match       *://*.hentaiverse.org/*
// @run-at      document-end
// @grant       none
// ==/UserScript==

// ***THANKS***
// sickentide (HV No Popup)
// sigo8 (Reloader Shim)

// SETTINGS
var hideLog = true;
var defaultAction = [153,152,151]; //0 for melee
var minHP = 0.35;
var minMP = 0.2;
var minSP = 0.3;
var rightClick = [311,313];


var log = document.querySelector('#textlog > tbody');
var paneCompletion = document.getElementById('pane_completion');

function canCast(id){
    var el = document.getElementById(id);
    return !!el && el.hasAttribute('onclick');
}
function setSpellAttack(id) {
    var caller = document.getElementById(id);
    window.battle.lock_action(caller, 1, 'magic', id);
    window.battle.set_hostile_skill(id);
}

function castSupport(id) {
    var caller = document.getElementById(id);
    window.battle.lock_action(caller, 1, 'magic', id);
    window.battle.set_friendly_skill(id);
    window.battle.touch_and_go();
}

function runRightClickSpell() {
    for (var i = 0; i < rightClick.length; i++) {
        if (canCast(rightClick[i])) {
            castSupport(rightClick[i]);
            return;
        }
    }
}

function reloadedEvent() {
    if(document.querySelector('#vbh img').width < 496*minHP) return;
    if(document.querySelector('#vbm img').width < 207*minMP) return;
    if(document.querySelector('#vbs img').width < 207*minSP) return;

    if(defaultAction){
        for (var i = 0; i < defaultAction.length; i++) {
            if (canCast(defaultAction[i])) {
                setSpellAttack(defaultAction[i]);
                break;
            }
        }
    }

    mpane = document.getElementById('pane_monster');
    var m = mpane.getElementsByClassName("btm1");

    for (var j = 0; j < m.length; j++) {
        if (m[j].hasAttribute('onclick')) {
            m[j].setAttribute('onmouseover', m[j].getAttribute('onclick'));
        }
    }
}
function roundEndEvent() {
    var btcp = document.getElementById('btcp');
    if (btcp){
        if(document.querySelector('img[src$="finishbattle.png"]')){
            var endSheet = document.createElement('style');
            endSheet.innerHTML = '#btcp {display: block !important}';
            document.head.appendChild(endSheet);
        }
        else{
            btcp.click();
        }
    }
}

function init() {
    if(!log) {
        return;
    }
    var obs = new MutationObserver(reloadedEvent);
    obs.observe(log, {childList: true});

    var obs2 = new MutationObserver(roundEndEvent);
    obs2.observe(paneCompletion, {childList: true}); //this will also skip the finish popup

    var sheet = document.createElement('style');
    sheet.innerHTML = '#btcp {display: none}';
    if(hideLog){
        sheet.innerHTML += '#pane_log {display: none}';
    }
    document.head.appendChild(sheet);

    window.addEventListener('contextmenu', function (e) {
        e.preventDefault();
        runRightClickSpell();
    }, false);

    reloadedEvent();
}
init();


This post has been edited by Sapo84: Jun 24 2017, 16:26
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 16:20
Post #4013
Null2Null



Active Poster
*******
Group: Gold Star Club
Posts: 1,199
Joined: 8-May 11
Level 500 (Ponyslayer)


QUOTE(FabulousCupcake @ Jun 24 2017, 22:12) *

CODE

// ==UserScript==
// @name         HV | Chain Attack
// @namespace    http://fabulous.cupcake.jp.net
// @version      0.1
// @description  Keep attacking as long as you keep hovering on the monster
// @author       FabulousCupcake
// @match        https://hentaiverse.org/?s=Battle&ss=ar&page=2
// @grant        unsafeWindow
// @run-at       document-end
// ==/UserScript==

function getMonsterUnderCursor(X, Y) {
    var el = document.elementFromPoint(X, Y);
    var result = false;

    // Check `el` and iteratively its parents until we hit body or found monster
    while(!result) {
        if(el.nodeName.toLowerCase() === 'body') break;
        result = ( el.id.match('mkey') ? el : false );
        el = el.parentElement;
    }

    return result;
}

(function() {
    'use strict';
    
    let X, Y;
    document.addEventListener("mousemove", (e) => { X = e.pageX; Y = e.pageY; });
    
    
    function chain_commit(index) {
        const el = getMonsterUnderCursor(X, Y);
        if (!el) return;
        if (!el.onclick) return;
        
        const id = el.id.substr(-1);
        unsafeWindow.battle.commit_target(id);
    }
    
    
    const logs = document.querySelector("#textlog > tbody");
    const config = { childList: true };
    const observer = new MutationObserver( mutations => {
        chain_commit();
    });
    observer.observe(logs, config);
    
})();


Whoever wants to modify or extend it (like, start attacking immediately when you hover, stop attacking Spark of Life triggered, or use spell instead of attack), feel free to do so ¯\_(ツ)_/¯

wat a great job u did
thx a lot
it woooooooooooooooorks!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 16:23
Post #4014
FabulousCupcake



Casual Poster
****
Group: Gold Star Club
Posts: 497
Joined: 15-April 14
Level 451 (Dovahkiin)


Attached Image

Actually working now with some aesthetic fixes (removed the strange vertical bar on the right side)

CODE
// ==UserScript==
// @name         HV | Relative HP Bar
// @namespace    http://fabulous.cupcake.jp.net
// @version      0.2
// @description  Visual feedback for monster hp compared to the other monsters'
// @author       FabulousCupcake
// @match        https://hentaiverse.org/?s=Battle&ss=*
// @grant        none
// @run-at       document-end
// ==/UserScript==


let stylesheet = "";
stylesheet += `
    .chbd > img:last-child {
        transform: scaleX(1.01);
        transform-origin: 0;
    }
`;

function injectStylesheet(stylesheet) {
    var stylesheetEl = document.createElement('style');
    stylesheetEl.innerHTML = stylesheet;
    document.body.appendChild(stylesheetEl);
}

(function() {
    'use strict';

    const logs = document.querySelectorAll("#textlog td");
    let hpList = [];
    
    for (let i=0; i<logs.length; i++) {
        const log = logs[i];
        const pattern = /Spawned Monster (\w): MID=(\d+) \((.+)\) LV=(\d+) HP=(\d+)/;
        const match = log.textContent.match(pattern);
        const hp = (match) ? match[5] : null;
        
        hpList.push(hp);
    }
    
    hpList = hpList.filter(Boolean);
    const maxHp = hpList.reduce((a,b) => Math.max(a,b));
    
    for (let i=0; i<hpList.length; i++) {
        const ratio = hpList[i]/maxHp;
        stylesheet += `
            #mkey_${i+1} .chbd {
                transform-origin: 0;
                transform: scaleX(${ratio});
            }`;
    }
    
    injectStylesheet(stylesheet);
    
})();
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 16:23
Post #4015
boulay



Noob
********
Group: Gold Star Club
Posts: 2,675
Joined: 27-June 11
Level 500 (Godslayer)


Attached File  HV_Dark_1.4.css ( 731.7k ) Number of downloads: 262
Attached File  HV_Dark_Lite_1.4.css ( 85.39k ) Number of downloads: 164
Attached File  HV_Dark_NoStylish_Pack.zip ( 1k ) Number of downloads: 51


should be good now, also forgot some monster lab things (IMG:[invalid] style_emoticons/default/cry.gif)
blinking won't happen when loading through stylish, it only does when you go with the script...

This post has been edited by boulay: Jun 24 2017, 19:41
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 16:32
Post #4016
Juggernaut Santa



Living in HV 0.83 until Tenboro adds the Tower to Persistent
***********
Group: Gold Star Club
Posts: 11,150
Joined: 26-April 12
Level 500 (Ponyslayer)


QUOTE(boulay @ Jun 24 2017, 16:23) *

Attached File  HV_Dark_1.4.css ( 731.7k ) Number of downloads: 262
Attached File  HV_Dark_Lite_1.4.css ( 85.39k ) Number of downloads: 164
Attached File  HV_Dark_NoStylish_Pack.zip ( 1k ) Number of downloads: 51


should be good now, also forgot some monter lab things (IMG:[invalid] style_emoticons/default/cry.gif)
blinking won't happen when loading through stylish, it only does when you go with the script...


Ok, now it doesn't blink.
Before it was blinking, with stylish.

Good job (IMG:[invalid] style_emoticons/default/tongue.gif)

QUOTE(Sapo84 @ Jun 24 2017, 16:20) *
this will also skip the finish popup

Strangely, it does not. But since it's better like this, I appreciate that (IMG:[invalid] style_emoticons/default/laugh.gif)

This post has been edited by End Of All Hope: Jun 24 2017, 16:36
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 16:59
Post #4017
Noni



Hataraku Noni-sama
***********
Group: Catgirl Camarilla
Posts: 13,680
Joined: 19-February 16
Level 500 (Ponyslayer)


QUOTE(Sapo84 @ Jun 24 2017, 16:20) *

Yeah, sure.

NOTE: Tested on Firefox 48.0.2 only

Hoverplay + spell rotation + advance round + hide battle log + right click heal + disable hover on HP, MP and SP limit
Since a imperil script already exists it should cover the basic mage functionality

Everyone, feel free to take it and modify the hell out of it (probably if integrated with FabulousCupcake's code it should work ok with Chrome)

CODE
// ==UserScript==
// @name        MouseMagelee 0.85
// @namespace   hentaiverse.org
// @match       *://*.hentaiverse.org/*
// @run-at      document-end
// @grant       none
// ==/UserScript==

// ***THANKS***
// sickentide (HV No Popup)
// sigo8 (Reloader Shim)

// SETTINGS
var hideLog = true;
var defaultAction = [153,152,151]; //0 for melee
var minHP = 0.35;
var minMP = 0.2;
var minSP = 0.3;
var rightClick = [311,313];
var log = document.querySelector('#textlog > tbody');
var paneCompletion = document.getElementById('pane_completion');

function canCast(id){
    var el = document.getElementById(id);
    return !!el && el.hasAttribute('onclick');
}
function setSpellAttack(id) {
    var caller = document.getElementById(id);
    window.battle.lock_action(caller, 1, 'magic', id);
    window.battle.set_hostile_skill(id);
}

function castSupport(id) {
    var caller = document.getElementById(id);
    window.battle.lock_action(caller, 1, 'magic', id);
    window.battle.set_friendly_skill(id);
    window.battle.touch_and_go();
}

function runRightClickSpell() {
    for (var i = 0; i < rightClick.length; i++) {
        if (canCast(rightClick[i])) {
            castSupport(rightClick[i]);
            return;
        }
    }
}

function reloadedEvent() {
    if(document.querySelector('#vbh img').width < 496*minHP) return;
    if(document.querySelector('#vbm img').width < 207*minMP) return;
    if(document.querySelector('#vbs img').width < 207*minSP) return;

    if(defaultAction){
        for (var i = 0; i < defaultAction.length; i++) {
            if (canCast(defaultAction[i])) {
                setSpellAttack(defaultAction[i]);
                break;
            }
        }
    }

    mpane = document.getElementById('pane_monster');
    var m = mpane.getElementsByClassName("btm1");

    for (var j = 0; j < m.length; j++) {
        if (m[j].hasAttribute('onclick')) {
            m[j].setAttribute('onmouseover', m[j].getAttribute('onclick'));
        }
    }
}
function roundEndEvent() {
    var btcp = document.getElementById('btcp');
    if (btcp){
        if(document.querySelector('img[src$="finishbattle.png"]')){
            var endSheet = document.createElement('style');
            endSheet.innerHTML = '#btcp {display: block !important}';
            document.head.appendChild(endSheet);
        }
        else{
            btcp.click();
        }
    }
}

function init() {
    if(!log) {
        return;
    }
    var obs = new MutationObserver(reloadedEvent);
    obs.observe(log, {childList: true});

    var obs2 = new MutationObserver(roundEndEvent);
    obs2.observe(paneCompletion, {childList: true}); //this will also skip the finish popup

    var sheet = document.createElement('style');
    sheet.innerHTML = '#btcp {display: none}';
    if(hideLog){
        sheet.innerHTML += '#pane_log {display: none}';
    }
    document.head.appendChild(sheet);

    window.addEventListener('contextmenu', function (e) {
        e.preventDefault();
        runRightClickSpell();
    }, false);

    reloadedEvent();
}
init();



Very very nice! HV is playable again! So, any advice on how to divide the bounty that I set? Or are we planning to do a crowdfunding? Everybody, please let me know your opinion!


Edit: quick fix: Change in AltlessCasting:

in settings:
row = '5'
pad = 'qb'

and then you have the same way of imperil play of 2 5 8 back!

This post has been edited by DJNoni: Jun 24 2017, 17:15
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 17:02
Post #4018
Juggernaut Santa



Living in HV 0.83 until Tenboro adds the Tower to Persistent
***********
Group: Gold Star Club
Posts: 11,150
Joined: 26-April 12
Level 500 (Ponyslayer)


QUOTE(DJNoni @ Jun 24 2017, 16:59) *

So, any advice on how to divide the bounty that I set? Or are we planning to do a crowdfunding? Everybody, please let me know your opinion!

Isn't it the same? A bounty crowfunding?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 17:19
Post #4019
Jack Tekila



Casual Poster
***
Group: Members
Posts: 174
Joined: 17-November 09
Level 453 (Godslayer)


QUOTE(boulay @ Jun 24 2017, 11:23) *

Attached File  HV_Dark_1.4.css ( 731.7k ) Number of downloads: 262
Attached File  HV_Dark_Lite_1.4.css ( 85.39k ) Number of downloads: 164
Attached File  HV_Dark_NoStylish_Pack.zip ( 1k ) Number of downloads: 51


should be good now, also forgot some monter lab things (IMG:[invalid] style_emoticons/default/cry.gif)
blinking won't happen when loading through stylish, it only does when you go with the script...


How to use it? Never used a HV Theme before and it looks different from the others scripts.

Tried to copy/paste both Dark and Dark Lite on greasemonkey (Firefox 48.0.2), but it didn't work...

What is the difference between them? What is this NoStylish?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 17:26
Post #4020
Sapo84



Deus lo vult
********
Group: Gold Star Club
Posts: 3,332
Joined: 14-June 09
Level 500 (Ponyslayer)


QUOTE(End Of All Hope @ Jun 24 2017, 16:32) *

Strangely, it does not. But since it's better like this, I appreciate that (IMG:[invalid] style_emoticons/default/laugh.gif)

I copied HV No Popup code to exclude the last round skip but forgot to remove the comment.
And I agree it's better like that (IMG:[invalid] style_emoticons/default/heh.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 17:26
Post #4021
friggo



~Snug as a bug in a rug~
*******
Group: Gold Star Club
Posts: 2,134
Joined: 9-October 14
Level 500 (Ponyslayer)


QUOTE(DJNoni @ Jun 24 2017, 17:59) *

Edit: quick fix: Change in AltlessCasting:

in settings:
row = '5'
pad = 'qb'

and then you have the same way of imperil play of 2 5 8 back!


Nice. Thanks (IMG:[invalid] style_emoticons/default/smile.gif)

But if I want to cast Regen or Heartseeker now, I'll just have to manually click on them?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 17:30
Post #4022
boulay



Noob
********
Group: Gold Star Club
Posts: 2,675
Joined: 27-June 11
Level 500 (Godslayer)


QUOTE(Jack Tekila @ Jun 24 2017, 17:19) *

How to use it? Never used a HV Theme before and it looks different from the others scripts.

Tried to copy/paste both Dark and Dark Lite on greasemonkey (Firefox 48.0.2), but it didn't work...

What is the difference between them? What is this NoStylish?

NoStylish stands for users who don't want to use [addons.mozilla.org] the addon to make css work.

You can use it with greasemonkey though, since it's just a normal script ^^
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 17:43
Post #4023
Jack Tekila



Casual Poster
***
Group: Members
Posts: 174
Joined: 17-November 09
Level 453 (Godslayer)


QUOTE(boulay @ Jun 24 2017, 12:30) *

NoStylish stands for users who don't want to use [addons.mozilla.org] the addon to make css work.

You can use it with greasemonkey though, since it's just a normal script ^^


Downloaded the addon, thanks! (IMG:[invalid] style_emoticons/default/biggrin.gif)

Installed the Dark, but the monster lab is kinda bugged...

What is the difference between Dark and Dark Lite?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 17:50
Post #4024
boulay



Noob
********
Group: Gold Star Club
Posts: 2,675
Joined: 27-June 11
Level 500 (Godslayer)


QUOTE(Jack Tekila @ Jun 24 2017, 17:43) *

Downloaded the addon, thanks! (IMG:[invalid] style_emoticons/default/biggrin.gif)

Installed the Dark, but the monster lab is kinda bugged...

What is the difference between Dark and Dark Lite?

bugged? What kind?

dark lite is lighter and has less features, thus 'Lite' (IMG:[invalid] style_emoticons/default/duck.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 18:16
Post #4025
SleepDealer



Chrono Diver
********
Group: Gold Star Club
Posts: 3,020
Joined: 6-February 12
Level 500 (Ponyslayer)


QUOTE(Sapo84 @ Jun 24 2017, 19:20) *

Hoverplay + spell rotation + advance round + hide battle log + right click heal + disable hover on HP, MP and SP limit
Since a imperil script already exists it should cover the basic mage functionality

Many thanks! (IMG:[invalid] style_emoticons/default/smile.gif)

QUOTE(DJNoni @ Jun 24 2017, 19:59) *

Very very nice! HV is playable again! So, any advice on how to divide the bounty that I set? Or are we planning to do a crowdfunding? Everybody, please let me know your opinion!
Edit: quick fix: Change in AltlessCasting:

in settings:
row = '5'
pad = 'qb'

and then you have the same way of imperil play of 2 5 8 back!

Does it supports Sapo`s script? Because pressing number keys does spell cast for me.

This post has been edited by SleepDealer: Jun 24 2017, 18:17
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 18:29
Post #4026
Noni



Hataraku Noni-sama
***********
Group: Catgirl Camarilla
Posts: 13,680
Joined: 19-February 16
Level 500 (Ponyslayer)


QUOTE(friggo @ Jun 24 2017, 17:26) *

Nice. Thanks (IMG:[invalid] style_emoticons/default/smile.gif)

But if I want to cast Regen or Heartseeker now, I'll just have to manually click on them?



You can then use numpad for that. But manually is not that much more clicks.

QUOTE(SleepDealer @ Jun 24 2017, 18:16) *

Many thanks! (IMG:[invalid] style_emoticons/default/smile.gif)
Does it supports Sapo`s script? Because pressing number keys does spell cast for me.


Yes, for me it does. I run Sapo as script 1, UI script as 2 and Altless as 3. Chrome tampermonkey.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jun 24 2017, 18:31
Post #4027
qberg



Regular Poster
******
Group: Members
Posts: 762
Joined: 12-September 13
Level 467 (Godslayer)


QUOTE(Sapo84 @ Jun 24 2017, 17:20) *
Hoverplay + spell rotation + advance round + hide battle log + right click heal + disable hover on HP, MP and SP limit
Since a imperil script already exists it should cover the basic mage functionality

Everyone, feel free to take it and modify the hell out of it (probably if integrated with FabulousCupcake's code it should work ok with Chrome)

CODE
// ==UserScript==
// @name        MouseMagelee 0.85
// @namespace   hentaiverse.org
// @match       *://*.hentaiverse.org/*
// @run-at      document-end
// @grant       none
// ==/UserScript==

// ***THANKS***
// sickentide (HV No Popup)
// sigo8 (Reloader Shim)

// SETTINGS
var hideLog = true;
var defaultAction = [153,152,151]; //0 for melee
var minHP = 0.35;
var minMP = 0.2;
var minSP = 0.3;
var rightClick = [311,313];
var log = document.querySelector('#textlog > tbody');
var paneCompletion = document.getElementById('pane_completion');

function canCast(id){
    var el = document.getElementById(id);
    return !!el && el.hasAttribute('onclick');
}
function setSpellAttack(id) {
    var caller = document.getElementById(id);
    window.battle.lock_action(caller, 1, 'magic', id);
    window.battle.set_hostile_skill(id);
}

function castSupport(id) {
    var caller = document.getElementById(id);
    window.battle.lock_action(caller, 1, 'magic', id);
    window.battle.set_friendly_skill(id);
    window.battle.touch_and_go();
}

function runRightClickSpell() {
    for (var i = 0; i < rightClick.length; i++) {
        if (canCast(rightClick[i])) {
            castSupport(rightClick[i]);
            return;
        }
    }
}

function reloadedEvent() {
    if(document.querySelector('#vbh img').width < 496*minHP) return;
    if(document.querySelector('#vbm img').width < 207*minMP) return;
    if(document.querySelector('#vbs img').width < 207*minSP) return;

    if(defaultAction){
        for (var i = 0; i < defaultAction.length; i++) {
            if (canCast(defaultAction[i])) {
                setSpellAttack(defaultAction[i]);
                break;
            }
        }
    }

    mpane = document.getElementById('pane_monster');
    var m = mpane.getElementsByClassName("btm1");

    for (var j = 0; j < m.length; j++) {
        if (m[j].hasAttribute('onclick')) {
            m[j].setAttribute('onmouseover', m[j].getAttribute('onclick'));
        }
    }
}
function roundEndEvent() {
    var btcp = document.getElementById('btcp');
    if (btcp){
        if(document.querySelector('img[src$="finishbattle.png"]')){
            var endSheet = document.createElement('style');
            endSheet.innerHTML = '#btcp {display: block !important}';
            document.head.appendChild(endSheet);
        }
        else{
            btcp.click();
        }
    }
}

function init() {
    if(!log) {
        return;
    }
    var obs = new MutationObserver(reloadedEvent);
    obs.observe(log, {childList: true});

    var obs2 = new MutationObserver(roundEndEvent);
    obs2.observe(paneCompletion, {childList: true}); //this will also skip the finish popup

    var sheet = document.createElement('style');
    sheet.innerHTML = '#btcp {display: none}';
    if(hideLog){
        sheet.innerHTML += '#pane_log {display: none}';
    }
    document.head.appendChild(sheet);

    window.addEventListener('contextmenu', function (e) {
        e.preventDefault();
        runRightClickSpell();
    }, false);

    reloadedEvent();
}
init();

I'm feeling stupid, but how one is supposed to use it? I tred to put the script into a notepad, save it as .js and drag&drop into Greasemonkey the way Reloader worked previously, but this time Greasemonkey says the script is damaged or something. What am I doing wrong?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


291 Pages V « < 200 201 202 203 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 18th November 2025 - 10:24