 |
 |
 |
HV Script Thread, Discuss your creations. Includes guidelines and infos for script creation (2020-02-28 upd) |
|
Apr 30 2016, 09:42
|
Superlatanium
Group: Gold Star Club
Posts: 7,647
Joined: 27-November 13

|
Is there anyone here who has experience with indexedDB? LocalStorage isn't big enough. I've been trying to get indexedDB commands and libraries to cooperate with a userscript for hours but it's frustratingly complicated. I only want to work with a single object, such as: CODE //Retrieve from indexedDB, then execute callback obj = dbCall(callback);
//Save to indexedDB, then execute callback dbSave(obj, callback); It seems like it'd be easy, but...
|
|
|
|
 |
|
Apr 30 2016, 12:33
|
t_t_z
Group: Gold Star Club
Posts: 351
Joined: 25-December 12

|
QUOTE(Superlatanium @ Apr 30 2016, 03:42)  Is there anyone here who has experience with indexedDB? LocalStorage isn't big enough. I've been trying to get indexedDB commands and libraries to cooperate with a userscript for hours but it's frustratingly complicated. I only want to work with a single object, such as: CODE //Retrieve from indexedDB, then execute callback obj = dbCall(callback);
//Save to indexedDB, then execute callback dbSave(obj, callback); It seems like it'd be easy, but... Not sure if it'll help, but here's part of custom code in one of my scripts: Creating DB: CODE function updateMonsterDatabaseFunction(evt) { var files = evt.target.files; // FileList object
var reader = new FileReader();
// Closure to capture the file information. reader.onload = (function(theFile) { return function(e) { var monsterData = tsvJSON(reader.result); dbVersion = dbVersion + 1; localStorage['HVMonsterBestiaryIndexedDbVersion_' + dbName] = dbVersion; var request = window.indexedDB.open(dbName, dbVersion); request.onerror = function(event) { console.log("Error opening indexedDB"); }; request.onupgradeneeded = function(event) { var monsterDatabase = event.target.result; var objectStore = monsterDatabase.createObjectStore("monsters", { keyPath: "Name" }); objectStore.transaction.oncomplete = function(event){ var monsterObjectStore = monsterDatabase.transaction("monsters", "readwrite").objectStore("monsters"); for(var i in monsterData){ monsterObjectStore.add(monsterData[i]); } }; }; request.onsuccess = function(event){ database = event.target.result; }; }; })(files[0]); reader.readAsText(files[0]); } document.getElementById('updateMonsterDatabase').addEventListener('change', updateMonsterDatabaseFunction, false);
Reading from DB: CODE
function updateMonster(targetDOM){ if(targetDOM.children[2].children[0].children[0].src == 'http://hentaiverse.org/y/s/nbardead.png'){ localStorage['priority_' + targetDOM.id] = Number.MIN_SAFE_INTEGER; return; } var monsterName = targetDOM.children[1].children[0].textContent; var request = window.indexedDB.open(dbName); request.onsuccess = function(event){ database = event.target.result; var transaction = database.transaction(["monsters"]); var objectStore = transaction.objectStore("monsters"); var getRequest = objectStore.get(monsterName); getRequest.onsuccess = function(event) { var monsterLvl = parseInt(targetDOM.children[0].children[1].textContent,10); var monsterHPString = targetDOM.children[2].children[0].children[1].textContent; var monsterMaxHP = parseInt(monsterHPString.slice(monsterHPString.indexOf("/")+2),10); localStorage['priority_' + targetDOM.id] = getMonsterPriority(getRequest.result, monsterLvl, monsterMaxHP); //targetDOM.children[0].innerHTML = "L" + monsterLvl + "<br />" + "P" + getRequest.result["Power Lvl"] + "<br />" + getRequest.result["Class"]; }; getRequest.onerror = function(event){ localStorage['priority_' + targetDOM.id] = 0;//not in database; probably newly created and thus weak console.log("Error in getting from database"); console.log(event); }; }; request.onerror = function(event){ console.log("Error in opening " + dbName); console.log(event); }; request.onupgradeneeded = function(event){ event.target.transaction.abort();//DB doesn't exist; abort and don't create }; }
What exactly are you trying to do?
|
|
|
|
 |
|
Apr 30 2016, 14:14
|
Superlatanium
Group: Gold Star Club
Posts: 7,647
Joined: 27-November 13

|
QUOTE(tonytyzhang @ Apr 30 2016, 10:33)  Not sure if it'll help, but here's part of custom code in one of my scripts:
What exactly are you trying to do? Thanks. All I want is to be able to save and retrieve one object. Prior code was CODE localStorage.SmartSearch = JSON.stringify(SmartSearch); //or SmartSearch = JSON.parse(localStorage.SmartSearch); See what I posted yesterday. Once I can do the equivalent of that, I can handle everything else pretty easily. I might have gotten it, but it still feels absurd to need a few pages of code with IndexedDB instead of just a couple of lines with localStorage. The only reason I'm switching to IndexedDB is because localStorage's size limit is too small. It took me some more hours of trial and error but I think I've got it working... maybe... in FF. We'll see... but it really feels like I'm doing something wrong when I need so many nested structures {domain => database name => objectStore => objectStoreKeyName => .get('1') } just to read and write my single data variable. This post has been edited by Superlatanium: Apr 30 2016, 19:06
|
|
|
|
 |
|
Apr 30 2016, 17:20
|
Barov
Group: Members
Posts: 105
Joined: 20-March 15

|
QUOTE(hansvar92 @ Apr 27 2016, 16:53)  CracklingCast img src fix for hv v0.84 and add hover area. [attachmentid=84663] fix3 - Fixed bug: Invalid target This is temporary fix. I wait for simrock87's next update. Description: hereChanges: Replace Spirit Stance image and Full-Cure. Add hover area option. Add stop when channeling buff and channeling buff image. Change ccrack icon order. This change will make consume item order. Settings.heal_rotation, channeling, gem, hp-mp-sp draught-potion-elixir, expire buff. Do you know how to change the gem/heal icons to activate on click rather than mouseover? Also, would commenting out 507-518 simply prevent pausing for mana pots? This post has been edited by Barov: Apr 30 2016, 17:40
|
|
|
|
 |
|
Apr 30 2016, 19:14
|
Rhydin
Group: Gold Star Club
Posts: 887
Joined: 5-June 15

|
QUOTE(Barov @ Apr 30 2016, 17:20)  Do you know how to change the gem/heal icons to activate on click rather than mouseover?
This has been answered before already (couple pages back by now I guess): Change the script like this (should be line 712) function placeDisplay(icon, style, action) { var img = document.getElementsByClassName('btp')[0].appendChild(document.createElement('img')); img.id = 'h'; img.className = 'ccrack'; img.src = icon; img.style.cssText = style; img.onclick = action; QUOTE(Barov @ Apr 30 2016, 17:20)  Also, would commenting out 507-518 simply prevent pausing for mana pots?
Maybe by changing CODE Common.state.paused = true into false
|
|
|
|
 |
|
May 1 2016, 04:43
|
NerfThis
Group: Catgirl Camarilla
Posts: 2,467
Joined: 3-February 14

|
QUOTE(Barov @ May 1 2016, 00:20)  Do you know how to change the gem/heal icons to activate on click rather than mouseover?
Also, would commenting out 507-518 simply prevent pausing for mana pots?
I update CracklingCast fix4 CracklingCast_v1_0_3_fix4.user.js.zipSee DescriptionAnd you should be edit code. CODE if (hasGem()) { var g = document.getElementById('ikey_p').getAttribute('onmouseover'); var type = g.slice(26, g.indexOf(' Gem')); var icon = ""; switch (type) { case 'Mystic': icon = 'channeling.png'; break; case 'Health': icon = 'healthpot.png'; break; case 'Mana': icon = 'manapot.png'; break; case 'Spirit': icon = 'spiritpot.png'; break; } placeDisplay('/y/e/' + icon, "", function () { useGem(); }, true, 0); }
if (hp <= Settings.limits.heal) { var healAction = heal(); if (healAction !== false) { placeDisplay(healAction[0], healAction[1], healAction[2], true, 0); } Common.state.paused = true; }
And if you want prevent pausing, //Common.state.paused = true; (not false, if set to false, above Common.state.paused value is change) CODE if (mp <= Settings.limits.mpotion && canUseItem('mpotion')) { placeDisplay(Icons.MPotion, 'width: 26px; height: 26px; border: 2px solid blue', function () { useItem('mpotion') }); //Common.state.paused = true; }
I test few rounds on Iron v31 with reloader vanilla reloader. This post has been edited by hansvar92: May 1 2016, 05:06
|
|
|
|
 |
|
May 1 2016, 23:47
|
esam
Group: Members
Posts: 2,193
Joined: 23-January 16

|
Ffs, no clue what I did but tried to remove the spirit stance icon since it would not disappear after being activated. Whilst trying that all icons have disappeared, when undoing what I did the icons will not come back. Only two scripts activated, cracklingcast and reloader Shouldn't have touched it mid DwD (IMG:[ invalid] style_emoticons/default/cry.gif) edit:i fiddled around in cracklingcast, didn't touch reloader This post has been edited by esam: May 2 2016, 00:05
|
|
|
|
 |
|
May 2 2016, 01:32
|
ginjok
Group: Gold Star Club
Posts: 1,736
Joined: 23-April 12

|
QUOTE(tatarime @ Apr 29 2016, 01:17)  And Mana Draught is this way: CODE !$Replenishment; Mana Draught; Health = Regeneration, Spirit = Refreshment Try it. (IMG:[ invalid] style_emoticons/default/smile.gif) Thanks. (IMG:[ invalid] style_emoticons/default/smile.gif) But it seems to increase the usage of Draughts, as it "recasts" as soon as it is available again, and it doesn't "work" on the first round (initial casting has to be done manually?).
|
|
|
|
 |
|
May 2 2016, 04:31
|
NerfThis
Group: Catgirl Camarilla
Posts: 2,467
Joined: 3-February 14

|
QUOTE(esam @ May 2 2016, 06:47)  Ffs, no clue what I did but tried to remove the spirit stance icon since it would not disappear after being activated. Whilst trying that all icons have disappeared, when undoing what I did the icons will not come back. Only two scripts activated, cracklingcast and reloader Shouldn't have touched it mid DwD (IMG:[ invalid] style_emoticons/default/cry.gif) edit:i fiddled around in cracklingcast, didn't touch reloader try my fixand if you don't want accidentally multiple actions at a turn, you should be use reloader fix, too.
|
|
|
|
 |
|
May 2 2016, 04:41
|
tatarime
Group: Gold Star Club
Posts: 802
Joined: 23-June 10

|
QUOTE(ginjok @ May 2 2016, 08:32)  Thanks. (IMG:[ invalid] style_emoticons/default/smile.gif) But it seems to increase the usage of Draughts, as it "recasts" as soon as it is available again, and it doesn't "work" on the first round (initial casting has to be done manually?). OK, please try this version. Spell Spam #Reloader 3.5.2.16
|
|
|
|
 |
|
May 2 2016, 12:06
|
Superlatanium
Group: Gold Star Club
Posts: 7,647
Joined: 27-November 13

|
SmartSearch 1.2.1
SmartSearch_1.2.1.user.js.txt ( 24.44k )
Number of downloads: 70
See latest post for the most up-to-date version See first post here for initial info Changes: The catastrophic localStorage error has been fixed. - Now uses IndexedDb instead of localStorage, because the sheer amount of saved text in forums (millions of characters) could not be held given localStorage's small size limit. You need a browser that supports IndexedDb. (The latest versions of Firefox and Chrome are fine)
- On left-click, links are opened in a new tab instead of replacing the SmartSearch about:blank page. I still suggest using control-click though.
- Links other than to hentaiverse.org are no longer saved in the database
- 4 new columns: eid, price, thread saved timestamp, post edited timestamp.
- Posts that were edited more than 60 days ago, or that were saved in the database more than 60 days ago, are now highlighted to warn you that the poster may not be active.
- The ignore interface now has a button that lets you delete the thread from the database completely.
- Various other minor fixes
- Options: As seen at the top of the script, you may change the day limit before posts are marked as old (different color), as well as a couple other things.
 (If you were using the temporary version 1.1.2 I secretly edited into my post yesterday, you'll need to uncomment dbDelete at the top and run the script, and afterwards similarly uncomment dbCreate and run the script) Many things are different, so there are almost certainly still a couple problems here and there. Please let me know if you run into any of them. This post has been edited by Superlatanium: May 3 2016, 08:34
|
|
|
|
 |
|
May 2 2016, 20:39
|
another planet
Group: Gold Star Club
Posts: 389
Joined: 10-January 11

|
zzzzzz
reloader 1.2 still great..
This post has been edited by hunter80906: May 2 2016, 20:41
|
|
|
May 3 2016, 08:33
|
Superlatanium
Group: Gold Star Club
Posts: 7,647
Joined: 27-November 13

|
SmartSearch 1.2.2
SmartSearch_1.2.2.user.js.txt ( 24.57k )
Number of downloads: 147 * Fixed an issue when Saving would fail when reading a thread with a poll you had voted on
|
|
|
May 3 2016, 12:08
|
pervdiz
Group: Members
Posts: 444
Joined: 27-October 09

|
Does reloader 1.3.3b work with Firefox 32 ? Item Manager 1.5, HV Counter Save 1.2.1 and Income Summary 1.4.6 seem to do their job but Reloader doesn't seem to do anything.
Also I have a weird thing with keybinds, #4 can attack once or twice but then opens some kind of console and inputs this sign : ' (which is lowercase for 4 on french keyboards), and I have to exit it by hitting esc or clicking some monster/spell.
|
|
|
May 3 2016, 13:42
|
FabulousCupcake
Group: Gold Star Club
Posts: 496
Joined: 15-April 14

|
QUOTE(pervdiz @ May 3 2016, 12:08)  Does reloader 1.3.3b work with Firefox 32 ? Item Manager 1.5, HV Counter Save 1.2.1 and Income Summary 1.4.6 seem to do their job but Reloader doesn't seem to do anything.
No idea; need to read the release notes from FF32-FF4X to check that. May I know why you're using non-latest-version browser?
|
|
|
|
 |
|
May 3 2016, 14:20
|
pervdiz
Group: Members
Posts: 444
Joined: 27-October 09

|
QUOTE(FabulousCupcake @ May 3 2016, 13:42)  No idea; need to read the release notes from FF32-FF4X to check that. May I know why you're using non-latest-version browser?
I'm using FF only for HV purposes, I tried this version because somebody told me it worked fine and wasn't a ressource hog. I kinda distrust latest versions of browsers, here at work I use chrome 50 b/c it's default, and at home I use some recent version of opera that lacks most of the features I liked about opera few years ago (IMG:[ invalid] style_emoticons/default/dry.gif) I don't really know which browser to use nowadays, all of them seem to use blink anyway (IMG:[ invalid] style_emoticons/default/mellow.gif)
|
|
|
|
 |
|
May 3 2016, 16:55
|
boulay
Group: Gold Star Club
Posts: 2,675
Joined: 27-June 11

|
Ambience Series[attachmentid=84993]
Ambience_Choco_0.2.css ( 40.57k )
Number of downloads: 68[attachmentid=84995] [attachmentid=84999] Changelog: - Fixed the dark text in the attachment page (dark text+dark background doesn't really work...) - Changed some forgotten pics dunno if there's still some... - There are Chrome/Opera versions now \o/ Screenshots: Note: The NoStylish file doesn't work on Chrome, use the .crx or .nex
|
|
|
|
 |
|
May 4 2016, 10:50
|
Anemone
Group: Gold Star Club
Posts: 865
Joined: 16-May 13

|
Hi everyone! Is there anyone can help me please? I have a problem with Reloader_vanilla_v1.1.1_fix and CracklingCast_v1_0_3_fix5 but they are still alive The explain on ehwiki is Stop beating dead horses: Occurs when a player executes an attack against an already eliminated enemy. This is most commonly triggered by a spell's status effect dealing damage to a dead foe though it can also be caused when a player visits a past version of the page and tries to attack a currently dead enemy. What can i do about the problem?
This post has been edited by Anemona7: May 9 2016, 07:00
|
|
|
|
 |
|
May 4 2016, 11:27
|
anon079
Lurker
Group: Recruits
Posts: 7
Joined: 30-April 16

|
Hi, i just installed Equipement Comparison Script and can't get it to work.
I followed instructionin those threads showtopic=192652 showtopic=191192
After getting the popup from pressing C, using the other keybinds from the script just gets me a "EC Loading..." message which almost instantly disappear. The stats displayed don't change at all. I tried all the keybinds only the wikipedia one gives a different result (i get a message box with a date).
Where could the problem be coming from ?
|
|
|
|
 |
|
May 4 2016, 12:23
|
f4tal
Group: Members
Posts: 2,662
Joined: 10-January 13

|
QUOTE After getting the popup from pressing C, using the other keybinds from the script just gets me a "EC Loading..." message which almost instantly disappear. The stats displayed don't change at all. I tried all the keybinds only the wikipedia one gives a different result (i get a message box with a date).
Can you tell, please, version of Equipment Comparison Script you have download (nowadays actual version is 0.6.5.2) And tell us your browser and his version? ^^ QUOTE Hi everyone! Is there anyone can help me please? It looks like Reloader do not update properly status of enemies (they are dead already, but for script they are alive). Just wildguesing - please try to switch off Vanilla Reloader 1.1.1. and install Reloder 1.3.3b: https://forums.e-hentai.org/index.php?s=&am...t&p=4441690Will this fix your problem? If so - this mean that Vanilla Reloader have some kind of bugs in and should be fixed =/ This post has been edited by f4tal: May 4 2016, 12:24
|
|
|
|
 |
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
|
 |
 |
 |
|