Last active
September 29, 2015 14:14
-
-
Save LiteHell/3f20e3d3a6488e586dc7 to your computer and use it in GitHub Desktop.
트켓몬 트위치에서 취소선을 자동으로 쳐주는 편-리한 스크립트
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* By. LiteHell ( LiteHell@openmailbox.org ) | |
* 실행방법 (Firefox) | |
** 1. www.twitch.tv/manatails 접속 | |
** 2. 스크래치패드 실행 | |
** 3. 파일 열기 | |
** 4. 1번에서 연 탭 선택 | |
** 5. 스크래치패드에서 실행 클릭 | |
* 주의사항 | |
** 실행 버튼 두번 이상 누르면 스크립트 꼬일 수 있음. | |
*/ | |
function enterMessage(message) { | |
var chatBox = document.querySelector('#chat_text_input'); | |
function fireEvent(elem, ena) { | |
var event = document.createEvent('HTMLEvents'); | |
event.initEvent(ena, true, true); | |
elem.dispatchEvent(event); | |
} | |
document.querySelector('#chat_text_input').value = message; | |
fireEvent(chatBox, 'focus'); | |
fireEvent(chatBox, 'keydown'); | |
fireEvent(chatBox, 'keyup'); | |
fireEvent(chatBox, 'mouseup'); | |
document.querySelector('button.button').click(); | |
} | |
var a = 1; | |
var lineDelay = 5000; | |
if (typeof messagePrefix === 'undefined') var messagePrefix = '+++------------------- '; | |
if (typeof intintint !== "undefined") clearInterval(intintint); | |
var intintint = setInterval(function () { | |
var message = messagePrefix + a++ + '(' + (lineDelay / 1000) + '초 간격, 자동)'; | |
enterMessage(message); | |
if (a > 100) { | |
messagePrefix = '+' + messagePrefix.substring(0, messagePrefix.length - 2) + " "; | |
a = 1; | |
if(messagePrefix[messagePrefix.length - 1] == "+"){ | |
var messagePrefix = '+++------------------- '; | |
} | |
} | |
}, lineDelay); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment