The result (screenshot below) is a much enhanced version of the original that eliminates the need to edit URL's entirely, providing in page controls to handle all circumstances, as well as keyboard shortcuts for most of them, so you can easily play these classic snakes and ladders games, and lottery style games.
The script was developed and tested in Tampermonkey. Don't know if it will work in GreaseMonkey (I've never used it).
Download the upgraded script here: mega download (Updated to version 1.2 Jan 12/2024)
Enhancements
On ALL classic teases:
- URL's (hyperlinks) in the page text are converted to clickable links.
- Page text like "go to page 27" is turned into a clickable link that goes to the proper page.
On classic teases whose title contains any of the words snake(s), ladder(s) or lottery it also does the following:
Note: These features can be activated on all classic teases by setting a variable in the script.
- Adds custom controls to the page for rolling the next page, rolling random numbers or jumping to specific pages within the tease. By default the controls are placed so they are right after the tease text instead of below everything. You can change this by selecting the parent div in the code.
- Lottery mode is automatically selected if the tease title contains the word lottery.
The script tries (usually successfully) to detect the min and max values to roll by examining the text on the first few pages of the tease. - Limits the width of the tease image so the tease text and controls remain on the right instead of being pushed below it on wider images. For teases that use portrait mode images this usually works fine. For teases that use a lot of landscape format pictures they images often get reduced in size quite a bit. You can disable this in the customization options in the script.
- Automatically detects the target page for snakes and ladders games (in the majority of cases)
- The "Continue" link is automatically updated to go to the proper page. The "Continue" link will NOT be updated if instructions in the page say anything like "do something or other then click continue instead"
- If a Snake or Ladder is detected the "Continue" link changes to "Snake" or "Ladder" appropriately.
- A Random # button and input fields is added so you can generate random numbers right on the page. In most cases the min and max values are automatically detected and put in the appropriate fields, so all you have to do is click the button to get the result.
- For snakes and ladders games the last roll is displayed next to the min/max fields
- Shortcut keys added so keyboard navigation is much easier
- Key Action
- a = Generate random number
- c = Click the Continue link. This works even if link is updated to say "Roll" or "Ladder to..." etc. (space bar also works)
- r = Roll for the next page and go to it
- g = Go to the entered page (see p for page number field)
- m = Set numbers for "Random #". Pressing "m" selects the min number field.
Enter a min and/or press tab to get to the max field, enter max if needed, then press "a" to generate the number - n = Selects the "min" input field for the Roll button
- x = Selects the "max" input field for the Roll button
- p = Activate the page number input field (for go to)
- In the unlikely event you might need to edit the url, you can use the supplied "Go to Page" controls instead.
With the above shortcut keys, to go to page 30 for example, you would press p to get to the page number field,
type 30 for the page number, and press g for go. So you just type "p30g". Easy peasy! - I've also included samples in the code of modifying the behavior to address issues in specific teases. Search the script for teaseID.
PG