Welcome Guest ( Log In | Register )

291 Pages V « < 93 94 95 96 97 > »   
Reply to this topicStart new topic
> HV Script Thread, Discuss your creations. Includes guidelines and infos for script creation (2020-02-28 upd)

 
post Jan 14 2015, 22:01
Post #1881
coreguy



Casual Poster
***
Group: Members
Posts: 119
Joined: 15-May 12
Level 355 (Godslayer)


QUOTE(White Joker @ Jan 14 2015, 18:28) *

Latest firefox update seems to make the HVStat script crash the browser for me. Is anyone else getting this problem? Also, screw firefox for no in-built version rollback. If I want to use an older version, risk or no, I should be able to.


you may go to filehippo for an older build.

User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 15 2015, 08:27
Post #1882
LazyShd



Need moar VNs
******
Group: Gold Star Club
Posts: 767
Joined: 5-May 13
Level 475 (Godslayer)


Hi everyone!
I wonder if there are some script that will like "HP alert" pop up some message and stop everything when you have no Regen buff on yourself? If I remember correctly HVSTAT has something like that, but it slows down farm speed too much.
If there is no such script, maybe someone could make it for Chrome please?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 15 2015, 08:57
Post #1883
showoff



Veteran Poster
********
Group: Gold Star Club
Posts: 3,778
Joined: 31-December 14
Level 500 (Ponyslayer)


QUOTE(LazyShd @ Jan 15 2015, 06:27) *

Hi everyone!
I wonder if there are some script that will like "HP alert" pop up some message and stop everything when you have no Regen buff on yourself? If I remember correctly HVSTAT has something like that, but it slows down farm speed too much.
If there is no such script, maybe someone could make it for Chrome please?

