Welcome Guest ( Log In | Register )

2 Pages V  1 2 >  
Closed TopicStart new topic
> Countdown Timer for Random Encounter Events on E-Hentai, press L to see a list of all previous RE URLs

 
post Aug 7 2014, 02:44
Post #1
djackallstar



ดีjackallstar
**********
Group: Gold Star Club
Posts: 8,191
Joined: 23-July 14
Level 500 (Godslayer)


If you want to report bugs or request features, please send me a PM,
because I don't visit this subforum very often.

(IMG:[invalid] style_emoticons/default/heh.gif)

===

Changelog
2014/08/10
- Added the feature Dan31 requested, and rewrote part of the post to introduce the new feature.
- Added a technical introduction on how to save URLs of Random Encounter events for later visits.

2014/08/07
- Initial post.

===

What's this?
Hello everyone!
I've written a userscript that displays a countdown timer for the Random Encounter event
on e-hentai.org and .e-hentai.org (subdomains) such as forums.e-hentai.org, g.e-hentai.org.

Features
1. A countdown timer that always on the top right side of the window. (It follows you when you scroll up/down/left/right)

2. You can press the "L" key to toggle a list showing URLs of all previous Random Encounter events.
This is very useful, in case you accidentally close a tab that contains a link to a Random Encounter event, or your web browser crashes unexpectedly.
The list is stored in a semi-persistent cookie, so even if you close the web browser it still exists.
The cookie will only be reset when you trigger the "The Dawn of A New Day" event.

3. Automatically saving every URL of a Random Encounter event.
If you want to use this function, just open "https://e-hentai.org/", and the script will refresh the page whenever the countdown timer reaches 00:00.
After the page is refreshed and if a Random Encounter event occurs, its URL will be saved into the "re_lst" cookie.

4. All the URLs of Random Encounter events are sorted by time, from oldest to newest.
And they are displayed using the time format you are familiar with, based on your OS/browser locale.

