C
C#2mo ago
Her King™

"Bot" for Last Chaos Game

$code using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; using System.Windows.Forms; namespace Karho { public partial class Form1 : Form { [DllImport("user32.dll")] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll")] private static extern bool SetForegroundWindow(IntPtr hWnd); private Thread sendKeysThread; private bool isSendingKeys = false; public Form1() { InitializeComponent(); LoadRunningApplications(); // Lade die laufenden Anwendungen beim Starten der Form } private void LoadRunningApplications() { if (InvokeRequired) { Invoke(new Action(LoadRunningApplications)); return; } comboBoxApplications.Items.Clear(); Process[] processes = Process.GetProcesses(); foreach (var process in processes) { if (!string.IsNullOrEmpty(process.MainWindowTitle)) { // Überprüfen, ob der Prozess den gewünschten Namen oder Fenstertitel hat if (process.ProcessName.Equals("Nksp", StringComparison.OrdinalIgnoreCase) process.ProcessName.Equals("Nksp.exe", StringComparison.OrdinalIgnoreCase) process.MainWindowTitle.IndexOf("Last Chaos", StringComparison.OrdinalIgnoreCase) >= 0) { comboBoxApplications.Items.Add(process.MainWindowTitle); } } } } private void buttonStart_Click(object sender, EventArgs e) { if (comboBoxApplications.SelectedItem == null) { MessageBox.Show("Bitte wähle eine Anwendung aus der Liste aus."); return; } isSendingKeys = true; sendKeysThread = new Thread(SendKeysLoop); sendKeysThread.Start(); } private void buttonStop_Click(object sender, EventArgs e) { isSendingKeys = false; if (sendKeysThread != null && sendKeysThread.IsAlive) { sendKeysThread.Join(); } } private void buttonRefresh_Click(object sender, EventArgs e) { LoadRunningApplications(); } private void SendKeysLoop() { IntPtr hWnd = IntPtr.Zero; // Zugriff auf die ausgewählte Anwendung soll im UI-Thread erfolgen if (InvokeRequired) { Invoke(new Action(() => hWnd = FindWindow(null, comboBoxApplications.SelectedItem.ToString()))); } else { hWnd = FindWindow(null, comboBoxApplications.SelectedItem.ToString()); } if (hWnd == IntPtr.Zero) { MessageBox.Show("Fenster konnte nicht gefunden werden."); return; } while (isSendingKeys) { // Setze das Fenster in den Vordergrund im UI-Thread if (InvokeRequired) { Invoke(new Action(() => SetForegroundWindow(hWnd))); } else { SetForegroundWindow(hWnd); } SendKeys.SendWait("1"); Thread.Sleep(1000); SendKeys.SendWait("2"); Thread.Sleep(1000); SendKeys.SendWait("{TAB}"); Thread.Sleep(1000); } } } } So this is my code and when I chose the right program (NKSP/LastChaos) It wont send the theys which I want to send ? Maybe anyone know this issues?
7 Replies
MODiX
MODiX2mo ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat For longer snippets, use: https://paste.mod.gg/
Buddy
Buddy2mo ago
What does the terms of service say regarding botting?
Her King™
Her King™OP2mo ago
Well its allowed as long ur not using it AFK 😅 There is another Program which I used for years without problem which is called UOPilot but I kinda want my own program for it
Buddy
Buddy2mo ago
Please contact staff via #report-a-problem and check if they allow it. If not, I'm sorry but we cannot help you.
Her King™
Her King™OP2mo ago
Alright I'll do that
SleepWellPupper
SleepWellPupper2mo ago
It's against TOS afaict: in the "8. PROHIBITED ACTIVITIES" Section:
Engage in any automated use of the system, such as using scripts to send comments or messages, or using any data mining, robots, or similar data gathering and extraction tools.
SleepWellPupper
SleepWellPupper2mo ago
charly88
Fawkes
Terms
Fawkes Games – Indie Game Ops & Studio

Did you find this page helpful?