mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2005
Posts: 8
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2005
Posts: 8
Ok Im trying to script command levels and I don't know the following.

A: With the user list, do you just put the names like 1:geometric for example? Where do you have to put this document into to make it so that mirc reads it?

B:How do I set commands for certain leveks? Im confused on this...how would I set like level 6 gets /kill, level 7 gets kline, etc.? confused

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Yes, it's like 1:geomtric, they go in the "Users" section of the mIRC Script editor. As for the /kill I don't know what you mean. Only IRCops can use those commands.

Last edited by SladeKraven; 08/01/05 12:39 AM.
Joined: Jan 2005
Posts: 8
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2005
Posts: 8
hmm....... Well Im doing this on an unrealircd if that helps....and I thought that you could do that....on diff. user levels. :|

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You have to be an IRCop in that respect to use the /kill function. Geeez, it'd be chaos if anyone could use the /kill function to local kick someone off the server don't you think?

Joined: Jan 2005
Posts: 8
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2005
Posts: 8
no lol Im creating my own client!!!

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
IRCd client?

Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
for userlist my personal recommendatios is to do it by id
or if u want to be pretty safe just type /guser <level> nick
while they are present


The Kodokan will move you, one way or another.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I'd actually go with hash tables. Excuse the sloppy code it is 04:27 am and I've been drinking hehehehe..

Code:
on *:start: {  
  if ($exists(users.hsh)) {     
    hload -i users users.hsh
  }
  else { hmake users 100 }
}
alias user {
  if ($1 == add) {
    if ($hfind(users,$2)) {
      echo -a $2 is already in the database.
      halt
    }
    if (!$2) { 
      .echo -a No Account name specified. Access Denied.
      halt 
    }
    if ($2) &amp;&amp; (!$3) { 
      .echo -a No Account password specified. 
      halt 
    }
    if ($2) &amp;&amp; ($3) { 
      if ($hget(users)) { 
        hadd users $2 $3
        .echo -a Account name $2  with password $3 created.
        if ($hget(users)) { 
          hsave -i users users.hsh 
        }
        halt 
      }
      else { 
        hmake users
        .echo -a Account name $2  with password $3 created.
        halt 
      }
    }
  }
  if ($1 == del) {
    if (!$2) { echo -a You didn't specify an account. | halt }
    if (!$hfind(users,$2)) { 
      .echo -a $2 is not in the database and can't be removed.
      halt 
    }
    else { 
      .echo -a $2 has been removed from the database.
      hdel -w users $2
      .echo -a *** Now saving database.
      hsave -i users users.hsh
      .echo -a *** Database saved.
    }
  }
  else { 
    halt 
  }
}

on 1:Text:login*:?: {
  if (!$hfind(users, $nick)) { 
    .notice $nick Sorry, your nickname is not on my user database. 
    halt 
  }
  if ($hfind(users, $2)) &amp;&amp; (!$3) { 
    .notice $nick You didn't specify a password. 
    halt 
  }
  if ($hfind(loggedin_nicks, $2))  { 
    .notice $nick You are already logged in. 
    halt
  }
  if ($hfind(users, $2)) &amp;&amp; ($hget(users,$2) == $3) { 
    .notice $nick Authorisation to your user " $+ $hfind(users,$2) $+ " with password  $+ $3 $+  has been accepted.
    hadd -m loggedin_nicks $2 Yes
    hsave -i loggedin_nicks loggedin_nicks.hsh 
    halt  
  }
  if ($hfind(users, $2)) &amp;&amp; ($hget(users,$2) != $3) { 
    .notice $nick Password for account " $+ $hfind(users,$2) $+ " is incorrect. 
    halt 
  }
  if ($hfind(users, $2)) &amp;&amp; (!$3) { 
    .notice $nick You didn't specify a password. 
    halt
  }
}

on 1:text:logout*:?: {
  if ($hfind(loggedin_nicks, $nick)) { 
    hdel loggedin_nicks $nick 
    hsave -i loggedin_nicks loggedin_nicks.hsh 
    .notice $nick You have successfully logged out.
    halt 
  }
  if (!$hfind(loggedin_nicks, $nick)) { 
    .notice $nick You are already logged out.
    halt
  }
  if (!$hfind(loggedin_nicks, $nick) &amp;&amp; $hfind(users,$nick)) { 
    .notice $nick You don't have an account so how can I log you out $nick $+ .
    halt
  }
}

on *:exit:{ 
  hsave -i users users.hsh
}

on *:Text:changepass*:?: {
  if (!$hfind(users,$nick)) { .notice $nick You don't have an account. | halt }
  if (!$hfind(loggedin_nicks,$nick)) { .notice $nick You are not logged in. | halt }
  if ($hfind(loggedin_nicks,$nick) &amp;&amp; (!$2)) { .notice $nick Usage: changepass &lt;oldpass&gt; &lt;newpass&gt; | halt }
  if ($hfind(loggedin_nicks,$nick)) &amp;&amp; ($2 == $hget(users,$nick) &amp;&amp; (!$3)) { .notice $nick changepass $2 &lt;new password&gt; | halt }
  if ($hfind(loggedin_nicks,$nick)) &amp;&amp; ($2 == $hget(users,$nick) &amp;&amp; ($3)) { .notice $nick Password changed to: $3  | .notice $nick For a future login type /msg $me login $nick $3 | hadd users $nick $3  | halt  }
  if ($hfind(loggedin_nicks,$nick)) &amp;&amp; ($2 == $hget(users,$nick) &amp;&amp; $3 == $hget(users,$nick)) { .notice $nick your password is already $3 | halt }
}


Link Copied to Clipboard