-
First C# Bot...
Well Im making this bot for Maplestory.
the purpose of the bot is to basically be an FM bot.
So far I coded the letter spammer/ auto chatter perfectly
except I cant figure out how to make the timer interval change wen I set a delay in a textbox
i was thinking the code would be something like
timer1.interval = textbox1.text; or something like that
but it gives me errors
I also need to be able to make a check for the hwnd.
which im lost on how to do.
aswell as having to make an auto clicker...
any help would be appreciated heres my current code
its pretty basic.
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.IO;
using System.Threading;
namespace Fusion
{
public partial class Form1 : Form
{
[DllImport("user32.dll")]
static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk);
[DllImport("user32.dll")]
static extern bool UnregisterHotKey(IntPtr hWnd, int id);
[DllImport("user32.dll")]
static extern IntPtr FindWindow(string lpClass, string lpWindowText);
IntPtr hWnd = FindWindow("MapleStoryClass", null);
public Form1()
{
InitializeComponent();
RegisterHotKey(this.Handle, 10, 0, 0x70);//F1
RegisterHotKey(this.Handle, 20, 0, 0x71);//F2
RegisterHotKey(this.Handle, 30, 0, 0x72);//F3
}
private void timer1_Tick(object sender, EventArgs e)
{
SendKeys.Send("<!>|D|e|F|u|S|e<!> GG");
SendKeys.Send("{Enter}");
}
private void Form1_Load(object sender, EventArgs e) {
}
private void FormMain_Load(object sender, EventArgs e)
{
if ((hWnd = FindWindow("MapleStoryClass", null)) != IntPtr.Zero)
{
}
else
{
MessageBox.Show("Yo Brah Open maplestory first then open this.", "Silly Nub :)!", MessageBoxButtons.OK, MessageBoxIcon.Information);
Environment.Exit(0);
}
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if ((checkBox1.Checked == true))
timer1.Start();
if ((checkBox1.Checked == false))
timer1.Stop();
timer1.Interval = 300;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void helpToolStripMenuItem1_Click(object sender, EventArgs e)
{
}
private void gGToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void gGToolStripMenuItem1_Click(object sender, EventArgs e)
{
}
private void closeBotToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
/*if ((textBox1.text = ))
Show.eror*/
}
private void closeBotToolStripMenuItem_Click_1(object sender, EventArgs e)
{
Close();
}
private void timer2_Tick(object sender, EventArgs e)
{
DoubleClick+= deat;
}
}
}
any help is appreciated
-
Re: First C# Bot...
-
Re: First C# Bot...
Quote:
Originally Posted by
CioNide
Not the first.
But he tried, and that matters...
-
Re: First C# Bot...
What datatype is that Interval property. I'm guessing you're trying to cast a string to an int. If so, I think c# has Integer.parse().
-
Re: First C# Bot...
try {
timer1.interval = int.Parse(textbox1.text);
}