Addstaff And Title

By Hammer on Jun 28, 2012

As the title says, simply adds someone as Special Friend, Scripting Helper etc.

Things to do :
1) Set a variable called %level containing all levels you've created; Example : %level 250 500 750 900 1000
2) Create A Section In Staff.ini File Called [DontUse] And Create An Item Containing The Titles You Dont Want Others To Use. Edit The Item Name In The End Of Code Too To Make It Work!

[*]Paste This In Your Staff.ini File :
[gTitles]
250=Hammer's Friend
500=Hammer's Special Friend
750=Troller
900=Scripting Helper
1000=The Pro Troller

Please report if there is any bug!

; Addstaff And Title Beta 1.1
; By Hammer
; gs.mindfreakers.net #Hawkee

alias addlevel {
  if ($1 && $2) { set %levels %levels $2 | writeini Staff.ini gTitles $1 $2- | echo -a Level $1 Added! | halt }
  else { echo -a Syntax : /addlevel <level> <title> }
}
on *:TEXT:!addstaff*:#: {
  if ($nick !isop #) { msg $chan You're not an OP. Only OPs can use this command. }
  else {
    if ($2- == $null) {
      msg $chan The Following Levels Are Available:
      var %x = 1
      while ($ini(Staff.ini,gTitles,%x)) {
        msg $chan Level $ini(Staff.ini,gTitles,%x) - $readini(Staff.ini,n,gTitles,$ini(Staff.ini,gTitles,%x))
        inc %x
      }
      msg $chan Syntax : !addstaff <Nickname> <Level>
      halt
    }
    if ($3 == $null) {
      msg $chan Please Choose A Level For $2
      halt
    }
    if ($3 == 1) {
      tokenize 32 Staff Welcome gLevels
      remini Staff.ini $* $2    
      kick # $2 Please Rejoin To Get Your Normal Status.
      msg $chan Added $2 As $3
      halt
    }
    if (($2) && ($3)) {
      if ($2 !ison #) { msg $chan $2 Isn't Online!
      halt }
      if ($2 ison #) {
        if ($3 isin %levels) {
          writeini Staff.ini Staff $2 $readini(Staff.ini,n,gTitles,$3)
          writeini Staff.ini Welcome $2 $readini(Staff.ini,n,gTitles,$3) $2
          writeini Staff.ini gLevels $2 $3
          kick # $2 You Have Been Added To Our Special Users List! Please Rejoin.
          msg $chan Added $2 As $3
          halt
        }
        elseif ($3 !isin %levels) { msg $chan Level $3 Doesn't Exist! }
      }
    }
  }
}
on *:JOIN:#: {
  if ($nick == $me) { halt }
  if ($readini(Staff.ini,n,Welcome,$nick) == $null) {
    writeini Staff.ini Welcome $nick $nick
  }
  if ($readini(Staff.ini,n,ID,$nick) == $null) {
    set %rand $rand(1,10000)
    if ($readini(Staff.ini,n,USED_IDs,%rand) != USED) {
      writeini Staff.ini ID $nick $rand(1,10000)
      writeini Staff.ini USED_IDs %rand USED
    }
  }
  if ($readini(Staff.ini,n,Greets,$nick) == $null) {
    msg $chan [ $+ $readini(Staff.ini,n,Welcome,$nick) $+ ] No greet. Type !Greet to set one.
  }
  else {
    msg $chan [ $+ $readini(Staff.ini,n,Welcome,$nick) $+ ] $readini(Staff.ini,n,Greets,$nick)
  }
  if ($readini(Staff.ini,n,Staff,$nick) != $null) {
    if ($readini(Staff.ini,n,gLevels,$nick) == 250) {
      mode # +h $nick
    }
    if ($readini(Staff.ini,n,gLevels,$nick) == 500) {
      mode # +v $nick
    }
    if ($readini(Staff.ini,n,gLevels,$nick) == 750) {
      mode # +h $nick
    }
    if ($readini(Staff.ini,n,gLevels,$nick) == 900) {
      mode # +oa $nick $nick
    }
    if ($readini(Staff.ini,n,gLevels,$nick) == 1000) {
      mode # +qao $nick $nick $nick
    }
  }
  if ($readini(Staff.ini,n,Blacklist,$nick) != $null) {
    kick # $nick You Are Banned.
    halt
  }
}
on *:TEXT:!greet*:#: {
  writeini Staff.ini Greets $nick $2-
  msg $chan Greet Set To : $2-
}
on *:TEXT:!title*:#: {
  if ($2- == $null) {
    msg $chan Format : !title <Title to add> - Will Add A Title Infront Of Your Name.
    msg $chan Please Do Not Choose GM/GA/Owner Or Any Similar Titles Or You Will Be Banned.
    halt
  }
  else {
    if ($2 isin $readini(Staff.ini,n,DontUse,A)) {
      msg $chan You want yourself to get banned?
    }
  }
  if ($readini(Staff.ini,n,Staff,$nick) == $null) {
    writeini Staff.ini Welcome $nick $2- $nick
    msg $chan Title Saved.
    halt
  }
  if ($readini(Staff.ini,n,Staff,$nick) != $null) {
    msg $chan You're Already Added In Staff And Have A Staff Title. You Cannot Change It Unless You Get Kicked Out From Staff.
    halt
  }
}

