Welcome Guest ( Log In | Register )

291 Pages V « < 231 232 233 234 235 > »   
Reply to this topicStart new topic
> HV Script Thread, Discuss your creations. Includes guidelines and infos for script creation (2020-02-28 upd)

 
post Jul 16 2017, 13:20
Post #4641
hc br



Veteran Poster
********
Group: Catgirl Camarilla
Posts: 3,684
Joined: 18-October 15
Level 500 (Ponyslayer)


QUOTE(Aardwark @ Jul 16 2017, 18:55) *

Is there a Random Encounter Alarm. Am using Djackallstar's version: [sleazyfork.org] https://sleazyfork.org/en/scripts/3884-coun...n-e-hentai/code

but the list of encounter times doesn't update.

CODE
// ==UserScript==
// @name            Countdown Timer for the Random Encounter Event on E-Hentai
// @description     Adds a countdown timer for the Random Encounter event on E-Hentai.org and its subdomains.
// @grant           none
// @include         https://e-hentai.org/*
// @include         https://*.e-hentai.org/*
// ==/UserScript==

var wnd = window;
var doc = wnd.document;
var loc = location;
var href = loc.href;

if(!doc.querySelector('*[name="ipb_login_submit"]') && /(\.e-hentai\.org\/)|(^e-hentai.org\/)/.test(loc.hostname+'/') && !/\/palette\.html?\b/.test(href) && !doc.getElementById('countdown_timer')) {
    var set_cookie = function(k, v, t) {
        var expires = '; expires=Fri, 31 Dec 9999 23:59:59 GMT';
        if(t) {
            var d = new Date();
            d.setTime(d.getTime() + (t * 24 * 60 * 60 * 1000));
            expires = '; expires=' + d.toGMTString();
        }
        doc.cookie = k + '=' + escape(v) + expires + '; domain=.' + /[^\.]+\.[^\.]+$/.exec(loc.hostname)[0] + '; path=/';
        //doc.cookie = k + '=' + escape(v) + expires + '; path=/';
    };
    var get_cookie = function(k) {
        var n = k + '=';
        var ca = doc.cookie.split(';');
        for(var i=0; i<ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ') { c = c.substring(1); }
            if (c.indexOf(n) == 0) { return unescape(c.substring(n.length, c.length)); }
        }
        return undefined;
    };

    if(!get_cookie('event')) { console.log('The "event" cookie does not exist or is invalid.'); throw 'exit'; }
    if(!get_cookie('re_cnt')) { set_cookie('re_cnt', 0); }
    if(!get_cookie('re_lst')) { set_cookie('re_lst', '[]'); }

    var timer_box = doc.createElement('DIV');
    timer_box.id = 'countdown_timer';
    timer_box.onclick = function() { if(/\bReady\b/i.test(this.textContent)) { wnd.open('https://e-hentai.org/news.php', href=='https://e-hentai.org/news.php'?'_self':'_blank'); } };

    var toggle_re_lst = function() {
        //alert(get_cookie('re_lst'));
        var re_lst_box = doc.getElementById('re_lst_box');
        if(re_lst_box) { re_lst_box.parentNode.removeChild(re_lst_box); return; }
        re_lst_box = doc.createElement('DIV');
        re_lst_box.id = 're_lst_box';
        re_lst_box.style.cssText = 'top:30px; right:0px; position:fixed; z-index:2147483647; background:rgba(0,255,0,1); color:#ff0000;';
        setTimeout(function() { re_lst_box.style.cssText = 'top:30px; right:0px; position:fixed; z-index:2147483647; background:rgba(0,255,0,0.2); color:#ff0000;'; }, 3000);
        re_lst_box.innerHTML = '[ List of Today ]<BR>';
        re_lst_box.onmouseover = function () { this.style.cssText = 'top:30px; right:0px; position:fixed; z-index:2147483647; background:rgba(0,255,0,1); color:#ff0000;'; };
        re_lst_box.onmouseout = function () { this.style.cssText = 'top:30px; right:0px; position:fixed; z-index:2147483647; background:rgba(0,255,0,0.2); color:#ff0000;'; };
        var decode_hv_b64 = function(i, e) {
            var a = doc.createElement('A');
            a.href = 'https://hentaiverse.org/?s=Battle&ss=ba&encounter=' + e;
            a.target = '_blank';
            a.textContent = (i+1) + '. ';
            a.style.cssText = 'color:#ff0000';
            var d = atob(e);
            var m = /([^-]+?)-([^-]+?)-([^-]+)/.exec(d);
            if(m == null) { return a; }
            var uid = m[1];
            var epoch = m[2];
            var hash = m[3];
            var da = new Date();
            da.setTime(parseInt(epoch)*1000);
            da = da.toLocaleTimeString();
            a.textContent += da;
            return a;
        };
        var re_lst = JSON.parse(get_cookie('re_lst'));
        if(re_lst) {
            for(var i=0, len=re_lst.length; i<len; i++) {
                var a = decode_hv_b64(i, re_lst[i]);
                if(i != 0) { re_lst_box.appendChild(doc.createElement('BR')); }
                re_lst_box.appendChild(a);
            }
            doc.body.appendChild(re_lst_box);
        }
    };
    addEventListener('keydown', function(evt) { if((evt.target.tagName!='INPUT') && (evt.target.tagName!='TEXTAREA') && (evt.keyCode == 76)) { toggle_re_lst(); } }, false);
    if(href == 'https://e-hentai.org/news.php') { toggle_re_lst(); }

    var newshead = doc.getElementById('newshead')
    if(newshead && /\/e-hentai\./.test(href)) {
        timer_box.style.color = '#ff0000'
        newshead.appendChild(timer_box)
    } else {
        timer_box.style.cssText = 'line-height:30px; top:0px; right:0px;font-size:16px; position:fixed; z-index:2147483647; background:rgba(0,255,0,0.2); color:#ff0000;'
        doc.body.appendChild(timer_box)
    }

    var update_timer = function() {
        if(href == 'https://e-hentai.org/news.php') {
            var da = new Date();
            if((da.getUTCHours()==0) && (da.getUTCMinutes()==0) && (da.getUTCSeconds()<=10)) {
                if(!/^Your IP.*banned/i.test(doc.body.textContent)) {
                    setTimeout(function() {loc.reload();}, 10000);
                }
            }
        }
        var now = Math.floor(new Date().getTime()/1000);
        var diff = parseInt(get_cookie('event')) + 1815 - now;
        if(isNaN(diff)) { setTimeout(function() {loc.reload();}, 60000); return; };
        if(diff <= 0) {
            timer_box.textContent = 'Ready! re_cnt=' + get_cookie('re_cnt');
            if(href == 'https://e-hentai.org/news.php') {
                if(/^Your IP.*banned/i.test(doc.body.textContent)) {}
                else if(/The site is currently in Read Only\/Failover Mode/i.test(doc.documentElement.innerHTML)) { setTimeout(function() {loc.reload();}, 60000); }
                else { loc.reload(); }
                return;
            }
        } else {
            var mm = Math.floor(diff / 60) + '';
            mm = (mm.length >= 2 ? mm : '0' + mm);
            var ss = Math.floor(diff % 60) + '';
            ss = (ss.length >= 2 ? ss : '0' + ss);
            timer_box.textContent = mm + ':' + ss + ', re_cnt=' + get_cookie('re_cnt');
            if( (mm == '00') || ((mm == '01') && (ss == '00')) ) {
                try {
                    if(doc.getElementById('eventpane').getElementsByTagName('div')[1].getElementsByTagName('a')[0].textContent != 'HentaiVerse') {
                        if(!doc.getElementById('re_snd')) {
                            var audio = new Audio('http://www.freesound.org/data/previews/234/234524_4019029-lq.mp3');
                            audio.id = 're_snd';
                            audio.volume = 1;
                            audio.loop = true;
                            audio.play();
                            doc.body.appendChild(audio);
                        }
                        if(/40|20|10/.test(ss)) { alert('Random Encounter'); }
                    }
                    else {
                        if(doc.getElementById('re_snd')) {
                            doc.getElementById('re_snd').parentNode.removeChild(doc.getElementById('re_snd'));
                        }
                    }
                } catch(e) {}
            }
        }
        setTimeout(update_timer, 1000);
    };
    update_timer();

    var eventpane = doc.getElementById('eventpane');
    if(eventpane != null) {
        var re_evt = eventpane.querySelector('a[onclick*="https://hentaiverse.org/"]');
        //var re_evt = eventpane.getElementsByTagName('div')[1].getElementsByTagName('a')[0];
        if(re_evt) {
            var hv_lnk = '';
            if((/^https:\/\//.test(re_evt.href)) && (!/#/.test(re_evt.href))) { hv_lnk = re_evt.href; }
            else {
                hv_lnk = /.*window\.open\(['"]?([^'"]+)['"]?/.exec(re_evt.onclick.toString().split('\n').join(''));
                if(hv_lnk) { hv_lnk = hv_lnk[1]; }
            }
            if(hv_lnk) {
                hv_b64 = hv_lnk.replace(/.+?&encounter=([^&]*).*/, '$1'); // the base64 encoded part
                var re_lst = JSON.parse(get_cookie('re_lst'));
                if((!re_lst) || (re_lst.length == 0)) { re_lst = []; }
                if(re_lst.indexOf(hv_b64) == -1) { re_lst.push(hv_b64); }
                re_lst = JSON.stringify(re_lst, null, ' ');
                set_cookie('re_lst', re_lst);
                if(doc.getElementById('re_lst_box')) { toggle_re_lst(); toggle_re_lst(); }
            }
            else {
                console.log('Error: There is a random encounter event but the HentaiVerse link cannot be found.');
                throw 'exit';
            }
            re_evt.addEventListener('click', function() {
                if(re_evt.text != 'HentaiVerse') {
                    set_cookie('re_cnt', parseInt(get_cookie('re_cnt'))+1);
                    re_evt.text = 'HentaiVerse';
                    if(doc.getElementById('re_lst_box')) { toggle_re_lst(); toggle_re_lst(); }
                }
                eventpane.style.display = 'block';
            }, false);
        }
        else if(/\bdawn\b/i.test(eventpane.textContent)) {
            set_cookie('re_cnt', 0);
            set_cookie('re_lst', '[]');
            if(doc.getElementById('re_lst_box')) { toggle_re_lst(); toggle_re_lst(); }
        }
    }
}


and clearing cookies

This post has been edited by hc br: Jul 16 2017, 13:23
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 16 2017, 13:52
Post #4642
kuriak



Newcomer
**
Group: Members
Posts: 59
Joined: 28-January 12
Level 285 (Godslayer)


how to get the script works?

- I've installed tampermonkey
- I used proxy to get access hentaiverse

but no changes at all... (IMG:[invalid] style_emoticons/default/sad.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 16 2017, 14:00
Post #4643
Superlatanium



Dreaming of optimizing the system
**********
Group: Gold Star Club
Posts: 7,577
Joined: 27-November 13
Level 500 (Godslayer)


QUOTE(kuriak @ Jul 16 2017, 11:52) *
how to get the script works?
Hard to help if we don't know what script you're trying to use

In any case, check the console for JS errors
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 16 2017, 14:16
Post #4644
kuriak



Newcomer
**
Group: Members
Posts: 59
Joined: 28-January 12
Level 285 (Godslayer)


QUOTE(Superlatanium @ Jul 16 2017, 19:00) *

Hard to help if we don't know what script you're trying to use

In any case, check the console for JS errors


I used HentaiVerse Statistics, Tracking, and Analysis Tool by GaryMcNabb

I've never use script before, I just don't know the script works or not. I can't see the different.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 16 2017, 15:40
Post #4645
friggo



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


QUOTE(kuriak @ Jul 16 2017, 15:16) *

I used HentaiVerse Statistics, Tracking, and Analysis Tool by GaryMcNabb

I've never use script before, I just don't know the script works or not. I can't see the different.


Looking at the last posts in that thread, it would seem that the script is currently broken as a result of the 0.85 update which broke nearly all of the old scripts. Just another casualty, I guess.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 16 2017, 16:28
Post #4646
StrayMav7



Newcomer
*
Group: Members
Posts: 23
Joined: 10-March 17
Level 309 (Godslayer)


Using the latest (I believe) version of hv item manager to mass salvage and find that it fails when trying to do many items at once getting a "state lock limiter in effect" error in the top left of the page.

Anyone know of a fix or update I've missed to get around this?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 16 2017, 20:09
Post #4647
Fap.Fap



Active Poster
*******
Group: Gold Star Club
Posts: 1,551
Joined: 19-October 11
Level 500 (Ponyslayer)


QUOTE(sickentide @ Jul 16 2017, 11:35) *

with my script you can add channeling.png to alertBuffs, set stopOnBuffsExpiring = true and stopOnChannelling = false for it to stop on 1 turn remaining


Im looking for scripts with only those features, I have the rest already.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 17 2017, 01:07
Post #4648
Scremaz



A certain pervert. OT expert. Just dancing around in the game.
***********
Group: Gold Star Club
Posts: 24,304
Joined: 18-January 07
Level 500 (Ponyslayer)


QUOTE(friggo @ Jul 16 2017, 15:40) *

Looking at the last posts in that thread, it would seem that the script is currently broken as a result of the 0.85 update which broke nearly all of the old scripts. Just another casualty, I guess.

seems so. i'm waiting to see if an update pops up. otherwise, if there's another choice please point it out.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 17 2017, 07:40
Post #4649
piyin



Reasons to love the IRS.
***********
Group: Gold Star Club
Posts: 10,797
Joined: 4-February 09
Level 500 (Ponyslayer)


QUOTE(StrayMav7 @ Jul 16 2017, 16:28) *

Using the latest (I believe) version of hv item manager to mass salvage and find that it fails when trying to do many items at once getting a "state lock limiter in effect" error in the top left of the page.

Anyone know of a fix or update I've missed to get around this?


Dont know if anyone have informed you how to "fix" or solve this, there it goes how i dealt with that:

-Turn off the scripot and wait 30 seconds, then refresh the screen. That must solve it.

-If i know why this happened? Nope, but guess something (an update) could have been the culprit. im not sure but as far as i tested it with others scripts, looks to be the case.

- You dont want it to happen? IT WILL HAPPEN AGAIN, if you try to elete more than 10-12 equipments at the same time. So, my suggestion, go 10 by 10 and then there must be no problem.

-Looks like an update is coming for HV item manager soon (it was promised). (IMG:[invalid] style_emoticons/default/wink.gif)

This post has been edited by piyin: Jul 17 2017, 07:41
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 17 2017, 09:13
Post #4650
Beya



Yuru Yuri Yurari~
***
Group: Gold Star Club
Posts: 246
Joined: 27-July 09
Level 500 (Ponyslayer)


I tired to change RE alarm sound from my computer, but didn't work
what should I do?

var audio = new Audio('http://www.freesound.org/data/previews/234/234524_4019029-lq.mp3');
-> var audio = new Audio("C:\Users\BEKK\Documents\KubotaOsamu_Old_Speckled_Reel.mp3");

it's what i'm tried
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 17 2017, 09:24
Post #4651
Superlatanium



Dreaming of optimizing the system
**********
Group: Gold Star Club
Posts: 7,577
Joined: 27-November 13
Level 500 (Godslayer)


QUOTE(Beya @ Jul 17 2017, 07:13) *
I tired to change RE alarm sound from my computer, but didn't work
what should I do?

var audio = new Audio('http://www.freesound.org/data/previews/234/234524_4019029-lq.mp3');
-> var audio = new Audio("C:\Users\BEKK\Documents\KubotaOsamu_Old_Speckled_Reel.mp3");

it's what i'm tried
Javascript cannot access your local machine directly due to security issues (any site can execute JS on your computer by default, after all).

var audio = new Audio("data:audio/wav;base64," + base64string);
audio.play();

You could also put base64string into localStorage or something to avoid cluttering the script if you want
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 17 2017, 13:03
Post #4652
Beya



Yuru Yuri Yurari~
***
Group: Gold Star Club
Posts: 246
Joined: 27-July 09
Level 500 (Ponyslayer)


QUOTE(Superlatanium @ Jul 17 2017, 03:24) *

Javascript cannot access your local machine directly due to security issues (any site can execute JS on your computer by default, after all).

var audio = new Audio("data:audio/wav;base64," + base64string);
audio.play();

You could also put base64string into localStorage or something to avoid cluttering the script if you want



I never learned javascript, so it seems better I upload mp3 file somewhere.

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

 
post Jul 17 2017, 16:07
Post #4653
Maharid



The Sleeper
*******
Group: Catgirl Camarilla
Posts: 2,374
Joined: 27-April 10
Level 500 (Ponyslayer)


QUOTE(sickentide @ Jul 16 2017, 11:35) *
(IMG:[puu.sh] https://puu.sh/wKzqm/acb87c6de7.png)
add up all boosts from abilities and capacitor, in percentages


So, if i have all abilities, Juggernaut and Capacitor i have to set them to 150 and 150?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 17 2017, 21:09
Post #4654
fihero



Active Poster
*******
Group: Gold Star Club
Posts: 1,264
Joined: 25-May 10
Level 500 (Godslayer)


I used HV Item Manager to sell a bunch of junk equip and I got a 'state lock limiter in effect' message. After a minute or so, I can refresh the page everything is fine again, but it does get in the way of bazaaring stuff since not all the stuff selected were bazaared.

Anyone else having this issue?

This post has been edited by fihero: Jul 17 2017, 21:12
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 17 2017, 21:45
Post #4655
Superlatanium



Dreaming of optimizing the system
**********
Group: Gold Star Club
Posts: 7,577
Joined: 27-November 13
Level 500 (Godslayer)


Scroll up just a bit. I guess there's an internal cooldown on how fast POSTs can be sent to the server? Or something like that. It'll probably be easy enough to fix with a bit of setTimeout hacking
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 17 2017, 22:01
Post #4656
fihero



Active Poster
*******
Group: Gold Star Club
Posts: 1,264
Joined: 25-May 10
Level 500 (Godslayer)


Sorry, my bad! (IMG:[invalid] style_emoticons/default/tongue.gif)

Glad it was actually an issue, I thought it was just me with this problem.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 18 2017, 15:47
Post #4657
Gundo Misuzu



Casual Poster
****
Group: Catgirl Camarilla
Posts: 439
Joined: 2-May 13
Level 500 (Godslayer)


QUOTE(Superlatanium @ Jul 17 2017, 21:45) *

Scroll up just a bit. I guess there's an internal cooldown on how fast POSTs can be sent to the server? Or something like that. It'll probably be easy enough to fix with a bit of setTimeout hacking

line 393(item manager ver 1.61): var MAX_CONN = 20;
change number 20 to 3 or less will be better.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 18 2017, 18:32
Post #4658
sickentide



sexromancer
*******
Group: Catgirl Camarilla
Posts: 1,355
Joined: 31-August 10
Level 500 (Ponyslayer)


QUOTE(Maharid @ Jul 17 2017, 16:07) *

So, if i have all abilities, Juggernaut and Capacitor i have to set them to 150 and 150?

sp boost only goes up to 100 so it's that, and 150 + mp boost from armour abilities for mp
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 18 2017, 20:12
Post #4659
longwood



Casual Poster
***
Group: Members
Posts: 150
Joined: 5-January 17
Level 330 (Godslayer)


QUOTE(Superlatanium @ Jul 17 2017, 09:24) *

Javascript cannot access your local machine directly due to security issues (any site can execute JS on your computer by default, after all).

var audio = new Audio("data:audio/wav;base64," + base64string);
audio.play();

You could also put base64string into localStorage or something to avoid cluttering the script if you want

Hi (IMG:[invalid] style_emoticons/default/smile.gif), could u please make the example of it, so the script can play the audio on our hdd? i dont understand the base64string or how to use it?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Jul 18 2017, 23:25
Post #4660
Superlatanium



Dreaming of optimizing the system
**********
Group: Gold Star Club
Posts: 7,577
Joined: 27-November 13
Level 500 (Godslayer)


Google for a base64 encoder, you can use any of them

Eg say I have [reasoningtheory.net] https://reasoningtheory.net/update.mp3

Then I convert it to base64 and get a very long string:
CODE
var base64string = '//uQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAoAABC7wAGBgwM ... ... ...

Turn it into an audio element:
CODE
var audio = new Audio("data:audio/mpeg;base64," + base64string);
audio.play();

Attached File  test.user.js.txt ( 22.6k ) Number of downloads: 54

Or use the console and use something like localStorage.audio = '//uQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAoA ... ... ...
and then your script won't be too long to read because you can use
CODE
var audio = new Audio("data:audio/mpeg;base64," + localStorage.audio);
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


291 Pages V « < 231 232 233 234 235 > » 
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: 31st January 2025 - 05:14