Demo pictures
(IMG:[i.imgur.com] http://i.imgur.com/oRSxMnF.png)

(IMG:[i.imgur.com] http://i.imgur.com/mpL69O0.png)

(IMG:[i.imgur.com] http://i.imgur.com/hQ4X9ZZ.png)

What's the difference between this script and hvren.user.js?
You don't have to do anything after installing this script.
On the other hand, using hvren.user.js, a user have to manually set/reset the timer because it cannot update the time based on the "event" cookie set by the E-Hentai server.
This script keeps track of URLs of Random Encounter events, while hvren.user.js doesn't.

How to install?
Step 1. Install a userscript manager such as
Greasemonkey (for Firefox), Tampermonkey (for Chrome), or Violentmonkey (for Opera).
Step 2. Install my script: [github.com] https://github.com/djackallstar/Userscripts...-Hentai.user.js

Usage
You don't have to do anything after installing the script,
because the script will automatically update the time based on the "event" cookie set by e-hentai.org and .e-hentai.org.
(IMG:[i.imgur.com] http://i.imgur.com/2Z1Wvxb.png)
You can press the "L" key to toggle the list of URLs of all previous Random Encounter events.
Also see the Features section.

Cookies set by this script
1. re_cnt
Its value is the number of times you've triggered and clicked a URL a Random Encounter event,
and it will be reset to 0 when you trigger the "The Dawn of A New Day" event.
When the timer has counted down to zero, you can then click the timer box, and it will lead you to the E-Hentai front page for you to trigger the Random Encounter event.

2. re_lst
Its contains base64-encoded strings in the URLs of all previous Random Encounter events.
The reason I don't save the entire URL is to save space, since cookies on a domain is usually restricted to a size of 4K.
This cookie will be reset when you trigger the "The Dawn of A New Day" event.

TODO
- Add support for hentaiverse.org and ehwiki.org, with the help of GM_getValue and GM_setValue.
- Customization of the timer box, such as its initial coordinate, text size and color.
- Make the timer box draggable.

Known Bugs
Sometimes the counter does not reset after a new patch has come. Clear the "re_lst" and "re_cnt" cookies to solve the problem.
(IMG:[i.imgur.com] http://i.imgur.com/8uTaet5.png)

Technical discussion (for developers)
https://forums.e-hentai.org/index.php?showtopic=169382

This post has been edited by djackallstar: Aug 21 2015, 18:58
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 7 2014, 10:32
Post #2
Dan31



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


Interesting. You should post it in the Script Thread.

Also, feature request: keep in memory unclicked RE links (you can easily miss them when browsing the galleries). And the links probably need to be clicked in order (?), so only display the older one. (I'm not sure how long a link is valid, is it till a more recent RE or DOTND is triggered?)

This post has been edited by Dan31: Aug 7 2014, 10:54
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 7 2014, 10:40
Post #3
Cats Lover



Peerless Cat's Lover of 1H Power (since 0 lvl)
********
Group: Gold Star Club
Posts: 2,800
Joined: 18-April 13
Level 500 (Godslayer)


A good script and good information, thanks! (IMG:[invalid] style_emoticons/default/smile.gif)
As dan31 said, posting this to script thread would make more people can view this.

This post has been edited by Cats Lover: Aug 7 2014, 10:42
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 7 2014, 10:47
Post #4
Pillowgirl



Grammatically Incorrect (☞゚∀゚)☞
*********
Group: Gold Star Club
Posts: 5,100
Joined: 2-December 12
Level 479 (Godslayer)


I already have a script, why do i need one that works on the forum and keeps track of my encounters + more lines of code to slow it all down?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 7 2014, 11:21
Post #5
Dan31



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


QUOTE(Pillowgirl @ Aug 7 2014, 10:47) *

I already have a script, why do i need one that works on the forum and keeps track of my encounters + more lines of code to slow it all down?

It would take some serious effort to make a script like that "slow it all down" in any noticable way. Rendering takes far more time.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 7 2014, 12:07
Post #6
holy_demon



Osananajimi<3
*********
Group: Gold Star Club
Posts: 5,417
Joined: 2-April 10
Level 500 (Godslayer)


QUOTE(djackallstar @ Aug 7 2014, 10:44) *


The "re_cnt" cookie is set by the script, its value is the number of times you've triggered the Random Encounter event, and it will be reset to 0 when you trigger the "The Dawn of A New Day" event.
When the timer has counted down to zero, you can then click the timer box, and it will lead you to the E-Hentai front page for you to trigger the Random Encounter event.


Interesting find on the cookie. I planned to release my private version that auto-visit the ehentai page, collect the RE link and update time accordingly, but yours seems better.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 7 2014, 12:44
Post #7
holy_demon



Osananajimi<3
*********
Group: Gold Star Club
Posts: 5,417
Joined: 2-April 10
Level 500 (Godslayer)


QUOTE(Dan31 @ Aug 7 2014, 19:21) *

It would take some serious effort to make a script like that "slow it all down" in any noticable way. Rendering takes far more time.


Nah it doesn't need much effort. Something like this does the job just fine

CODE
while(1);



QUOTE(Pillowgirl @ Aug 7 2014, 18:47) *

I already have a script, why do i need one that works on the forum and keeps track of my encounters + more lines of code to slow it all down?


Because you're too lazy to write the script yourself =_=

This post has been edited by holy_demon: Aug 7 2014, 12:44
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 10 2014, 04:33
Post #8
djackallstar



ดีjackallstar
**********
Group: Gold Star Club
Posts: 8,191
Joined: 23-July 14
Level 500 (Godslayer)


QUOTE(Dan31 @ Aug 7 2014, 16:32) *

Also, feature request: keep in memory unclicked RE links (you can easily miss them when browsing the galleries). And the links probably need to be clicked in order (?), so only display the older one. (I'm not sure how long a link is valid, is it till a more recent RE or DOTND is triggered?)


Done.

(There might be some bugs since I've only tested it for one day, please report it to me if you find any bug.)

I rewrote part of the original post to introduce the new feature,

and here are all the details of how I implemented it, if you are interested:

https://forums.e-hentai.org/index.php?showtopic=169382

This post has been edited by djackallstar: Aug 10 2014, 11:42
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 20 2014, 18:50
Post #9
garm0



Active Poster
*******
Group: Members
Posts: 1,871
Joined: 1-January 10
Level 436 (Godslayer)


Thank you for your script, really useful, I love it!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 21 2014, 18:34
Post #10
garm0



Active Poster
*******
Group: Members
Posts: 1,871
Joined: 1-January 10
Level 436 (Godslayer)


Hmmm after testing it today, I see at least one major flaw which could be corrected easily I think.

I keep my browser open 24/7, and your script only keeps track of 24 RE links max during a day, where it should keep them all from a reset to another.

Basically you should extend the list visible with "L" to 48 links (or 47 since one is the new dawn event I guess)

Because when I get some sleep, some links saved by your script expire and they count towards the limit of 24 while I can't play these RE.

Otherwise, it is a great script and when you will correct this little thing, I am gonna use it 24/7.

Thanks.

edit: maybe I am wrong and maybe the system generates only 24 links per day, played or not, so your script does not help that much in fact, unless you could add a scheduler?

This post has been edited by garm0: Aug 21 2014, 19:23
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 22 2014, 04:58
Post #11
djackallstar



ดีjackallstar
**********
Group: Gold Star Club
Posts: 8,191
Joined: 23-July 14
Level 500 (Godslayer)


Facts found based on posts in this thread and ehwiki
1). At most 24 RE links are generated per day.
2). A RE link expires one hour after its generation.

The "major flaw" you mentioned is intended due to 1).
This script can be useful in situations like the front page being closed accidentally, the browser/computer crashing unexpectedly, and one being AFK less than one hour or so; however, due to 2), the saved RE links are not that useful as I expected before finishing this script. (IMG:[invalid] style_emoticons/default/sad.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 22 2014, 18:05
Post #12
garm0



Active Poster
*******
Group: Members
Posts: 1,871
Joined: 1-January 10
Level 436 (Godslayer)


Yeah, I have checked all this today, yesterday was the first day I ve seen all the 24 RE links generated for me actually.

I juste need to remember to turn your script off when I go afk for more than 1 hour so no RE link is generated while I am away!

Anyway I like that script, and it is useful, I don't have to stop doing things anymore to play that RE encounter, I can keep working for 59 mins before I have to bother with REs, and then I can chain 2 or 3 in a row!

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

 
post Aug 22 2014, 18:14
Post #13
Pillowgirl



Grammatically Incorrect (☞゚∀゚)☞
*********
Group: Gold Star Club
Posts: 5,100
Joined: 2-December 12
Level 479 (Godslayer)


QUOTE(garm0 @ Aug 23 2014, 02:05) *

Yeah, I have checked all this today, yesterday was the first day I ve seen all the 24 RE links generated for me actually.

I juste need to remember to turn your script off when I go afk for more than 1 hour so no RE link is generated while I am away!

Anyway I like that script, and it is useful, I don't have to stop doing things anymore to play that RE encounter, I can keep working for 59 mins before I have to bother with REs, and then I can chain 2 or 3 in a row!

RE is every 30 minutes bro.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 22 2014, 20:22
Post #14
garm0



Active Poster
*******
Group: Members
Posts: 1,871
Joined: 1-January 10
Level 436 (Godslayer)


I know they occur every 30 mins now, but the script saves up the RE links so I can do them later on, which is, to me, its main interest.
And the links expire only after one hour.

So every 59 mins, I can start doing the RE that was generated 59 mins ago, and then chain up with the one generated 29 mins ago and then, obviously, I get to play the one generated 1 min after I started doing REs.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 27 2014, 00:18
Post #15
Skillout



Casual Poster
****
Group: Members
Posts: 409
Joined: 18-August 14
Level 169 (Destined)


Thanks for the script. It is very useful.

I encountered a minor bug. When you are replying a post and want to change the text color appears the timer and you can not use the colors that are under it.

[i.imgur.com] http://i.imgur.com/J8cQwnv.png

This post has been edited by Skillout: Aug 27 2014, 01:30
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Aug 27 2014, 11:50
Post #16
djackallstar



ดีjackallstar
**********
Group: Gold Star Club
Posts: 8,191
Joined: 23-July 14
Level 500 (Godslayer)


QUOTE(Skillout @ Aug 27 2014, 06:18) *

Thanks for the script. It is very useful.
I encountered a minor bug. When you are replying a post and want to change the text color appears the timer and you can not use the colors that are under it.
[i.imgur.com] http://i.imgur.com/J8cQwnv.png

Fixed.
(IMG:[i.imgur.com] http://i.imgur.com/HsPOIBx.png)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Sep 4 2014, 06:03
Post #17
gynew



Hungry Wolf
*******
Group: Members
Posts: 2,019
Joined: 27-December 08
Level 407 (Godslayer)


Hi,

I don't know what is going on or if I'm doing something wrong but the script it's not showing me any URLs of previous Random Encounters.

I installed it earlier today using the link in the first topic. (I use Firefox and have Windows 7 in case that's relevant)

The countdown timer works fine and the page refresh itself when the timer reaches 00:00 but It doesn't show URLs of previous Random Encounter events. When I press the "L" key I do get the message [List of RE Events Occurred Today] but nothing more.
Another thing that has catched my attention is that the re_cnt number is always 0, no matter if I fight the Random Encounter event or I let it pass.

I have cleared my cookies, restarted the browser and nothing. One "Dawn of A New Day" event has passed but made no difference.

Any help will be very much appreciated.

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

 
post Sep 5 2014, 10:24
Post #18
djackallstar



ดีjackallstar
**********
Group: Gold Star Club
Posts: 8,191
Joined: 23-July 14
Level 500 (Godslayer)


QUOTE(gynew @ Sep 4 2014, 12:03) *

-snip-

Hello gynew, can you please follow these steps:
A1) Open Firefox, Tools > Options > Privacy > Show Cookies > Search "e-hentai.org" (without quotes) > Select them all > Remove Cookies
(I know you said you have removed the cookies, but bear with me, please do what I'm saying once ^^")
A2) Uninstall my script and reinstall it again.
A3) Go to https://e-hentai.org/ and press Ctrl+Shift+J to open the console, and wait for a RE to happen.
A4) After a RE happens and the page refreshes, press lowercase L to check if its URL has been saved, and whether the value of re_cnt becomes 1.

If the script does works for you now, then congrats!
If not, please screenshot all the content in the console and show them to me.
And also, press Ctrl+Shift+I (this time not J!), type the following command and press Enter
alert(document.cookie.split('; '))

Screenshot the text shown and show it to me, too.
Note: Hide "ipb_member_id=xxx" and "ipb_pass_hash=yyy" in the screenshot, because they are your login information.

Btw I have done the following test (B1~B7) under WinXP, Fx 30, GM 2.2 and the script works fine.
B1) Open cmd.exe
B2) Type the following commands
cd "C:\Program Files\Mozilla Firefox"
firefox -P

B3) Create Porfile > Next > Finish > Double-click the profile you just created.
B4) After Firefox starts, go to google.com, search for "greasemonkey", install the GreaseMonkey addon, restart Firefox.
B5) After Firefox restarts, go to the [greasyfork.org] Countdown Timer download page, install my script.
B6) Go to https://e-hentai.org/ and wait for a RE to happen.
B7) After a RE happens and the page refreshes, press lowercase L to check if its URL has been saved, and whether the value of re_cnt becomes 1.

