Results 1 to 8 of 8

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Banned

    Join Date
    Mar 2016
    Country
    Posts
    303
    Thanked
    106
    Thanks
    262
    Really quick. Code is straight forward. Will leave it below.

    https://chrome.google.com/webstore/d...lchpmebcmmieii


    Code:
    class ZChat {
      constructor(tickRate, keywords) {
        this.tickRate = tickRate;
        this.keywords = keywords;
        this.style = 'style="height: 18px; width: 18px;"';
        this.kappa = 'https://freestylersworld.com/images/smilies/1.png';
      }
    
      scanSubstrs() {
        let daveZChat = document.getElementById('zchat');
        this.keywords.forEach((keyword) => {
          if (daveZChat.innerHTML.indexOf(keyword) > -1) {
            daveZChat.innerHTML = daveZChat.innerHTML
                .replace(keyword, `<img ${this.style} src="${this.kappa}">`);
          }
        });
      }
    
      ZChatLoop() {
        setInterval(() => {
          this.scanSubstrs();
        }, this.tickRate);
      }
    }
    
    Shoutbox = new ZChat(100, [':K', ':k', 'kappa', 'Kappa']);
    Shoutbox.ZChatLoop();
    Bugs
    • Text after a gets replaced. Will fix it when I'm done with more important stuff. ( Fixed, but Google needs to publish the changes. Takes about an hour )
    Last edited by Modal; 11-16-2016 at 11:14 PM.

  2. The following 6 users say thank you to Modal for this useful post:

    Bunny (11-16-2016), Eagle (11-17-2016), GeorgeGFX (11-16-2016), Ricky (11-17-2016), Stuwadie (11-16-2016), «Benjamin» (11-17-2016)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)