Scripted events


Writing scripted events (scripts) works almost like writing plugins but is limited to static members and has the event keyword. You can only write scripts in the Boo language, but there will soon be support for both C# and VB.NET.

Scripted events is currently limited to a single piece of code that can be edited in the OptionsDialog.

The basic syntax of a script


#language=boo
import Foo from bar

# A static variable
static _myStaticMember = "Hello IRC"

# Hook an event using the special event keyword, note the colon separating the class and event name.
# You don't have to define any parameters, they are always (sender as duck, e as EventArgs).
event MainForm:Move:
	Trace.WriteLine("OMG! The MainForm is moving!!!, Position = " + sender.Position.ToString())
	MyTestMethod(_myStaticMember)

static def MyTestMethod(a):
	Trace.WriteLine("MyTestMethod was called, a = " + a.ToString())


The event keyword


The event keyword automatically hooks an event when an object instance has been created. The syntax is "event ClassName:EventName:".
Note that all classes doesn't support automatic event hooking.

Assemblies


Assemblies must be imported before any static variables or events.

The following assemblies are automatically imported:

  • System.IO
  • System.Text
  • System.Collections
  • System.Diagnostics
  • System.Windows.Forms
  • ChipzIRC
  • Chipz.IRC

Languages


You can specify what language to use by typing #language=lang on the first line of the script.

Valid languages are:

  • Boo
  • C# - C Sharp (not implemented)
  • VB - Visual Basic .NET (not implemented)


ChipzIRC, Scripts

There are no comments on this page. [Add comment]