Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1. import { Client, Library, PacketHook, PlayerTextPacket, TextPacket, Account, Runtime, Proxy, PetData, NewTickPacket, PetAbilities, Events, ChooseNamePacket, WorldPosData, FailurePacket } from 'nrelay';
  2. import Discord = require('discord.js');
  3. const fs = require('fs');
  4. // The Library decorator gives nrelay some information about
  5. // your plugin. If it is not present, nrelay won't load the plugin.
  6. @Library({
  7. name: 'Hello Plugin',
  8. author: 'tcrane',
  9. })
  10. class HelloPlugin {
  11.  
  12. private bot = new Discord.Client();
  13. private servers = require("../servers.cache.json");
  14. 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"]
  15. private index = 0;
  16. private accounts:string[] = [];
  17. // The HookPacket decorator will cause the method to be called
  18. // whenever a packet with the specified packet type is recieved.
  19. constructor(private runtime: Runtime) {
  20. let accs = fs.readFileSync('1081.txt').toString('utf-8'); {
  21. this.accounts = accs.split("\r\n");
  22. console.log(this.accounts.length);
  23. }
  24. setInterval(() => {
  25. this.index++;
  26. if (this.index === this.messages.length) {
  27. this.index = 0;
  28. }
  29. },5000);
  30. const servers = Object.keys(this.servers);
  31. let index = 0;
  32. for (let server of servers) {
  33. let x = index
  34. this.runtime.addClient({ guid: this.accounts[index].split(":")[0], password: this.accounts[index].split(":")[1], serverPref: server, alias: "Spammer" } as Account).catch(error => {
  35. console.log(this.accounts[x].split(":")[0]);
  36. })
  37. index++;
  38. }
  39. this.runtime.on(Events.ClientReady, (client: Client) => {
  40. setTimeout(() => {
  41. this.repeat(client);
  42. }, 10000);
  43. });
  44. }
  45. @PacketHook()
  46. // Any method with a HookPacket decorator should always have
  47. // the method signature (client: Client, packet: Packet).
  48. onText(client: Client, textPacket: TextPacket): void {
  49. if (textPacket.text === "sdf") {
  50. client.nextPos.push({ x: 99, y: 164 } as WorldPosData)
  51. const text = new PlayerTextPacket();
  52. text.text = "hi";
  53. client.io.send(text);
  54. }
  55. }
  56.  
  57. @PacketHook()
  58. onFailure(client:Client,failure: FailurePacket): void {
  59. console.log(client.guid + " " + failure.errorDescription);
  60. }
  61.  
  62. send(text:string, client:Client) {
  63. const t = new PlayerTextPacket();
  64. t.text = text;
  65. client.io.send(t);
  66. }
  67.  
  68. repeat(client:Client) {
  69. const text = new PlayerTextPacket();
  70. text.text = this.messages[Math.floor(Math.random()*this.messages.length)];
  71. //text.text = "hi"
  72. client.io.send(text);
  73. console.log("sending " + text.text)
  74. setTimeout(() => {
  75. this.repeat(client);
  76. },Math.random()*5000 + 5000)
  77. }
  78.  
  79. scramble(text:String): string {
  80. const textArray = []
  81. let newstring = ""
  82. for (let i = 0 ; i < text.length; i++) {
  83. textArray.push(text[i]);
  84. }
  85.  
  86. for (let i = 0 ; i < text.length; i++) {
  87. let rand = Math.floor(Math.random()*textArray.length);
  88. newstring += textArray.splice(rand, 1);
  89. }
  90.  
  91. return newstring;
  92. }
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement