I'm looking for a way to find out what page is currently open for a script I'm writing for the browser game TribalWars. The URL's are really similar set up, and this should be easy for somebody who know's what he's doing (which I clearly don't).
The URL looks like this:
https://nlp2.tribalwars.nl/game.php?village=171817&screen=train
The village ID is different for every village (duuh), so that piece should be some kind of wildcard, but the 'train' at the end is what I'm interested in. This means that the user is looking at the page I want my script to modify.
Right now I've written/found the following code:
/^\u0026.+$/ //To find the &, but it doesn't work because there is stuff in front of the &
/^https:\/\/((nl|zz|en).*\.tribalwars\.(nl|net)\/(game.php).*)/
//This piece works correctly (stole it from another script), but this will trigger at every page.
In short: I need a regex piece that can find out if the user is looking at a page from the correct domain (like the piece above) and finds out if the tag 'train' is correct.
Thanks :)