Skip to content
TORNLIFE More

[Userscript] Easter Egg Hunt

Started by Heasleys4hemp [1468764] Committee on in Tools & Userscripts.

116 replies · 7.16k views · thread synced · 6 days ago · View on torn.com

Posts archived: 117 / 117 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

xedx [2100735]
Yes, off the top of my head: while flying, to check just certain places, all you need is one API call to determine that you're flying, as I think the URL you are at is the home page URL (this is from memory, I'm racing so can't fly ATM). And there is an API call to verify that you are, indeed, flying. Then a simple change to limit the URI's available to go to.

Also at that point, would just need to add the button in a different place.

To summarize:
1. Verify you are flying (one API call - there are none now)
2. Limit URI list to what is available
3. Put the button somewhere else.

Might be too much effort, even though in reality, it isn't *that* much effort.

Edit: An alternative is to add it just to the laptop, where the URL is known. Gets rid of step #1.
Edit #2: Sometimes I think too technically, there's a difference between 'flying' and just 'on the laptop' - you can get eggs in the clouds, after all :-)
Heasleys4hemp [1468764] Committee Committee
Thank you everyone for enjoying this script!

I did not think it would blow up this much :)

I've updated the script to 1.2.0

- Changed location to below messages/events/awards to prevent DocTorn quick links being in the way
- Added sub-forums possibility if forums link is selected
- Removed pc.php because no sidebar
- Removed blinking
- Added click event listener to change link when already on forums (this is needed because moving through forums doesn't reload entire page)

As far as updateURL, Tampermonkey/Greasemonkey should handle that automatically (based on my googling). I tried adding it, but it seems greasyfork seems to not show it.
You can tell tampermonkey knows where to find the update because of this:
[image: i.imgur.com]
cankles [2137519]
Currently using it since update but it the button isn't popping up for me about half the time after I press it. It wasn't doing this before you updated it. Thanks for your work though.
xedx [2100735]
I'm not having that issue. Are you waiting long enough? It won't show up until the page has fully loaded...meaning all images and other resources.
The_Gimp [751434]
Loved the first version. But the update is not working at all

No button shows up no matter how long I wait or how many time I refresh the page.

Browser: Firefox 74.0.1 (64-bit)
Addons: Torn Flights 3.1
Torn Rackets 0.4
DocTorn
Heasleys4hemp [1468764] Committee Committee
Updated again :P sorry that it broke for some people.

v1.3.1
- instead of copying element from page, creates element from scratch (should fix errors while in hospital/jail)
- fixes for firefox users (hopefully)

Mathuaerknedam [2461123]
Any chance you'll make it work when flying?

For my own use, I've tweaked it so that it only gives me random user profiles. I got tired of seeing the same normal pages over and over again, and there are so many users that I doubt I could even make it through all of them! It would be awesome if this made a button in the top toolbar, so that I could use it any time.
Heasleys4hemp [1468764] Committee Committee
I was working on getting it to work while flying, but there were a few issues with most of the pages, including the forums.

If you want it to work only on user profiles while flying, I should be able to do that.
xedx [2100735]
To be clear, issues when really flying, or do the issues arise when on a laptop, when not really flying? I'd assume the same issues, right? So do not not need to be really flying to test?
Heasleys4hemp [1468764] Committee Committee
To be clear, issues when really flying, or do the issues arise when on a laptop, when not really flying? I'd assume the same issues, right? So do not not need to be really flying to test?


Probably for both. I've been testing while flying to mexico. I can get it to appear on the pages, but if you navigate through the pages at all, it removes to link.
Mathuaerknedam [2461123]
Would it work to simply float a smallish egg-icon button in the top left corner? While I appreciate how well the current button integrates with the site style, for a temporary function like this I wouldn't mind something more universal.
Heasleys4hemp [1468764] Committee Committee
Travel update for a silly button. Woo.

v1.4.1
-Added link while travelling

[Technical Changes]
- added MutationObserver to determine Normal Sidebar, Travel header, or other travel header
- Added ajaxcomplete to fix disappearance when browsing forums/laptop while traveling
- leaving console logs in for debug purposes

[image: i.imgur.com]

[image: i.imgur.com]


I tested it on my chromebook with chrome (duh) and my main PC with chrome and firefox using tampermonkey. It worked well, hopefully no errors.