A default code to check and study:
/***************************************************
A default base script containing the default events
(c) 2010 - wsIRC.com
****************************************************/
function on_channel_join(server, channel)
{
//send_channel_line(server, channel, "/me bows to the presents.");
}
function on_people_join(server, channel, nick)
{
}
function on_people_leave(server, channel, nick)
{
}
function on_invite_received(server, from, channel)
{
}
function on_kick_received(server, from, channel)
{
}
function on_people_kick(server, from, channel, nick)
{
}
function on_people_quit(server, nick, reason)
{
}
function on_topic_change(server, channel, nick, newtopic)
{
}
function on_nick_change(server, oldnick, newnic)
{
}
function on_people_change_mode(server, channel, from, mode, nicks)
{
}
function on_channel_change_mode(server, channel, from, mode)
{
}
function on_ping(server, from, ping)
{
}
function on_time_request(server, from)
{
}
function on_version_request(server, from)
{
}
function on_message_received(server, channel, from, message)
{
}
// You can store your aliases here, like /bash may do a /me bash somebody.
function on_send(line)
{
parts = split(" ", line);
if (parts[0] == "/bash")
return "/me bashes " + parts[1] + " with a long stick";
return null; // Return null to avoid to modify the string
}
function script_about(server, channel)
{
alert("This is a default script about.");
}
function user_bash(server, channel, nick)
{
send_channel_line(server, channel, "/me bashes " + nick + " with a long stick");
}
function init_menu()
{
add_main_menu("Script About", "script_about", "");
add_user_menu("Bash", "user_bash", "");
}