HVSTAT doesnt slow down mine one n work quite well (IMG:[invalid] style_emoticons/default/cool.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 15 2015, 10:30
Post #1884
coreguy



Casual Poster
***
Group: Members
Posts: 119
Joined: 15-May 12
Level 355 (Godslayer)


QUOTE(LazyShd @ Jan 15 2015, 07:27) *

Hi everyone!
I wonder if there are some script that will like "HP alert" pop up some message and stop everything when you have no Regen buff on yourself? If I remember correctly HVSTAT has something like that, but it slows down farm speed too much.
If there is no such script, maybe someone could make it for Chrome please?


easy, if you are using HVSTAT slim, just add the following to the script:

CODE

var regenstatus = storage.getItem("regen") || "off";

if($(".bte img[src*=regen]") && regenstatus == "off") {
    storage.setItem("regen", "on");
}

if(!$(".bte img[src*=regen]") && regenstatus == "on") {
    alert("regen depleted");
    storage.setItem("regen", "off");
}


if not (you want a new script), then it is
CODE

var regenstatus = sessionStorage.getItem("regen") || "off";

if(document.querySelector(".bte img[src*=regen]") && regenstatus == "off") {
    sessionStorage.setItem("regen", "on");
}

if(!document.querySelector(".bte img[src*=regen]") && regenstatus == "on") {
    alert("regen depleted");
    sessionStorage.setItem("regen", "off");
}
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 15 2015, 12:01
Post #1885
LazyShd



Need moar VNs
******
Group: Gold Star Club
Posts: 767
Joined: 5-May 13
Level 475 (Godslayer)


QUOTE(coreguy @ Jan 15 2015, 12:30) *

if not (you want a new script), then it is

Thanks for your help, but I know practically nothing about extensions and scripting, so I failed.
I am using:
QUOTE(oohmrparis @ Mar 14 2014, 13:03) *

I've modified HVSTAT slim
Function is
・HP, Spark, Channeling Alert Alert more than once modified
Adjust key event handling not to overrun when an alert is shown
・Nopopup, effectDurations, skillHotkey, Roundcounter
・Draw a line at the end of the turn
・The display on the left panel of the current equipment number

for chrome
Attached File  hvmma_mod_for_chrome.user.zip ( 2.51k ) Number of downloads: 1635


So I tried to create new extension for chrome with your script.
Attached File  regen.user.zip ( 320bytes ) Number of downloads: 58

And of course just copy and paste your script won't work, but this is limit of my skills.
Maybe someone is kind enough to make this for me, so I just install the chrome extension and everything will work fine?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 15 2015, 12:03
Post #1886
showoff



Veteran Poster
********
Group: Gold Star Club
Posts: 3,778
Joined: 31-December 14
Level 500 (Ponyslayer)


QUOTE(LazyShd @ Jan 15 2015, 10:01) *

Thanks for your help, but I know practically nothing about extensions and scripting, so I failed.
I am using:

So I tried to create new extension for chrome with your script.
Attached File  regen.user.zip ( 320bytes ) Number of downloads: 58

And of course just copy and paste your script won't work, but this is limit of my skills.
Maybe someone is kind enough to make this for me, so I just install the chrome extension and everything will work fine?


I wonder u need to add those in the script but not create a new one?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 15 2015, 12:04
Post #1887
showoff



Veteran Poster
********
Group: Gold Star Club
Posts: 3,778
Joined: 31-December 14
Level 500 (Ponyslayer)


I would like to ask how to use Quickbar 2?
I saw the red msg in the battle after i installed, but i cant find the second bar in the ability page as told, either in setting or somewhere sad.gif

Can anyone tell me how to set it properly?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 15 2015, 12:53
Post #1888
coreguy



Casual Poster
***
Group: Members
Posts: 119
Joined: 15-May 12
Level 355 (Godslayer)


QUOTE(LazyShd @ Jan 15 2015, 11:01) *

Thanks for your help, but I know practically nothing about extensions and scripting, so I failed.
I am using:

So I tried to create new extension for chrome with your script.
Attached File  regen.user.zip ( 320bytes ) Number of downloads: 58

And of course just copy and paste your script won't work, but this is limit of my skills.
Maybe someone is kind enough to make this for me, so I just install the chrome extension and everything will work fine?


The userscript meta info is missing so it won't work. This should be a working one.

Attached File  hvregen.user.zip ( 387bytes ) Number of downloads: 62
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 15 2015, 13:35
Post #1889
LazyShd



Need moar VNs
******
Group: Gold Star Club
Posts: 767
Joined: 5-May 13
Level 475 (Godslayer)


QUOTE(coreguy @ Jan 15 2015, 14:53) *

The userscript meta info is missing so it won't work. This should be a working one.

Attached File  hvregen.user.zip ( 387bytes ) Number of downloads: 62


Working fine, thank you very much for help. Blind grind while watching something is even easier now!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 16 2015, 10:21
Post #1890
showoff



Veteran Poster
********
Group: Gold Star Club
Posts: 3,778
Joined: 31-December 14
Level 500 (Ponyslayer)


Good Day everyone,
i hv some questions about the "HV Keybinds 2.5.0"
if i want to just add three more skill hotkeys for 11-13 skill slot(or enter the skill name)n keep all the rest remain the same,
what should i do then?
i hv no idea about editing the original script....
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 16 2015, 10:55
Post #1891
n125



Elite Poster
*********
Group: Gold Star Club
Posts: 6,282
Joined: 23-May 08
Level 500 (Godslayer)


QUOTE(showoff @ Jan 16 2015, 00:21) *

Good Day everyone,
i hv some questions about the "HV Keybinds 2.5.0"
if i want to just add three more skill hotkeys for 11-13 skill slot(or enter the skill name)n keep all the rest remain the same,
what should i do then?
i hv no idea about editing the original script....


Open the script in a text editor and read the instructions near the top. It explains how to bind various types of actions to keys and provides several different examples. You can create binds for more than just skills and spells, so it's not just limited to what is in your quickbar slots.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 16 2015, 11:39
Post #1892
showoff



Veteran Poster
********
Group: Gold Star Club
Posts: 3,778
Joined: 31-December 14
Level 500 (Ponyslayer)


QUOTE(n125 @ Jan 16 2015, 08:55) *

Open the script in a text editor and read the instructions near the top. It explains how to bind various types of actions to keys and provides several different examples. You can create binds for more than just skills and spells, so it's not just limited to what is in your quickbar slots.

QUOTE
// ==UserScript==
// @name HV Keybinds
// @namespace HVKEYBIND
// @version 2.5.0
// @description Adds customized keybinding to HV
// @match http://hentaiverse.org/*
// @include http://hentaiverse.org/*
// ==/UserScript==

var bindings = new Array();
var KEY_A = 65, KEY_B = 66, KEY_C = 67, KEY_D = 68, KEY_E = 69, KEY_F = 70, KEY_G = 71, KEY_H = 72, KEY_I = 73, KEY_J = 74, KEY_K = 75, KEY_L = 76, KEY_M = 77;
var KEY_N = 78, KEY_O = 79, KEY_P = 80, KEY_Q = 81, KEY_R = 82, KEY_S = 83, KEY_T = 84, KEY_U = 85, KEY_V = 86, KEY_W = 87, KEY_X = 88, KEY_Y = 89, KEY_Z = 90;
var KEY_1 = 49, KEY_2 = 50, KEY_3 = 51, KEY_4 = 52, KEY_5 = 53, KEY_6 = 54, KEY_7 = 55, KEY_8 = 56, KEY_9 = 57, KEY_0 = 48;
var KEY_SPACE = 32, KEY_ENTER = 13, KEY_PAGEUP = 33, KEY_PAGEDOWN = 34, KEY_END = 35, KEY_HOME = 36, KEY_UP = 37, KEY_LEFT = 38, KEY_RIGHT = 39, KEY_DOWN = 40;
var KEY_F1 = 112, KEY_F2 = 113, KEY_F3 = 114, KEY_F4 = 115, KEY_F5 = 116, KEY_F6 = 117, KEY_F7 = 118, KEY_F8 = 119, KEY_F9 = 120, KEY_F10 = 121, KEY_F11 = 122, KEY_F12 = 123;
var KEY_COMMA = 188, KEY_PERIOD = 190, KEY_SLASH = 191, KEY_FORWARDSLASH = 191, KEY_GRAVE = 192, KEY_TILDE = 192, KEY_LBRACKET = 219, KEY_BACKSLASH = 220;
var KEY_SEMI = 186, KEY_RBRACKET = 221, KEY_APOSTROPHE = 222;

//For keycodes: [www.javascripter.net] http://www.javascripter.net/faq/keycodes.htm
// or: [www.cambiaresearch.com] http://www.cambiaresearch.com/articles/15/...codes-key-codes
// or: Use above codes for most keys.

// Just add this for as many bindings as you want:
// Bind(KeyCode, Modifier, Action);
// KeyCode = From links above
// Modifier = This is OPTIONAL. Valid mods are NoMod, Shift, Ctrl, Alt, CtrlShift, AltShift, CtrlAlt, CtrlAltShift
// Action = Valid actions:
// Cast("Spell Name")
// Spell Name.
// Use("Item Type")
// Valid Item Types are Health, Mana, Spirit, Scroll and Infusion.
// Toggle("Type")
// Focus or Spirit
// Nothing
// Use this to unbind a default key
// Target1 - Target10
// Targets the specified monster.
// PowerupGem
// Uses the powerup gem.
// NextRound
// Enters next round. Using this overrides both Space and Enter for next round. If you still want to use one of those, add it manually.
//
// Examples:
// Bind(KEY_M, Shift, Use("Mana"); -- Shift + M = Use next mana potion
// Bind(KEY_LBRACKET, Cast("WRATH OF THOR")); -- Case insensitive. Key [ = cast Wrath of Thor
// Bind(KEY_A, Nothing); -- You can unbind a default key
// Bind(KEY_I, Use("Infusion of Storms"); -- I uses Infusion of Storms
// Bind(KEY_F, Toggle("Focus")) -- toggle focus
// Bind(KEY_S, Toggle("Spirit")); -- toggle spirit stance

Bind(KEY_S, Toggle("Focus"));
Bind(KEY_F, Nothing);
Bind(KEY_Z, Cast("Imperil"));
Bind(KEY_X, Cast("Confuse"));
Bind(KEY_C, Cast("Sleep"));
Bind(KEY_V, Cast("Silence"));
Bind(KEY_H, Cast("Iris Strike"));
Bind(KEY_J, Cast("Backstab"));
Bind(KEY_K, Cast("Frenzied Blows"));

Bind(KEY_O, Use("Mana"));
Bind(KEY_P, Use("Spirit"));


// Don't edit anything below. Unless you want to.

if (document.getElementById('togpane_log')) {
document.addEventListener("keydown", handle, true);
}

function handle(e){
saveKeyDown();
for (i = 0; i < bindings.length ; i++) {
var bind = bindings[i];
if (e.keyCode == bind.keyCode && bind.modifier(e)) {
bind.action();
return;
}
}
loadKeyDown();
}

function saveKeyDown(){
runScript("var oldkeydown = document.onkeydown ? document.onkeydown : oldkeydown; document.onkeydown = null;");
}

function loadKeyDown(){
runScript("document.onkeydown = oldkeydown;")
}

function runScript(code){
var scriptElement = document.createElement("script");
scriptElement.type = "text/javascript";
scriptElement.textContent = code;
document.body.appendChild(scriptElement);
scriptElement.remove();
}

function Bind(key, mod, command) {
if (!command) {
command = mod;
mod = NoMod;
}
if (!command) return;
addKeybind(key, mod, command);
}

function addKeybind(key, mod, command) {
bindings.push(new Keybind(key,mod,command));
}

function getSpell(name){
return document.querySelector('.bts>div[onmouseover *= "'+name+'"]');
}

function Toggle(name){
name = name.toLowerCase();
var state = document.querySelector('#ckey_'+name);
if(!state) return null;

return function(){
state.click();
}
}

function Cast(name) {
var spell = getSpell(name);
if(!spell) return null;

if(spell.id > 1000){
return function(){
if(document.querySelector('#togpane_magico[style="display:none"]')){
document.querySelector('.btpm2>img[onclick]').click();
}
spell.click();
}
}else{
return function(){
if(document.querySelector('#togpane_magict[style="display:none"]')){
document.querySelector('.btpm3>img[onclick]').click();
}
spell.click();
}
}
}

function Use(name){
var item_list = document.querySelectorAll('.bti3>div[onmouseover]>div>div');
if(!item_list) return null;
for(var i=0; i<item_list.length; i++){
var item = item_list[i];
var item_name = item.innerText || item.textContent;
if(item_name.match(name)){
return function(){
item.click();
}
}
}
}

function Keybind(key, mod, action) {
this.keyCode = key;
this.modifier = mod;
this.action = action;
}

function NoMod(e) { return !e.shiftKey && !e.altKey && !e.ctrlKey; }
function CtrlAltShift(e) { return e.shiftKey && e.altKey && e.ctrlKey; }
function CtrlShift(e) { return !e.altKey && e.shiftKey && e.ctrlKey; }
function AltShift(e) { return !e.ctrlKey && e.altKey && e.shiftKey; }
function CtrlAlt(e) { return !e.shiftKey && e.ctrlKey && e.altKey; }
function Ctrl(e) { return e.ctrlKey && !e.shiftKey && !e.altKey; }
function Shift(e) { return e.shiftKey && !e.ctrlKey && !e.altKey; }
function Alt(e) { return e.altKey && !e.shiftKey && !e.ctrlKey; }

function Nothing() {} //for unbinding default keys

function NextRound() {
var roundEnd = document.querySelector('#ckey_continue');
if(roundEnd){
roundEnd.click();
}
}

function TargetMonster(num) {
var monster = document.getElementById("mkey_"+num);
if (monster) {
monster.click();
}
}

function Target1() { TargetMonster(1) }
function Target2() { TargetMonster(2) }
function Target3() { TargetMonster(3) }
function Target4() { TargetMonster(4) }
function Target5() { TargetMonster(5) }
function Target6() { TargetMonster(6) }
function Target7() { TargetMonster(7) }
function Target8() { TargetMonster(8) }
function Target9() { TargetMonster(9) }
function Target10() { TargetMonster(0) }

function PowerupGem() {
var pgem = document.getElementById("ikey_p");
if (pgem) {
pgem.click();
}
}


is that the red part is the only things the author added and the other original hotkeys are remain the same?
if i want to add three skills: Imperil, Slow, and Blind to numpad "/,*,-"
should i rewrite those with
QUOTE
Bind(KEY_111, Alt,Cast("Slow"));
Bind(KEY_106, Alt,Cast("Imperil"));
Bind(KEY_109, Alt,Cast("Blind"));


thanks a lot!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 16 2015, 12:19
Post #1893
n125



Elite Poster
*********
Group: Gold Star Club
Posts: 6,282
Joined: 23-May 08
Level 500 (Godslayer)


QUOTE(showoff @ Jan 16 2015, 01:39) *

is that the red part is the only things the author added and the other original hotkeys are remain the same?
if i want to add three skills: Imperil, Slow, and Blind to numpad "/,*,-"
should i rewrite those with
thanks a lot!


The binds highlighted in red were added by the author, so if you don't want to use them, just remove those lines. HV's default hotkeys will remain the same unless they are overwritten by the script or unbound with the "Nothing" action.

Also, your bindings won't work as written. Do

CODE
Bind(111, Alt, Cast("Slow"));
Bind(106, Alt, Cast("Imperil"));
Bind(109, Alt, Cast("Blind"));


instead, or declare those keycodes as variables in the bindings array at the top.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 16 2015, 12:57
Post #1894
showoff



Veteran Poster
********
Group: Gold Star Club
Posts: 3,778
Joined: 31-December 14
Level 500 (Ponyslayer)


QUOTE(n125 @ Jan 16 2015, 10:19) *


instead, or declare those keycodes as variables in the bindings array at the top.


thanks! but i dont understand this sentence...
sorry about my bad english
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 16 2015, 13:19
Post #1895
Dan31



Chilling around
********
Group: Members
Posts: 4,399
Joined: 26-March 12
Level 485 (Godslayer)


QUOTE(showoff @ Jan 16 2015, 11:57) *

thanks! but i dont understand this sentence...
sorry about my bad english

Either
CODE
Bind(111, Alt, Cast("Slow"));
Bind(106, Alt, Cast("Imperil"));
Bind(109, Alt, Cast("Blind"));

or
CODE
var KEY_SLASH = 111, KEY_STAR = 106, KEY_PLUS = 109;
Bind(KEY_SLASH, Alt, Cast("Slow"));
Bind(KEY_STAR, Alt, Cast("Imperil"));
Bind(KEY_PLUS, Alt, Cast("Blind"));
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 16 2015, 14:16
Post #1896
showoff



Veteran Poster
********
Group: Gold Star Club
Posts: 3,778
Joined: 31-December 14
Level 500 (Ponyslayer)


QUOTE(Dan31 @ Jan 16 2015, 11:19) *

Either
CODE
Bind(111, Alt, Cast("Slow"));
Bind(106, Alt, Cast("Imperil"));
Bind(109, Alt, Cast("Blind"));

or
CODE
var KEY_SLASH = 111, KEY_STAR = 106, KEY_PLUS = 109;
Bind(KEY_SLASH, Alt, Cast("Slow"));
Bind(KEY_STAR, Alt, Cast("Imperil"));
Bind(KEY_PLUS, Alt, Cast("Blind"));


it works now!
thank you very much!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 16 2015, 19:17
Post #1897
showoff



Veteran Poster
********
Group: Gold Star Club
Posts: 3,778
Joined: 31-December 14
Level 500 (Ponyslayer)


new question, is the damage logging still working?
i tried n worked ytd but i dont know why it didnt work today...
QUOTE
// ==UserScript==
// @name HV Cooldown
// @namespace hentaiverse.org
// @description Show Cooldown of Spell/Skills on the Quickbar
// @include http://hentaiverse.org/*
// @version 1.1.2
// @author holy_demon
// ==/UserScript==


if (document.getElementById("battleform")) {



var HVCooldown = function() {

var Spell = function(name, cooldown, ready, ref) {
this.name = name;
this.cooldown = cooldown;
this.ready = ready;
this.ref = ref;
};
var getSpells = function() {
var spellInfo = {};
var quickbar_spells = document.querySelectorAll(".btqs");
for (var i = 0; i < quickbar_spells.length; i++) {
var ref = quickbar_spells[i];
var desc = ref.getAttribute("onmouseover");
var info = /\(\'([\w -]*?)\',.*\, (\d*?)\)/.exec(desc);
var opacity = ref.firstElementChild.style.opacity;
if (info && info.length === 3) {
spellInfo[info[1]] = new Spell(info[1], Number(info[2]), !Boolean(opacity), ref);
}

}
return spellInfo;
};

var updateCooldowns = function(old_cooldowns, spellInfo) {
var cur_cooldowns = {};
var log = document.getElementById("togpane_log").textContent;

for (var name in spellInfo) {
if (spellInfo[name].cooldown > 0) { //only examine spell with cooldowns
if (spellInfo[name].ready) {//all ready spells has current cooldown set to -1
cur_cooldowns[name] = -1;
} else if (old_cooldowns[name] > 0 && !document.getElementById("#ckey_continue")) { // if spell was on cooldown previously, reduce it by 1
cur_cooldowns[name] = old_cooldowns[name] - 1;
} else if (old_cooldowns[name] === -1) { //spell was ready last turn
if (RegExp("You (use|cast) " + name + "\\.").exec(log)) { //check if it was casted in battle -> set to max cd
cur_cooldowns[name] = spellInfo[name].cooldown;
} else { // wasn't casted, still ready but unavailable for different reasons
cur_cooldowns[name] = 0;
}
} else { // otherwise assuming no cooldown
cur_cooldowns[name] = 0;
}
}
}

return cur_cooldowns;
};

var drawCooldowns = function(cur_cooldowns, spellInfo) {
var cooldown_style = document.documentElement.appendChild(document.createElement("style"));
cooldown_style.textContent = ".cooldown_indicator {position: relative; display: inline-block; text-align: center; top: 30px; z-index: 100; margin:auto; background: #EFEEDC; border: 1px solid #5C0D11; font-weight: bold; min-width: 12px; padding: 0 1px;}";

for (var name in cur_cooldowns) {
var cooldown = spellInfo[name].ref.appendChild(document.createElement("div"));
cooldown.classList.add("cooldown_indicator");
if (cur_cooldowns[name] === -1) {
cooldown.textContent = "ready";
} else {
cooldown.textContent = cur_cooldowns[name];
}
}
};

this.run = function() {
var spellInfo = getSpells();
var spellCooldown = JSON.parse(sessionStorage.HV_cooldowns || "{}");
spellCooldown = updateCooldowns(spellCooldown, spellInfo);
sessionStorage.HV_cooldowns = JSON.stringify(spellCooldown);
drawCooldowns(spellCooldown, spellInfo);
};
};

(new HVCooldown()).run();
}
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 18 2015, 09:51
Post #1898
register1997



Active Poster
*******
Group: Members
Posts: 1,452
Joined: 24-November 10
Level 425 (Godslayer)


QUOTE(coreguy @ Jan 15 2015, 10:30) *

easy, if you are using HVSTAT slim, just add the following to the script:

CODE

var regenstatus = storage.getItem("regen") || "off";

if($(".bte img[src*=regen]") && regenstatus == "off") {
    storage.setItem("regen", "on");
}

if(!$(".bte img[src*=regen]") && regenstatus == "on") {
    alert("regen depleted");
    storage.setItem("regen", "off");
}


if not (you want a new script), then it is
CODE

var regenstatus = sessionStorage.getItem("regen") || "off";

if(document.querySelector(".bte img[src*=regen]") && regenstatus == "off") {
    sessionStorage.setItem("regen", "on");
}

if(!document.querySelector(".bte img[src*=regen]") && regenstatus == "on") {
    alert("regen depleted");
    sessionStorage.setItem("regen", "off");
}



How can I code similar SP and MP alert in HVstat slim? HVstat works, but it slows down much, seems HVstat keeps collecting drops data even I switch off setting.

This post has been edited by register1997: Jan 18 2015, 09:55
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 18 2015, 12:05
Post #1899
coreguy



Casual Poster
***
Group: Members
Posts: 119
Joined: 15-May 12
Level 355 (Godslayer)


QUOTE(register1997 @ Jan 18 2015, 08:51) *

How can I code similar SP and MP alert in HVstat slim? HVstat works, but it slows down much, seems HVstat keeps collecting drops data even I switch off setting.


first, add these to the setting object (var setting = {}). Customize the percentage numbers as you want.

CODE

    MPalert: true,
    MPpercentage: 50,
    SPalert: true,
    SPpercentage: 50,


then insert the following after the "HP alert' part
CODE

    // SP and MP alert
    if(settings.MPalert){
        var gaugeMP = d.getElementsByClassName('cwb2')[1].width;
        if(gaugeMP <= settings.MPpercentage * 1.2 && !storage.MPlimit){
            adjustKey('Magic is low!');
            storage.setItem('MPlimit', 'true');
        }else if(gaugeMP > settings.MPpercentage * 1.2 && storage.MPlimit){
            storage.removeItem('MPlimit');
        }
    }

    if(settings.SPalert){
        var gaugeSP = d.getElementsByClassName('cwb2')[2].width;
        if(gaugeSP <= settings.SPpercentage * 1.2 && !storage.SPlimit){
            adjustKey('Spirit is low!');
            storage.setItem('SPlimit', 'true');
        }else if(gaugeSP > settings.SPpercentage * 1.2 && storage.SPlimit){
            storage.removeItem('SPlimit');
        }
    }


This post has been edited by coreguy: Jan 18 2015, 12:09
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jan 18 2015, 12:41
Post #1900
Dan31



Chilling around
********
Group: Members
Posts: 4,399
Joined: 26-March 12
Level 485 (Godslayer)


QUOTE(register1997 @ Jan 18 2015, 09:51) *

How can I code similar SP and MP alert in HVstat slim? HVstat works, but it slows down much, seems HVstat keeps collecting drops data even I switch off setting.

The mousemelee in my sig stops on low HP/MP/SP if you want to use it.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


291 Pages V « < 93 94 95 96 97 > » 
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: 15th January 2025 - 08:14