Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Client, Library, PacketHook, PlayerTextPacket, TextPacket, Account, Runtime, Proxy, PetData, NewTickPacket, PetAbilities, Events, ChooseNamePacket, WorldPosData, FailurePacket } from 'nrelay';
- import Discord = require('discord.js');
- const fs = require('fs');
- // The Library decorator gives nrelay some information about
- // your plugin. If it is not present, nrelay won't load the plugin.
- @Library({
- name: 'Hello Plugin',
- author: 'tcrane',
- })
- class HelloPlugin {
- private bot = new Discord.Client();
- private servers = require("../servers.cache.json");
- private messages = ["discord.gg/VuTEymCop tr4cker + event n0tif", "tr4cker + event n0tif link discord.gg/VuTEymC", "best n0tif + tr4cker discord.gg/VuTEymC", "event n0tif + tr4cker link discord.gg/VuTEymC", "n0tifier + tr4cker discord.gg/VuTEymC", "tr4cker + op n0tifier discord.gg/VuTEymC", "link for tr4ck/event n0tif discord.gg/VuTEymC", "discord.gg/VuTEymC op event n0tif + tr4cker", "n0tifie + tr4cker link discord.gg/VuTEymC", "join for free tr4cking discord.gg/VuTEymC"]
- private index = 0;
- private accounts:string[] = [];
- // The HookPacket decorator will cause the method to be called
- // whenever a packet with the specified packet type is recieved.
- constructor(private runtime: Runtime) {
- let accs = fs.readFileSync('1081.txt').toString('utf-8'); {
- this.accounts = accs.split("\r\n");
- console.log(this.accounts.length);
- }
- setInterval(() => {
- this.index++;
- if (this.index === this.messages.length) {
- this.index = 0;
- }
- },5000);
- const servers = Object.keys(this.servers);
- let index = 0;
- for (let server of servers) {
- let x = index
- this.runtime.addClient({ guid: this.accounts[index].split(":")[0], password: this.accounts[index].split(":")[1], serverPref: server, alias: "Spammer" } as Account).catch(error => {
- console.log(this.accounts[x].split(":")[0]);
- })
- index++;
- }
- this.runtime.on(Events.ClientReady, (client: Client) => {
- setTimeout(() => {
- this.repeat(client);
- }, 10000);
- });
- }
- @PacketHook()
- // Any method with a HookPacket decorator should always have
- // the method signature (client: Client, packet: Packet).
- onText(client: Client, textPacket: TextPacket): void {
- if (textPacket.text === "sdf") {
- client.nextPos.push({ x: 99, y: 164 } as WorldPosData)
- const text = new PlayerTextPacket();
- text.text = "hi";
- client.io.send(text);
- }
- }
- @PacketHook()
- onFailure(client:Client,failure: FailurePacket): void {
- console.log(client.guid + " " + failure.errorDescription);
- }
- send(text:string, client:Client) {
- const t = new PlayerTextPacket();
- t.text = text;
- client.io.send(t);
- }
- repeat(client:Client) {
- const text = new PlayerTextPacket();
- text.text = this.messages[Math.floor(Math.random()*this.messages.length)];
- //text.text = "hi"
- client.io.send(text);
- console.log("sending " + text.text)
- setTimeout(() => {
- this.repeat(client);
- },Math.random()*5000 + 5000)
- }
- scramble(text:String): string {
- const textArray = []
- let newstring = ""
- for (let i = 0 ; i < text.length; i++) {
- textArray.push(text[i]);
- }
- for (let i = 0 ; i < text.length; i++) {
- let rand = Math.floor(Math.random()*textArray.length);
- newstring += textArray.splice(rand, 1);
- }
- return newstring;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement