Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Nitrotype
- // @namespace http://tampermonkey.net/
- // @version 0.4
- // @description An auto-typing bot for Nitrotype that evades bot-detection.
- // @author Thinatron (Aaron McAnalley)
- // @match https://www.nitrotype.com/race
- // @grant none
- // @require http://code.jquery.com/jquery-latest.js
- // ==/UserScript==
- window.wwdata = {};
- (function() {
- 'use strict';
- var jjkklliioopp = false;
- setTimeout(function() {
- if (jjkklliioopp !== true){
- location.reload();
- }
- }, 60000);
- var sentence;
- Primus.prototype.transforms = function transforms(primus, connection, type, data, raw) {
- var packet = { data: data },
- fns = primus.transformers[type];
- console.log(data);
- window.wwdata = data;
- if (data.msg == 'status' && data.payload.hasOwnProperty('lesson')) {
- console.log("lesson recieved");
- sentence = data.payload.lesson;
- } else if (data.msg == 'status' && data.payload.status == "racing") {
- console.log("Begin recieved");
- jjkklliioopp = true;
- beginTyping();
- } else {console.log('nope');}
- //
- // Iterate in series over the message transformers so we can allow optional
- // asynchronous execution of message transformers which could for example
- // retrieve additional data from the server, do extra decoding or even
- // message validation.
- //
- (function transform(index, done) {
- var transformer = fns[index++];
- if (!transformer) return done();
- if (1 === transformer.length) {
- if (false === transformer.call(connection, packet)) {
- //
- // When false is returned by an incoming transformer it means that's
- // being handled by the transformer and we should not emit the `data`
- // event.
- //
- return;
- }
- return transform(index, done);
- }
- transformer.call(connection, packet, function finished(err, arg) {
- if (err) return connection.emit('error', err);
- if (false === arg) return;
- transform(index, done);
- });
- }(0, function done() {
- //
- // We always emit 2 arguments for the data event, the first argument is the
- // parsed data and the second argument is the raw string that we received.
- // This allows you, for example, to do some validation on the parsed data
- // and then save the raw string in your database without the stringify
- // overhead.
- //
- if ('incoming' === type) return connection.emit('data', packet.data, raw);
- connection._write(packet.data);
- }));
- return this;
- };
- function beginTyping() {
- var endInt;
- var pos = 0;
- setTimeout(function(){
- endInt = setInterval(function() {
- if (pos < sentence.length) {
- $(document.activeElement).trigger({ type : 'keypress', which : sentence.charCodeAt(pos) });
- console.log(sentence.charCodeAt(pos));
- switch (pos) {
- case 3:
- case 15:
- case 21:
- case 7:
- case 39:
- $(document.activeElement).trigger({ type : 'keypress', which : "k".charCodeAt(0) });
- break;
- }
- pos++;
- } else {
- clearInterval(endInt);
- pos = 0;
- setTimeout(function() {location.reload();}, 3000);
- }
- }, Math.floor(Math.random() * (30) + 20));},1200);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement