mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2007
Posts: 280
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
Hello, the script below has been created/edited by some people on this discussions board on my request a few years ago.

I just want it edited now, most of it I don't know how to do.

This is the code
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 .: Admin nickname: $nick . :.
          msg $nick .: Log in status: Logged in. :.
          msg $nick .: Log in code: $gettok(%admincode,%nick,164) :.
          set %adminstatus $puttok(%adminstatus,On,%nick,32)
        }
        else {
          msg $nick .: Already logged in :.
        }
      }
      else {
        msg $nick .: Invalid login :.
      }
    }
    else {
      msg $nick .: Your nickname: $nick $+ . :.
      msg $nick .: You're a admin?: No :.
      msg $nick .: You're not permitted to use this command :.
    }
  }
  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 .: Admin nickname: $nick . :.
          msg $nick .: Log in status: Logged out. :.
          msg $nick .: Log out code: $gettok(%admincode,%nick,164) :.
          set %adminstatus $puttok(%adminstatus,Off,%nick,32)
        }
        else {
          msg $nick .: Already logged out :.
        }
      }
      else {
        msg $nick .: Invalid logout :.
      }
    }
    else {
      msg $nick .: Your nickname: $nick $+ . :.
      msg $nick .: You're a admin?: No :.
      msg $nick .: You're not permitted to use this command :.
    }
  }
  elseif ($1 == !add-admin) {
    if ($nick == %superowner) { 
      if (!$3) { msg $nick Invalid format: !add-admin nick passcode | return }
      var %nick = $findtok(%admin,$2,32)
      if (%nick) {
        msg $nick .: $2 already added :.
        msg $nick .: $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 .: New admin added :.
        msg $nick .: Admin is named " $+ $2 $+ " :.
        msg $nick .: Ww $2 == $3- :.
      }
    }
    else { 
      msg $nick .: Your nickname: $nick $+ . :.
      msg $nick .: You're a admin?: No :.
      msg $nick .: You're not permitted to use this command :.
    }
  }
}




I'd to have the admins added into .ini files, example:

Php Code:
[admin]
Name
Lala
[password]
Name=password
Lala=password
[status]
login=false
login=true 

And a command like '!mode' with a check if the person is an admin or not. If it is an admin it needs to check if its logged in (status, login=true) or not. If not > a msg like 'not logged in' etc.etc.

And a command to remove the admins (it already has a add-admin, but no del-admin).

Can someone help?

Last edited by DuXxXieJ; 01/11/10 05:32 PM.

Squee whenever a squee squee's. Squee whenever a squee does not squee.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Would you also like a command to be run (probably) once so that the information in the variables from the current code are transferred to the ini version?

Personally, I'd recommend using a hash table rather than an ini file, as hash tables use roughly the same format as an ini file, but still gives the speed of variables.

I will await your response before coding the changes.

Joined: Jan 2007
Posts: 280
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
Yes I would like that.

About the .ini and the hash, I'd rather have ini. Well, not me, a friend :P.



Squee whenever a squee squee's. Squee whenever a squee does not squee.
Joined: Jan 2007
Posts: 280
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2007
Posts: 280
EDIT:

It can stay this way, only it doesn't work in the new version of mIRC. Possible to rewrite it?


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

Link Copied to Clipboard