All pastes #994314 Raw Edit

m_calc

public text v1 · immutable
#994314 ·published 2008-04-23 09:19 UTC
rendered paste body
;     
;     Template module for #KefkasTower Guardian bot
;     

on *:load:{ add_command CALC }
on *:load:{ add_command MODINFO }

;     Variables and other stuff:
;     
;     %mainchan - Main channel.
;     ${NULL} - Nothing.
;     send - Send a notice to the person who triggered the code.
;     
;     You can make your own variables within the module source.
;     It is recommended to use the format %m_yourmodulename.variablename


on *:text:*:?:{
  if (($1 == MODINFO) && ($2 == ${NULL})) {
    send Module: Calc (Desc) {MODINFO A calculator.}
  }
  elseif (($1 == MODINFO) && ($2 == YOUR_MODULE_NAME)) {
    send IRC Calc
    send Modver1.0 Author: Sam
  }
  elseif (($1 == HELP) && ($2 == COMMANDS)) {
    send CALC: (An IRC calculator)
    ;     Only use this if you want a help function included.
    ;     If not, use a blank here.
  }
  elseif (($1 == HELP) && ($2 == CALC)) {
    send A calculator.
    send Syntax: CALC <ops>
    ;     Only include this if you want a help function included.
    ;     If not, use:
    ;     send No help for $2 $+ . See /MSG $me HELP for more info.
  }

  ;     Include what your module does here if it requires you to PRIVMSG the bot.
  ;     If it doesn't, include whatever conditions need to be met in another ON: event, below.
  ;     In this example, we'll include both.

  elseif ($1 == CALC) {
    if ($2 == ${NULL}) {
      send Not enough parameters.
      halt
    }
    else {
      send $calc($2-)
      halt
    }
  }
}
;     If your module is not a command, use this:
;        send  $+ $1 $+ : Unknown command. See /MSG $me HELP for more info.
;        halt





;     The non-command example follows.