Here:

In your scripts:

Code:
on *:join:#channel: {
  if (BOTNAME ison $chan) {
    .msg BOTNAME OPME password
  }
  else echo -a Unable to login.  The bot is not online.
}


Replace #channel and BOTNAME and password above.

On bot's script:

Code:
on @*:text:OPME &:?: {
  if ($nick ison #channel && $2 == password) {
    mode $chan +o $nick
  }
  else .msg $nick Error: You are either not in the channel, or you entered an invalid password.
}


Replace #channel and password with the same as you used above. Note that you can manually login by just using /msg BOTNAME OPME password

As a security note:
If anyone gets access to your bot's script or your script, they will find out your password and be able to gain ops. Although not likely, it is something you should consider. You can prevent your side of the script from having the password in it by doing this:

Code:
on *:join:#channel: {
  if (BOTNAME ison $chan) {
    .msg BOTNAME OPME $$?="Enter your password"
  }
  else echo -a Unable to login.  The bot is not online.
}


This will ask you for your password when you join. It would remove your password from being stored anywhere on your own script. That cuts in half the chance of anyone getting ahold of a script with your password in it. Of course, this is no longer completely automatic and if you're not at your computer and reconnect, you won't get opped this way. I offer it just in case you are concerned with security.

Btw, you don't happen to have the ability to register your nickname, do you? Like with NICKSERV? And no CHANSERV, I take it? I assume you don't, but I thought I'd check.


Invision Support
#Invision on irc.irchighway.net