Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Open the console (F12) and paste the code then enter it. Enjoy!
- //
- var customavatar=["ex","am","pl","e"]; //use this for manual split (recommended if you want to use emoji)
- var autoSplitcustomavatar="example";//choose your custom avatar - the string will be split into groups of 2, so keep in mind
- var autoSplit= false; //set false for manual split
- var delay = 400; //choose the speed of the scrolling (1000=1sec)
- var yourkey = "5"; // choose your button to active scroll avatar (on/off system)
- var counter=0;
- var iframe;
- var on = true;
- var key;
- var timer;
- var arr = [];
- function chunkString (str, len) {
- const size = Math.ceil(str.length/len)
- const r = Array(size)
- let offset = 0
- for (let i = 0; i < size; i++) {
- r[i] = str.substr(offset, len)
- offset += len
- }
- return r
- }
- setTimeout(function arrayavatar(){
- if(autoSplit == true){
- arr = chunkString(autoSplitcustomavatar,2);
- }
- else{
- arr = customavatar;
- }
- },1);
- setTimeout(function setup(){
- iframe = document.querySelector("iframe").contentWindow.document;
- iframe.body.addEventListener("keydown", keypressed, true);
- },1000);
- var keypressed = function(event) {
- if (iframe.activeElement != iframe.querySelectorAll("[data-hook='input']")[0]) {
- key = event.key;
- activeAvatar();
- }
- }
- function activeAvatar() {
- if (key == yourkey){
- on?timer = setInterval(Avatar,delay):clearInterval(timer)
- on=!on;
- }
- }
- function Avatar() {
- if(counter == arr.length){
- counter=0;
- }
- iframe.body.querySelectorAll("[data-hook='input']")[0].value = "/avatar " + arr[counter];
- iframe.body.querySelectorAll("[data-hook='send']")[0].click();
- counter++;
- var updates = iframe.body.getElementsByClassName("notice");
- for (var i = 0; i < updates.length; i++) {
- var notice = updates[i];
- if (notice.innerHTML == "Avatar set") {
- notice.parentNode.removeChild(notice);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement