Do you know mIRC scripting? Well, take procs as an alias, because they function about the same.
Basically, you use the proc to create a custom 'command' or 'function' you want the script to use.
So to use your example, let's create script that works like you wanted:
Code: Select all
# Some Example code for you and comments to go with it ;)
# First let's bind the command properly
bind pub - .loltest loltest
# Now let's bind the test command, but let's make it a little more flexiable
# Note how I left out nick, host, handle, chan and stuff and is only using
# channel - this could be anything, but it makes more sense since that
# variable will hold the channel - but more on this later. Just know that it
# will now work in any channel that the bot is in when somebody
# uses the .loltest command.
proc totest {channel} {
puthelp "PRIVMSG $channel :this is a simple little test :D"
}
#Ok, now for the proc that gets called by the .loltest command.
# Remember that the previous proc works like a command and just
# like if or any other command (like string, etc) it needs to be called
# in [] brackets - also note that since this is the proc called by the public
# bind, we MUST include the standard variables nick, host, handle and
# chan. Ok, now we're going to call the previous proc, but remember
# that since it requires an channel variable, we MUST provide it when
# the command is called with the [] brackets.
proc loltest {nick host handle chan arg} {
[totest $chan]
}
And tada, it should be working now - sorry about the verbose comments, but they explain the basics.
Hope that helps