SG Train Navigation Assistant is a lightweight userscript which loads quickly, and allows easy manoeuvrability through trains on SteamGifts!

Some backstory as well as the train can be found at the bottom of this post.


Installation

Follow this link and click 'Install this script': SG Train Navigation Assistant (Greasyfork)

If you've never installed a userscript before and need some help, follow these instructions: How to install user scripts (Greasyfork)


Usage

To use this userscript, simply use your arrow keys when in a train, the current available controls are as follows:

  • Left Arrow (←) - Go to the previous train cart
  • Right Arrow (→) - Go to the next train cart
  • Up Arrow (↑) - Open/ Close game screenshots
  • Control - Toggle between images and video media when the 'screenshots' are open

These hotkeys can be customised through the configuration panel, which can be accessed if you click your script manager, and click the 'Configure Script' button, underneath the SG Train Navigation Assistant dropdown.

Note: When writing a comment or changing the description (i.e. when your cursor is active inside a textbox) the shortcut keys will not work.


Issues?

  • If the script doesn’t work, ensure:
    • Tampermonkey is enabled in your browser.
    • The script is active and running when on a giveaway page (such as this).
  • Check the console for errors (Press F12 → Console tab).

Feel free to post any issues in the comments below. As this is my first 'official' public userscript release, please do bear with me if there are any issues.
If there are any other 'Forward' or 'Backward' keywords, please feel free to pop them in this thread also, and I can add them to the script.


So where is the promised sample train?!?!?

Alright, alright, here is the link to the train (Just RemoveThis_ :P). Please feel free to test it out and let me know if you find any issues. I've tried to mix up some of the wagon terminology to really put it to the test.

For some backstory, I made this userscript since my primary method of interaction with Steamgifts is through a trackpad. As such, when there is a large community train, I quickly lose motivation to click through each link.

This poses a problem, especially when I want to contribute, as I need to be able to get to the last cart in the train to add my contribution.

So, through my own laziness, and determination to contribute, I decided to make a small userscript to automatically identify the previous/ next links in the cart, and then allow for keyboard shortcuts to be used to navigate through.

After making a v1 (read as: v0.001) I quickly found that it was a pain to switch between arrow keys and mouse when I wanted to check the screenshots for a game, so I added a shortcut for bringing those up too!

Initially I did consider just using ESGST/ seeing if I could add this to the extension, however it is a fairly heavy plugin, and on the device I use (very old chromebook) takes a while to load, and also loads quite late. This means it takes me several seconds before I can use the hotkeys. My goal with making this a separate userscript was to allow it to load very quickly, and be very lightweight as well (which, from my testing I seem to have achieved!).

At the current stage, I have some other QoL ideas that I may look at adding in the future, such as tracking the cart number to deal with pesky derailments. But currently I think this is at a solid enough stage to maybe (hopefully?) be useful to some.

Next time you make a train, feel free to link this in your post!

Thanks for reading!

tldr; I hope this helps people navigate trains.

7 months ago*

Comment has been collapsed.

2 months ago
Permalink

Comment has been collapsed.

Maybe there could be a fallback:

If no text match is found, assume that the first giveaway link is "back", and the second giveaway link is "forward".

If no text match is found and there's just one giveaway link, it could be interpreted as a "back" link, in case the "next" link hasn't been added yet. But some trains might be one way (no "back" navigation), in which case it would actually be "forward".

2 months ago*
Permalink

Comment has been collapsed.

in that case it should be like assume first object is back etc as you mentioned
sometimes links are also put in 3 lines instead of separated on 1 line. so assume first URL is back etc could also work.

but best might possibly be if the bump /discussion URL exists, then previous <a> to be considered as go back, and next <a> after bump URL to be treated as go forward

https://www.steamgifts.com/giveaway/ujc2l/tiny-terrys-turbo-trip
and another one with NO YES for back/next

2 months ago
Permalink

Comment has been collapsed.

Let me introduce you to this cart in current community train 😉

2 months ago
Permalink

Comment has been collapsed.

haha very sneaky - i missed those links actually :D

2 months ago
Permalink

Comment has been collapsed.

So this means that if there are more than two g/a links, then the fallback shouldn't be used.
(But in this specific case commonly used labels are present so navigation would work.)

2 months ago
Permalink

Comment has been collapsed.

I may just have to make giveaway links a possible separator! :P

But yes I am thinking about how to resolve some of these problems and have some fallback case with automatic identification based on some generalised pattern.

P.S. I don't presume you have any data on the statistics of the formats of train giveaway descriptions? :P

2 months ago
Permalink

Comment has been collapsed.

Unfortunately, I can't help with patterns. In my scraper I work with plain text, not a structure. So I keep it simple, ignoring previous GA URL and taking the next one (which sometimes leads to the side carts and other places :) ). I do not analyze URL description, in this JS userscripts have an advantage

2 months ago
Permalink

Comment has been collapsed.

How do you identify the URLs? Just manually or 2nd occurrence kind of thing?

2 months ago
Permalink

Comment has been collapsed.

By keeping the previous one, obviously. For the first cart in mid-train it needs to be manually defined.

2 months ago
Permalink

Comment has been collapsed.

This has been added, should be in next time you update the script!

2 months ago
Permalink

Comment has been collapsed.

No for backwards and Yes for forwards is weird but it happens.

I might have a suggestion for a fallback where unusual words like that don't matter.

The pattern is practically always [backwards link] (possible separator in between) [bump link] (usually the same separator in between) [forward link]. If there's some way that three link pattern (with possible separator) could be used to find and capture the forward/back links, without the particular words mattering (at least as a fallback when nothing else is detected), that might help solve the problem where unusual words or unique one train only words are used.

2 months ago
Permalink

Comment has been collapsed.

Thank you for that!

I'm actually working on the script right now, and both of those keywords are now implemented, as well as a toggle to change between images/ videos when you have the screenshots open.

Thank you for the suggestion with the fallback! I have considered that kind of logic before, but I still need to resolve some difficulties associated with it. On occasion, people may have a side cart giveaway hidden somewhere in there (so I would have to look at more than just 3 links). And sometimes people have other orders of links, such as the first link going forward and the last link going back (i.e. when the links are spread vertically, both orders of links are fairly common).

But yes, I am considering this at some point in the future. Thank you for the suggestions!

2 months ago
Permalink

Comment has been collapsed.

Speaking of sidecarts, I'm guessing it's the sidecarts on this one that are causing the script to fail.

Bizarrely on that cart and the next cart after, trying to go next takes me to my Steamgifts messages page for some reason.

2 months ago*
Permalink

Comment has been collapsed.

That is indeed very strange, I can't seem to replicate this behaviour.

Are you running any other extensions/ addons? The script only looks for links in the description of the giveaway, so the messages page URL should be inaccessible (via the script).

What keys are your hotkeys set to?

On my end the script handles that series of carts just fine

2 months ago
Permalink

Comment has been collapsed.

It's working correctly for me now too on those carts and I can't figure out what was causing it. I had browsed my Steamgifts messages shortly before it happened, but trying to retrace my steps isn't causing it to happen again so I have no clue what caused it.

This cart where the gifter hasn't come back to add the next link to their cart gave me another possible fallback idea.

If a next link could be checked for on comments on a cart when everything else fails, that might also be a workaround.

Also thanks so much for this script. I never could have gotten through this community train without it.

And also congratulations on the script somehow working on this cart and the following ones despite the links being unpredictable phrases.

2 months ago*
Permalink

Comment has been collapsed.

Deleted

This comment was deleted 2 months ago.

2 months ago
Permalink

Comment has been collapsed.

Sign in through Steam to add a comment.