/// <summary> /// Function to send a whisper to a recipient /// </summary> /// <param name="Message"></param> /// Your message as a string /// <param name="Reciever"></param> /// Username of Reciever public static void SendDM(string Message, string Reciever) { if (Message.Length > 150) { int NoOfMessages = (int)Math.Ceiling((double)(Message.Length / 150.0)); for (int i = 0; i < NoOfMessages; i++) { if (Message.Length > (i + 1) * 149) { Message = Message.Insert((i + 1) * 149, "-"); } string SplitMessage; if (i == 0) { SplitMessage = Message.Substring(0, 150); } else { SplitMessage = Message.Substring(i * 150, Message.Length - (i * 150)); } string XtMessage = $"%xt%zm%whisper%1%{SplitMessage}%{Reciever}%"; AQClient.Call("SendPacket", new string[] { XtMessage }); Thread.Sleep(500); } } else { string XtMessage = $"%xt%zm%whisper%1%{Message}%{Reciever}%"; AQClient.Call("SendPacket", new string[] { XtMessage }); } }
public AQClient() { InitializeComponent(); #if TESTING ControlsForm.Show(); #endif Instance = this; }
private void SendPacketButton_Click(object sender, EventArgs e) { #if TESTING if (this.PacketField.Text != "") { AQClient.Call("SendPacket", new string[] { this.PacketField.Text }); } #endif }