shuffyiosys / RPH Pings

Published:

Version: 1.1.0+75cbc48 updated

Summary: Pings and highlights entered usernames in RPH.

Copyright: Original script (c)2012+ nick_rp1986yahoo.com, Modifications (c)2014 shuffyiosys@github

License: MIT; https://opensource.org/licenses/MIT

####News
10/12/2014
Huzzah!

I got a handle on the PM system and chat system in RPH. I've been able to implement a custom action command (a simple dice roller) and manipulating PMs (sending one programmatically and working around blocking). Which means I can get something up and running to implement more features that were either not there or were flaky.

Expect something new and exciting to happen (within a month maybe)

10/11/2014
Small update to those that still use the legacy branch. I updated the code base to match the multi-username's logic, only tweaked for global settings. This was just to make it so bug fixes that could affect both versions can be applied.

And although I do muck with cookies, I've decided to not be mean and added hooks to look for cookies that were used between 0.5.0 and 0.6.1 and it will convert it to the new format.

09/27/2014
UPDATE 1: If you've updated at or before 1PM PST today, please update again. I added a small fix that will make sure the cookies of actively used names have their expiration dates refreshed automatically.

After user feedback (See? This is important!), I found out that the way 0.7.x handles data is extremely limited and is prone to issues if RPH is acting up. This update is to fix that as well as a few other minor tweaks. You can see the version history as usual at the Test Version. Of course, since I yet again buggered with how cookies are saved, your old cookies no longer work. Be sure to back up your settings before updating!

Also I redid the branches. I'm no longer using the test branch as a poor repo and instead is the debug version. The older version is now named Legacy, and is under RPH Pings Legacy. I also rolled in the fix in case ping matching screws up so it'll post messages regardless of what happens.

And in case you were wondering, yes I mucked with the versioning. But this is to make it a bit more consistent, somehow. Versioning is as follows:

Format: x.y.z

  • x: Major revision. This is if I change some major feature of the script.
  • y: If this is 0, it's RPH Pings Legacy. If it's 1, it's this version
  • z: Minor revision. This is for bug fixes and such.

####Contents

  1. Disclaimer
  2. Background
  3. Features
  4. How to install
  5. How to use
  6. Troubleshooting
  7. Known Issues
  8. Limitations
  9. Feedback

####Disclaimer
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

tl;dr I'm not responsible if stuff happens to your computer by using this script. While I consider myself an advanced/expert programmer, Javascript is not my forte.

####Background
This script is a modification of https://openuserjs.org/scripts/nick_rp1986yahoo.com/RPH_Pings. It adds pings back to RPH, which will highlight and give an audible "ping" sound whenever someone sends a message that has a word you want to be pinged.

####Features
enter image description here

  • Settings are per-username.
  • Custom inputted names and words to trigger pinging.
  • Plays an audio ping upon matching.
    • Supports only .wav, .mp3. and .ogg files.
  • Custom text and highlight colors.
  • Text can be bold or italicized.
  • Exact and case sensitive matching.
  • Settings saved in a cookie for persistent storage.
    • Settings can be tested before committing.
  • If the ping happens in another room, the room tab will be highlighted.

####How to Install

  1. You must have (one or the other)
  2. If you have a previous version, you should remove it.
  3. Then...
    • Click on the "Install" button on top to add the script or...
    • Click on the "Source Code" tab and copy the source code, then...
      • In Greasemonkey, select "Add new script", enter some information then press OK, then paste the code in there. Make sure to save it and enable it.
      • In Tampermonkey, select "Add a new script", then paste the code in there. Press the save icon and enable it.
  4. Refresh RPH if you're on it already for the script to take effect.

####How to Use

  1. Click on the "Pings" text on the top right corner
  2. Click on the drop-down menu and select the username whose settings you want to edit.
  3. Enter all the names or words you want to be pinged by. Separate each entry with a comma.
  4. Enter the URL of the sound file to play when a ping is matched. It must be a WAV, MP3, or OGG file.
    • For ping names and URL, do not use the pipe ( | ), as this is the delimiter for the script's cookie saving. If you use it, your settings will be screwed up.
  5. Enter the text and highlight color as an RGB hex value. This uses HTML compatible hex codes, so you can enter #FFF for white instead of #FFFFFF.
  6. Check if you want the text in the to have bold and/or italics
  7. Check if you want words in the chat to exactly match the words on the list to get a ping.
    • e.g., if using "Mel", it must match that and will not trigger on "Melody" or "Melanie"
  8. Check if you want case sensitivity.
    • e.g., if using "Mel" with this checked, it will not ping on "mel".
  9. You can check if the ping is to your liking by putting one of the words on the list into the chat (it will not ping that word/name if it's been previously posted). To save your settings, you must press the "Pings" button again.
    • If a setting is invalid, it will mark the field red and the window will not close or save settings until it's fixed.
    • This script is designed to not need a page refresh, but in case the settings aren't taking, refresh the page anyway.

Troubleshooting

  • Refresh the page after installing
  • Make sure you are using one version of this script. If you installed the other versions, they probably won't play nice with each other.
  • Delete cookies related to pings
    • Go into your browser's options and search for RPH's cookies. You can either delete them all (which will just make it forget you were logged in) or find the ones labeled "nb_pings" or similar.
      • Versions 0.4.4 or below will have about eight with the label "nb_ping", such as "nb_pingItalicsEnable"
      • Versions 0.5.0 to 0.6.1 will have two labeled "nb_pings" and "nb_pingsSettings"
      • Version 0.7.0 and above will have one labeled "nb_rphPings"
      • Version 1.0.x will have two labeled "nb_pings" and "nb_pingsSettings"
      • Version 1.1.x will have several labled "rphPings_[username]"

####Known Issues

  • RPH has a quirk with how the chat is buffered. There's only one buffer (i.e., place where all the messages get posted) and all your names that log into the chat room reference that. So expect funny things to happen.
  • This script relies on account fetching callbacks. Under normal operation, RPH should send the user's account information once the PM server connection is established. This is needed to populate the drop list for names. So if there is some issues with getting account info, this script may not work.

####Limitations

  • Offers no sanitizing of inputs, but I'm not sure how necessary this is.
  • Greasemonkey/Tampermonkey has no access to local files for security reasons. Therefore, any audio you use for pings must be online somewhere.
  • Do not use the pipe ( | ) in the text fields, I use that as the delimiter for cookie saving.

####Feedback
Use the issue tracker in the "Issue" tab to report a problem please :D

Or if you're on RPH, use the support forum, topic "RPH Pings Support/News thread"

Rating: 1

1 Votes
-1