|
|
|
HV Script Thread, Discuss your creations. Includes guidelines and infos for script creation (2020-02-28 upd) |
|
Jul 16 2017, 13:20
|
hc br
Group: Catgirl Camarilla
Posts: 3,684
Joined: 18-October 15
|
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/codebut 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
|
|
|
|
|
|
Jul 16 2017, 13:52
|
kuriak
Newcomer
Group: Members
Posts: 59
Joined: 28-January 12
|
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)
|
|
|
Jul 16 2017, 14:00
|
Superlatanium
Group: Gold Star Club
Posts: 7,577
Joined: 27-November 13
|
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
|
|
|
Jul 16 2017, 14:16
|
kuriak
Newcomer
Group: Members
Posts: 59
Joined: 28-January 12
|
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 GaryMcNabbI've never use script before, I just don't know the script works or not. I can't see the different.
|
|
|
Jul 16 2017, 15:40
|
friggo
Group: Gold Star Club
Posts: 2,134
Joined: 9-October 14
|
QUOTE(kuriak @ Jul 16 2017, 15:16) I used HentaiVerse Statistics, Tracking, and Analysis Tool by GaryMcNabbI'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.
|
|
|
Jul 16 2017, 16:28
|
StrayMav7
Newcomer
Group: Members
Posts: 23
Joined: 10-March 17
|
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?
|
|
|
Jul 16 2017, 20:09
|
Fap.Fap
Group: Gold Star Club
Posts: 1,551
Joined: 19-October 11
|
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.
|
|
|
Jul 17 2017, 01:07
|
Scremaz
Group: Gold Star Club
Posts: 24,304
Joined: 18-January 07
|
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.
|
|
|
|
|
|
Jul 17 2017, 07:40
|
piyin
Group: Gold Star Club
Posts: 10,797
Joined: 4-February 09
|
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
|
|
|
|
|
|
Jul 17 2017, 09:13
|
Beya
Group: Gold Star Club
Posts: 246
Joined: 27-July 09
|
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
|
|
|
|
|
|
Jul 17 2017, 09:24
|
Superlatanium
Group: Gold Star Club
Posts: 7,577
Joined: 27-November 13
|
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
|
|
|
|
|
|
Jul 17 2017, 13:03
|
Beya
Group: Gold Star Club
Posts: 246
Joined: 27-July 09
|
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)
|
|
|
Jul 17 2017, 16:07
|
Maharid
Group: Catgirl Camarilla
Posts: 2,374
Joined: 27-April 10
|
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?
|
|
|
Jul 17 2017, 21:09
|
fihero
Group: Gold Star Club
Posts: 1,264
Joined: 25-May 10
|
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
|
|
|
Jul 17 2017, 21:45
|
Superlatanium
Group: Gold Star Club
Posts: 7,577
Joined: 27-November 13
|
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
|
|
|
Jul 17 2017, 22:01
|
fihero
Group: Gold Star Club
Posts: 1,264
Joined: 25-May 10
|
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.
|
|
|
Jul 18 2017, 15:47
|
Gundo Misuzu
Group: Catgirl Camarilla
Posts: 439
Joined: 2-May 13
|
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.
|
|
|
Jul 18 2017, 18:32
|
sickentide
Group: Catgirl Camarilla
Posts: 1,355
Joined: 31-August 10
|
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
|
|
|
Jul 18 2017, 20:12
|
longwood
Group: Members
Posts: 150
Joined: 5-January 17
|
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?
|
|
|
|
|
|
Jul 18 2017, 23:25
|
Superlatanium
Group: Gold Star Club
Posts: 7,577
Joined: 27-November 13
|
Google for a base64 encoder, you can use any of them Eg say I have [ reasoningtheory.net] https://reasoningtheory.net/update.mp3Then 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();
test.user.js.txt ( 22.6k )
Number of downloads: 54Or 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);
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
|
|
|
|
|