Welcome to my blog. You can now find SofanMax at Google News!

Experience on Writing a Userscript Using JavaScript for drrr.com

My experience writing a usercript using JavaScript for drrr.com
4 min read
If you're using Firefox, first add Code Injector extension, then follow these instruction:
  • Go to the tab where you open your drrr.com room.
  • Click on the add-ons' logo then "Add rule".
  • Then click on "Current Host" (again, make sure you do it when you are on your drrr.com tab).
  • Copy and paste the JavaScript code below, make sure you copy the whole code as instructed including //start copying here.
  • Add your own bad word in the code line which is highlighted in yellow, for example: sambal = ["fuck","damn","crap"];
you can add as many words as you like inside sambal variable, just make sure you follow the forma. Same rule also apply to cohost variable, add more tripcodes of person you want to be cohost.
  • Finally click save, and reload your drrr.com room tab. 
  • For Chrome, you can use Custom JavaScript for websites, the instruction is pretty much similar with Firefox's plugin.


    Type the commads to use the script such as
    • !kick + username - only can be used by host and cohost, case sensitive
    • !ban + username - only can be used by host and cohost, case sensitive
    • !djon - only can be used by host and cohost
    • !djoff - only can be used by host and cohost
    • !luck0 - can be used by any user
    • !addbad - adding temporary bad words in a session, host only
    • !push - adding temporary cohost words in a session, host only
    • !hostomu - transferring host right, cohost only  
    Note that temporary cohost needs to log out then log in again after the script is activated in order to activate features. It means that if the host gets reloaded (refreshed page), the temporary cohost status will be revoked, you can add cohost permanently by adding cohost trips in the code.
    custom script for drrr.com
    script for https://drrr.com

    Credit of the code below: nasitelur, myself, n0bu, godie, and many "radio" room users at drrr.com who are willing to be used as guinea pigs. I'm not responsible of any damage to your computer if things go wrong, and please use it responsibly.
    //start copying here
    d = [ ];
    var obj = { };
    special = ["o9CDijBNYE"];
    cohost = ["tripcode1","tripcode2","tripcode3"]; //co-host tripcodes
    sambal = ["yourbadword1","yourbadword2","etc." ];

    $(window).on('room.chat.join',function(event,joined){

    var xxx = joined.user.name;
    var godie = xxx.replace(/\s+/g, "");
    var godie = godie.replace(/\./g, "");
    var godie = godie.replace(/(.)\1{1,}/ig, '$1');
    regex = new RegExp(sambal.join("|"), 'i');

    if(regex.test(godie) === true&&cohost.includes(joined.user.tripcode) === false){

    $.post("#",{ban:joined.user.id});
    }
    else if(special.includes(joined.user.tripcode) === true){
    $.post("#",{message: "sepcial secret message!", to: joined.user.id});
    d.push(joined.user.id);
    }
    else if(cohost.includes(joined.user.tripcode) === true){
    var omurice = joined.user.id;
    d.push(omurice);
    }
    else if(cohost.includes(joined.user.tripcode) === false){
    obj[joined.user.name] = joined.user.id;
    }
    });

    $(window).on('room.chat.message',function(event,chat){

    kero = chat.message.split(" ");
    ghost = [kero[0]]; 
    tomat = $(kero).not(ghost).get();
    sayn = tomat.join(" ");
    luck = ["lucky", "not lucky", "silahkan coba lagi", "anda belum beruntung", "moderate luck", "bad luck", "great luck"];
    random = luck[Math.floor(Math.random()*luck.length)];
    msg = chat.message.replace(/\s+/g, "");
    msg = msg.replace(/(.)\1{1,}/ig, '$1');
    regex = new RegExp(sambal.join("|"), 'i');


    if(regex.test(msg) === true){
            $.post("#",{kick:chat.from.id});
            }
            else if(d.includes(chat.from.id) === true && chat.message == "!hostomu"){
            $.post("#",{new_host:chat.from.id});    
            }
            else if((profile.id === chat.from.id || d.includes(chat.from.id) === true) && chat.message=="!test"){
            $.post("#",{message :"/me" + d});
            }
            else if((profile.id === chat.from.id || d.includes(chat.from.id) === true) && chat.message=="!test1"){
            $.post("#",{message :"/me" + JSON.stringify(obj)});
            }
            else if((profile.id === chat.from.id || d.includes(chat.from.id) === true) && kero[0]=="!kick"){
            $.post("#",{kick: obj[sayn]});
            }    
            else if((profile.id === chat.from.id || d.includes(chat.from.id) === true) && kero[0]=="!ban"){
            $.post("#",{ban: obj[sayn]});
            }
            else if((profile.id === chat.from.id || d.includes(chat.from.id) === true) && chat.message=="!djon"){
            $.post("#",{dj_mode: true});
            }
            else if((profile.id === chat.from.id || d.includes(chat.from.id) === true) && chat.message=="!djoff"){
            $.post("#",{dj_mode: false});
            }
            else if((profile.id === chat.from.id || d.includes(chat.from.id) === true) && kero[0]=="!topik"){
            $.post("#",{room_description: sayn});
            }
            else if(chat.message=="!luck0"){
            $.post("#",{message: "/me ramalan keberuntungan anda: " + random});
            }
            else if(chat.message=="!scr"){
            $.post("#",{message: "A userscript for drrr.com", url:"https://sofanmax.blogspot.com/2019/05/making-userscript-for-drrr-website.html"});
            }
            else if(room.host === chat.from.id && kero[0]=="!push"){
            cohost.push(sayn);
            }
            else if(room.host === chat.from.id && kero[0]=="!addbad"){
            sambal.push(sayn);
            }
            else if(chat.message == "!rule"){
            $.post("#",{message: "Etika room radio", url:"https://pastebin.com/raw/Qm4FpY0c"});
            }
            else if(chat.message == "!sensus"){
            $.post("#",{message: "sensus!", url:"https://goo.gl/forms/7ILfufqN09wqNIqt2"});
            }       
            else if(chat.message == "!shrug"){
            $.post("#",{message: "/me ┐( ̄- ̄;)┌"});
            
            else if(kero[0]=="!flip"){
            $.post("#",{message: "/me (╯°□°)╯︵ " + sayn});
            }
    });

    $(window).on('room.chat.me', function(event, chat) {
        sgm = chat.content.replace(/\s+/g, "");
        sgm = sgm.replace(/(.)\1{1,}/ig, '$1');
      regex = new RegExp(sambal.join("|"), 'i');

     if(regex.test(sgm) === true){
             $.post("#",{kick:chat.from.id});
             }
    });

    //credit: nasitelur, myself, n0bu, godie, and many "radio" room users who were willing to be used as guinea pigs.
    //end of copy
    Do you find this article to be useful? Then perhaps you will also like to learn about my experience on solving Google Adsense Valuable Inventory: Under Construction.
    Professional content writer, copywriter, and owner of TokoKata. Passionate blogger and SEO enthusiast. Practicing my bachelor's degree in accounting at the Indonesian Stock Exchange.

    You may like these posts

    Post a Comment