Hi, a while ago I've requested on this forum board an login script, which works fine, but now I want to make other scripts ONLY work when they are logged in (within my login script). So, when I use the trigger ".totalscripts" it may only work when I am logged in.

Here are the 2 scripts, the ".totalscripts" script, and the login script (which contains all the vars etc..)

Code:
ON 1:TEXT:*:#:{
  if $1 == .totalscripts {
    msg $chan TOTAL SCRIPTS: $script(0)
  }
}


Code:
on *:text:*:?: {
  if ($1 == .login) {
    var %nick = $findtok(%admin,$nick,32)
    if (%nick) {
      if ($gettok(%admincode,%nick,164) == $2-) {
        if ($gettok(%adminstatus,%nick,32) == Off) {
          msg $nick LOGIN: You are now logged in as $nick $+ .
          set %adminstatus $puttok(%adminstatus,On,%nick,32)
        }
        else {
          msg $nick LOGIN: You are already logged in.
        }
      }
      else {
        msg $nick LOGIN: Invalid password or nickname (your current nickname).
      }
    }
    else {
      msg $nick LOGIN: You aren't an admin or user.
    }
  }
  elseif ($1 == .logout) {
    var %nick = $findtok(%admin,$nick,32)
    if (%nick) {
      if ($gettok(%admincode,%nick,164) == $2-) {
        if ($gettok(%adminstatus,%nick,32) == On) {
          msg $nick LOGOUT: You are now logged out.
          set %adminstatus $puttok(%adminstatus,Off,%nick,32)
        }
        else {
          msg $nick LOGOUT: You aren't logged in.
        }
      }
      else {
        msg $nick LOGOUT: Invaled password or nickname (your current nickname)
      }
    }
    else {
      msg $nick LOGOUT: You aren't an admin or user.
    }
  }
  elseif ($1 == .add-admin) {
    if ($nick == %owner || $nick == %secondowner) { 
      if (!$3) { msg $nick ADD: Invalid format: .add-admin nick passcode | return }
      var %nick = $findtok(%admin,$2,32)
      if (%nick) {
        msg $nick ADD: $2 is already added.
        msg $nick ADD: $2's password is $gettok(%admincode,%nick,164) $+ .
        return
      }
      else {
        set %admin $instok(%admin,$2,0,32)
        set %admincode $instok(%admincode,$3-,0,164)
        set %adminstatus $instok(%adminstatus,Off,0,32)
        msg $nick ADD: New admin named " $+ $2 $+ ".
        msg $nick ADD: Password of $2 is $3- $+ .
      }
    }
    else { 
      msg $nick ADD: You aren't my owner, or otherwise you aren't an admin or user
    }
  }



Squee whenever a squee squee's. Squee whenever a squee does not squee.