; Additional Snippet

on *:TEXT:!info*:#: {
  if ($readini(staff.ini,n,Welcome,$2) != $null) {
    msg $chan 9Nickname : $2
    msg $chan 8Unique ID : $readini(staff.ini,n,ID,$2)
    if ($readini(staff.ini,n,gLevels,$2) != $null) { msg $chan 11Staff Level : $readini(staff.ini,n,gLevels,$2) }
    if ($readini(staff.ini,n,Welcome,$2) == $2) { msg $chan 4Title : No Title Set! }
    if ($readini(staff.ini,n,Welcome,$2) != $2) { msg $chan 7Title : $readini(staff.ini,n,Welcome,$2) }
    if ($readini(staff.ini,n,Greets,$2) == $null) { msg $chan 4Greet : No Greet Set! }
    if ($readini(staff.ini,n,Greets,$2) != $null) { msg $chan 9Greet : $readini(staff.ini,n,Greets,$2) }
    halt
  }
  elseif ($2 == $null) {
    msg $chan Syntax : !info <Nickname>
    halt
  }
  if ($readini(staff.ini,n,Welcome,$2) == $null) { msg $chan $2 Doesn't Exist In My Database $+ ! }
}

Comments

Sign in to comment.
Ryahn   -  Aug 30, 2013

I am not sure what is going on. I made the Staff.ini file and it keeps coming up that the level doesnt exist

Hammer  -  Aug 31, 2013

There's an alias (addlevel) that i added just now, that'll do it for you. And just to confirm, check whether you added the level in the variable in %levels as well, that plays an important role.

Ryahn  -  Aug 31, 2013

I know it sounds like I am being difficult but I am still pretty new to MSL. When you say att the %levels, where do I put this?

Hammer  -  Sep 01, 2013

In the variable section, which is the last tab to right where you put the script (ALT+R)

Sign in to comment

Jethro   -  Jun 29, 2012

MashhitDK, there's no trick in learning MSL. Practice, experiment and refer to experienced coders' work. Over time the ugly ducking can become a beautiful swan. We can't expect people to have everything handed to us on a silver platter, can we?

 Respond  
Hammer   -  Jun 29, 2012

@Jethro Thanks, edited.
I made this script back when i was a newbie and didn't really re-check the code, just checked if it was working :)

 Respond  
Jethro   -  Jun 29, 2012

MashhitDK, try and see for yourself. ;)

 Respond  
MashhitDK   -  Jun 29, 2012

So the above is the same as having a remini for each topic ? If I do a

tokenize 32 R1 R2 R3 R4 R5 And.so.on
remini Whatever.ini $* whatever

It wil remove whatever entry in all the "topics" listed in the tokenize ?

EDiT
A yes or no would have been appreciated... but am gonna try it next time I re-code My fail @Jethro

 Respond  
Jethro   -  Jun 29, 2012

You could tokenize it to make it two lines:

tokenize 32 Staff Welcome gLevels
remini Staff.ini $* $2
 Respond  
sagargulati   -  Jun 29, 2012

@Hammer Nice work ;)

 Respond  
Hammer   -  Jun 29, 2012

Level 1 means to remove a user from Staff :)

    if ($3 == 1) {
      remini Staff.ini Staff $2
      remini Staff.ini Welcome $2
      remini Staff.ini gLevels $2
      kick # $2 Please Rejoin To Get Your Normal Status.
      msg $chan Added $2 As $3
      halt
    }
 Respond  
fraguk   -  Jun 29, 2012

why is there no command to remove/del staff.

 Respond  
Hammer   -  Jun 29, 2012

Thanks for the suggestion!

 Respond  
MashhitDK   -  Jun 29, 2012

You could do

mode # +qao $nick $nick $nick

Instead of setting them after each other / one at the time.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.