So im trying to make an executor but i got that error along with "A namespace cannot directly contain members such as field, methods or statements"
i tried looking into it myself and googling around a bit but couldnt really find a solution to the problem, any help here are of course appreciated as this is a project i would like to get working to 100% as intended.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WeAreDevs_API;
namespace ZynTap_Executor
{
ExploitAPI api = new ExploitAPI();
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Environment.Exit(0);
}
Point lastPoint;
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
lastPoint = new Point(e.X, e.Y);
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.Left += e.X - lastPoint.X;
this.Top += e.Y - lastPoint.Y;
}
}
private void button2_Click(object sender, EventArgs e)
{
WindowState = FormWindowState.Minimized;
}
private void button4_Click(object sender, EventArgs e)
{
fastColoredTextBox1.Clear();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
api.SendLuaScript(fastColoredTextBox1.Text);
}
private void button8_Click(object sender, EventArgs e)
{
api.LaunchExploit();
}
private void button5_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
openFileDialog1.Title = "Open";
fastColoredTextBox1.Text = File.ReadAllText(openFileDialog1.FileName);
}
}
private void button6_Click(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
using (Stream s = File.Open(saveFileDialog1.FileName, FileMode.CreateNew))
using (StreamWriter sw = new StreamWriter(s))
{
sw.Write(fastColoredTextBox1.Text);
}
}
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
fastColoredTextBox1.Text = File.ReadAllText($"./Scripts/{listBox1.SelectedItem}");
}
private void button7_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();//Clear Items in the LuaScriptList
Functions.PopulateListBox(listBox1, "./Scripts", "*.txt");
Functions.PopulateListBox(listBox1, "./Scripts", "*.lua");
}
}
}