If A1~A4 fails for you, please do B1~B7 and tell me the result, thank you~
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Sep 6 2014, 12:28
Post #19
gynew



Hungry Wolf
*******
Group: Members
Posts: 2,019
Joined: 27-December 08
Level 407 (Godslayer)


Thanks for answering djackallstar,

I tried A1~A4 with no success and I took the screenshots you tell me to. However, before trying B1~B7, I tried first deactivating all the usercripts I have, except of course "Countdown Timer for the Random Encounter Event" and it finally worked fine.

After lots of trial and error and waiting times for the RE events to happen, I have found that the script that's preventing your script to work properly is "hv popup remover 1.1" I downloaded it sometime this year, nevertheless after a long time looking for it, I couldn't find where I downloaded it or its creator. Anyway the function of the script is quite simple: It makes the Random Encounter event to open in a new tab instead of a new window.

I don't understand why it prevents your script from saving/showing the RE URLs, but apparently the re_cnt value only changes when the RE event opens in a new window.

I find the hv popup remover quite practical and useful, do you think is there a way for both scripts to work?

Thank you again for your help.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Sep 6 2014, 13:13
Post #20
holy_demon



Osananajimi<3
*********
Group: Gold Star Club
Posts: 5,417
Joined: 2-April 10
Level 500 (Godslayer)


QUOTE(gynew @ Sep 6 2014, 20:28) *

I find the hv popup remover quite practical and useful, do you think is there a way for both scripts to work?

Thank you again for your help.


Try setting djack's script to load before the popup remover script (GreaseMonkey icon -> Manage User Scripts -> Right on pop-remover -> Load Last

If the popup remover doesn't work this time, then you might want to give djack the source code of that popup remover script.

This post has been edited by holy_demon: Sep 6 2014, 13:17
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


2 Pages V  1 2 >
Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 29th March 2024 - 00:52