So the purpose of this little exercise was to come up with a way to allow users to create scripts for a bot using c#. This simple (and unfinished) program is a proof of concept of a c# script loader.
This loader will compile source into an assembly file, instantiate every class within the file and then allow the user to invoke methods within each class on demand.
As an example, I am working on a semi-bot that will take user input (keystrokes) which can be mapped to a specific class/method in one of these scripts.
LoadScript.zip
This is the script file I used in the example. It doesn't really do anything, but if you need an example of how it should be formatted, here it is.
Code:
using System;
using System.Windows.Forms;
class NefRaid
{
public void OnyxiaRotation()
{
MessageBox.Show("Attacking onyxia");
}
public void Phase2()
{
MessageBox.Show("Next phase rotation");
}
public void Nef()
{
MessageBox.Show("Main rotation");
}
}
class AoE
{
public void CastOnTarget()
{
MessageBox.Show("Performing AoE @ Target");
}
public void CastOnMe()
{
MessageBox.Show("Performing AoE @ Self");
}
}
class HealingRotation
{
public void TankHeal()
{
MessageBox.Show("Healing Tank");
}
public void GroupHeal()
{
MessageBox.Show("Healing Group");
}
}
You can save it as .cs, .txt. or .script. Any of those are valid extensions.