Minecraft PC IP: play.cubecraft.net
  • We're running an internal migration of all old players' stats to our new highly advanced statistics tracking backend. This means that stat changes will be a bit delayed while we ingest this huge backlog of data. Nothing is being lost, it'll just take a bit longer to show up in the in-game UIs.

Max ♠

Forum Expert
Feb 20, 2016
1,420
2,939
344
26
North pole
Hi...

I made a little client side script which plays a sound when you receive notifications on the forums,

Code:
// ==UserScript==
// @name Cubecraft Alerts
// @namespace Landviz' script
// @grant none
// @match https://*.cubecraft.net/*
// ==/UserScript==

var refreshTimer = 30;
var notification = new Audio('http://landviz.nl/host/plucky.mp3');
var newAlerts = Number(document.querySelector('#VisitorExtraMenu_AlertsCounter span.Total').innerHTML);
var newConv = Number(document.querySelector('#VisitorExtraMenu_ConversationsCounter span.Total').innerHTML);
var notified;

if(sessionStorage.getItem('alerts') !== null) {
    if( newAlerts > sessionStorage.getItem('alerts') || newConv > sessionStorage.getItem('conv')) {
        notification.play();
    }
}

sessionStorage.setItem('alerts', newAlerts);
sessionStorage.setItem('conv', newConv);

setInterval(function() {
    if(!document.hasFocus()) {
        location.reload();
    }
}, refreshTimer*1000);

How to install
Chrome - Click
Firefox - Click
Opera - Click

As of right now there's no version of ViolentMonkey for Microsoft Edge, there might be a different addon similair to ViolentMonkey, haven't looked for alternatives myself.

The script refreshes your page every 30 seconds unless the tab is focussed, you can change this easily by editing "var refreshTime = 30;", the sound can also be changed by editing the url @ "var notification = new Audio('http://landviz.nl/host/plucky.mp3');" (Keep in mind that some browsers might not support other file formats)

For whoever knows how to use Greasy Fork:
https://greasyfork.org/nl/scripts/32163-cubecraft-alerts
Install link doesnt have the correct link for the sound file, if you don't know how to edit it, just use the videos to install instead
 
Last edited:

Despacito 2

Forum Professional
Dec 6, 2015
7,507
10,309
564
25
You're my hero.
Edit: I do want to customize my sound. Can I do that?
Double edit: Already found my way how to do it.
 
  • Like
Reactions: Max ♠

Max ♠

Forum Expert
Feb 20, 2016
1,420
2,939
344
26
North pole
I'll definitely be using this.
Also: How does one upload an mp3 file to a site like what you did? I've attempted it but it didn't seem to be working.
(I'm also making this post so I can get a notification if someone responds to the thread)
https://www.000webhost.com/

You can host ANY file type here

(It's also possible to use a local file, change the url to C:\whatever\whatever\coolsound.mp3)
 
  • Like
Reactions: Eli and Despacito 2

Max ♠

Forum Expert
Feb 20, 2016
1,420
2,939
344
26
North pole
Cleaned up the code a bit, added support for conversations. Installment is the same, just edit the existing file instead of creating a new one if you're already using the old script & want to update
 

Max ♠

Forum Expert
Feb 20, 2016
1,420
2,939
344
26
North pole

Max ♠

Forum Expert
Feb 20, 2016
1,420
2,939
344
26
North pole
What about the lovely Safari users? :c
Uhh.. I can't really install safari on a windows machine to try... (a version from the past 3 years at least)

With a browser which supposedly mimics Safari I couldnt find an add-on for userscripts, couldnt find a video on how to use userscripts with Safari either. Try looking for "userscripts" in the add-ons, pretty much any add-on which allows says "Customize web browsing with custom scripts" or something along those lines would probably work. Installing the script shouldnt be much different.
 
I

iDontPlayMinecraft.exe

Guest
Would be cool if you could do this for Discord, nonetheless this is pretty cool, Ill edit the script for ait to fit a different minecraft forum.
 
Members Online

Members online

Latest profile posts

Quewds wrote on Noodles.'s profile.
Found you 🌹
kevin020007 wrote on B4CKROOMS's profile.
Thanks for the follow!
HOTROD the 6th wrote on Daanfkyy's profile.
Congrats on bedrock helper, hope you succeed!
ItzJuan wrote on Marta's profile.
🫡 Thank you for all the hard work you've done. We'll never forget you.
HelmutRebew wrote on Alexp192's profile.
Thanks for the follow!
Top Bottom