public static void fish(object sender, EventArgs e) { var colorAtChat = Fisher.GetColorAt(new Point(Fisher.bottomChatX, Fisher.bottomChatY)); if ((colorAtChat.R >= bottomChatYellow.R - 20 && colorAtChat.G >= bottomChatYellow.G - 20 && colorAtChat.B >= bottomChatYellow.B - 20) && (colorAtChat.R <= bottomChatYellow.R + 20 && colorAtChat.G <= bottomChatYellow.G + 20 && colorAtChat.B <= bottomChatYellow.B + 20) && !Fisher.hasCasted) { Fisher.hasCasted = true; FakeKey(VK_T); System.Threading.Thread.Sleep(50); FakeKey(VK_SHIFT); System.Threading.Thread.Sleep(50); FakeKey(VK_FWDSLSH); System.Threading.Thread.Sleep(50); FakeKey(VK_C); System.Threading.Thread.Sleep(50); FakeKey(VK_F); System.Threading.Thread.Sleep(50); FakeKey(VK_ENTER); System.Threading.Thread.Sleep(50); Fisher.hasCasted = false; } }
public Form1() { InitializeComponent(); label1.Text = $"GTA Process: {Fisher.GTA().Id}"; label2.Text = $"Status: {Fisher.status}"; label3.Text = "Bottom Chat Location"; label5.Text = $"Bottom Chat Color: {Fisher.bottomChatYellow.ToString()}"; textBox1.Text = Fisher.bottomChatX.ToString(); textBox2.Text = Fisher.bottomChatY.ToString(); Timer tm = new Timer(); tm.Interval = 100; tm.Tick += Fisher.fish; tm.Start(); }
public static void FakeKey(int key) { PostMessage(Fisher.GTA().MainWindowHandle, WM_KEYDOWN, key, 0); }