Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using MuPie_X;
- using System.Collections;
- using System.Threading;
- namespace DrMike_Trainer.Classes
- {
- class Actions
- {
- private ArrayList GameConnections = new ArrayList();
- bool isRunning = false;
- List<byte[]> Array = new List<byte[]>();
- int delay = 0;
- byte[] MovingBytes = new byte[3] { 181, 73, 75 };
- byte[] MovingByte = new byte[3] { 181, 122, 75 };
- public static bool ContainsSequence(byte[] toSearch, byte[] toFind)
- {
- for (var i = 0; i + toFind.Length < toSearch.Length; i++)
- {
- var allSame = true;
- for (var j = 0; j < toFind.Length; j++)
- {
- if (toSearch[i + j] != toFind[j])
- {
- allSame = false;
- break;
- }
- }
- if (allSame)
- {
- return true;
- }
- }
- return false;
- }
- public void AddBytes(string[] copyself)
- {
- string[] nigga = copyself;
- foreach (string item in nigga)
- {
- try
- {
- string[] obj = item.Trim().Split(' ');
- byte[] Data = new byte[obj.Length];
- int s = 0;
- for (s = 0; s < Data.Length; s++)
- {
- string inter = obj[s].ToString();
- byte tmp = byte.Parse(inter, System.Globalization.NumberStyles.AllowHexSpecifier);
- Data[s] = tmp;
- }
- Array.Add(Data);
- }
- catch { }
- }
- }
- public void SendOne(byte[] packet)
- {
- try
- {
- for (int i = 0; i < GameConnections.Count; i++)
- ((MuGameConnection)GameConnections[i]).SendServer(packet);
- }
- catch
- {
- }
- }
- public void Run()
- {
- isRunning = true;
- while (isRunning)
- {
- foreach(byte[] s in Array){
- if (ContainsSequence(s, MovingByte) || ContainsSequence(s, MovingBytes))
- {
- Thread.Sleep(50);
- SendOne(s);
- }
- else
- {
- for (int i = 0; i < 3; i++)
- {
- SendOne(s);
- Thread.Sleep(delay);
- }
- }
- }
- }
- }
- public void Stop()
- {
- isRunning = false;
- }
- public Actions(int delays, ArrayList gameCon)
- {
- this.delay = delays;
- this.GameConnections = gameCon;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement