Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.IO;
  4. using System.Drawing;
  5. using AppKit;
  6. using System.Net;
  7. using Foundation;
  8.  
  9. namespace RotMG
  10. {
  11. public partial class ViewController : NSViewController
  12. {
  13. public ViewController(IntPtr handle) : base(handle)
  14. {
  15. }
  16.  
  17. string serverIP;
  18. string serverPort;
  19. int amount;
  20. string email;
  21. private static Random rnd = new Random();
  22.  
  23. public static string RandomString(int length)
  24. {
  25. string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  26. return new string(Enumerable.Repeat(chars, length)
  27. .Select(s => s[rnd.Next(s.Length)]).ToArray());
  28. }
  29.  
  30. public override void ViewDidLoad ()
  31. {
  32. base.AwakeFromNib ();
  33. settingsavedlabel.StringValue = "Settings have not been saved.";
  34. generatelinkslabel.StringValue = "Links have not been generated.";
  35. runflooderlabel.StringValue = "Flooder is not running.";
  36. }
  37.  
  38. partial void settingssaved (Foundation.NSObject sender) {
  39. serverIP = serveripstring.StringValue;
  40. serverPort = serverportstring.StringValue;
  41. amount = int.Parse(amountstring.StringValue);
  42. settingsavedlabel.StringValue = string.Format("Settings have been saved.");
  43. amountlabel.StringValue = "Amount: "+ amount.ToString();
  44. serveriplabel.StringValue = string.Format("IP: " + serverIP);
  45. serverportlabel.StringValue = string.Format("Port: " + serverPort);
  46. }
  47.  
  48. partial void generatelinks (Foundation.NSObject sender) {
  49.  
  50. string[] links;
  51. {
  52. links = new string[amount];
  53. for (int i = 0; i < links.Length; i++)
  54. {
  55. email = $"{RandomString(5)}@gmail.com";
  56. links[i] = "http://" + serverIP
  57. + ":" + serverPort + "/account/register?isAgeVerified=1&entrytag=&ignore=77240&newPassword=fsodflooder&newGUID="
  58. + email + "&guid=597BFBCFA0E1C4195FD6E8392557CD960361878D%22"; ;
  59.  
  60. }
  61. System.IO.File.WriteAllLines(@"/Users/hitaghantala/Documents/GitHub/RotMG/RotMG/links.txt", links);
  62. }
  63. generatelinkslabel.StringValue = string.Format("Links have been generated.");
  64. }
  65.  
  66. partial void runflooder (Foundation.NSObject sender) {
  67. runflooderlabel.StringValue = string.Format("Flooder is running.");
  68. }
  69.  
  70. public override NSObject RepresentedObject
  71. {
  72. get
  73. {
  74. return base.RepresentedObject;
  75. }
  76. set
  77. {
  78. base.RepresentedObject = value;
  79. }
  80. }
  81. }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement