mIRC Home    About    Download    Register    News    Help

Print Thread
Admin Script #250508 18/01/15 09:24 PM
Joined: Dec 2014
Posts: 26
A
Athenlayjoshr Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Dec 2014
Posts: 26
What i need help with is i have this little command and it does not work smirk
Code:

On *:text:!admin add:#:{
if ($nick == athenlayjoshr) { msg $chan $3 Has been added to admin group. $+
write -c Admins.txt
write Admins.txt $3
}
}

Re: Admin Script [Re: Athenlayjoshr] #250509 18/01/15 09:49 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Try use this code:

Code:
ON !*:TEXT:!admin & &:#: {
  if ($nick == athenlayjoshr) {
    if ($2 == add) {
      if (!$3) { msg # ( $+ $nick $+ ): Error, Try again and enter the nickname! | return }
      if ($read(admins.txt,nw,$3)) { msg # ( $+ $nick $+ ): This nickname is already in the list! | return }
      write Admins.txt $3
      msg $chan ( $+ $nick $+ ): $3 has been added to admin group.
    }
    if ($2 == del) || ($2 == delete) || ($2 == remove) || ($2 == rem) {
      if (!$3) { msg # ( $+ $nick $+ ): Error, Try again and enter the nickname! | return }
      var %r = $read(admins.txt,nw,$3)
      var %rn = $readn
      if (!%r) { msg # ( $+ $nick $+ ): This nickname is NOT in the list! | return }
      write -dl $+ %rn Admins.txt
      msg $chan ( $+ $nick $+ ): $3 hs been deleted from the admin group.
    }
  }
}

Re: Admin Script [Re: westor] #250510 18/01/15 09:53 PM
Joined: Dec 2014
Posts: 26
A
Athenlayjoshr Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Dec 2014
Posts: 26
That worked, Now if i wanted someone to be in that list to do a command would it be
if($nick == Admins.txt)
???

Re: Admin Script [Re: Athenlayjoshr] #250511 18/01/15 09:55 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
if ($read(admins.txt,nw,$nick)) { do stuff }

Re: Admin Script [Re: westor] #250512 18/01/15 09:57 PM
Joined: Dec 2014
Posts: 26
A
Athenlayjoshr Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Dec 2014
Posts: 26
That did not work smirk
Code:

on *:text:!announce off:#drplaystation: {
if ($read(admins.txt,nw,$nick) { return }
else {
msg # $nick >Announcements are stopping in this channel.
.timer.timername off
}
}

Last edited by Athenlayjoshr; 18/01/15 09:59 PM.
Re: Admin Script [Re: Athenlayjoshr] #250513 18/01/15 10:02 PM
Joined: Dec 2014
Posts: 26
A
Athenlayjoshr Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Dec 2014
Posts: 26
Wait nvm

Re: Admin Script [Re: Athenlayjoshr] #250514 18/01/15 10:03 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Try use ! character for negative

if (!$read(admins.txt,nw,$nick)) { do stuff }

Re: Admin Script [Re: Athenlayjoshr] #250515 18/01/15 10:31 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Also make sure the Parentheses match, you miss one closing ) in that script.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net