Channel Access Command For Bots

By Brock on Oct 06, 2010

You can turn with any command related to access cmds..in IRC
like
!access add
!access del
!access list

To start its working
Open the Bot's mIRC Window and type /access
Thats all..

#########Access Chan Commands For Bot ###########

alias Access-on {
  .guser Services Chanserv 8
  set %access on
}
alias Access-off {
  .ruser Services Chanserv 8
  set %access off
}
on @*:TEXT:!access*:#: {
  if ($nick isop $chan) && (%access == on) {
    if ($2 == add) { 
      cs access $chan add $3 $4
      notice $chan $3 Is added to Level $4
    }
    elseif ($2 == del) { 
      cs access $chan del $3
      notice $chan $3 Deleted from Access list
    }
    elseif ($2 == list) { 
      cs access $chan list 
      set %anick $nick
    }
    else { halt }
  }
}

on Services:NOTICE:*:*: {
notice %anick $1-
}

Comments

Sign in to comment.
N3M3S1S   -  Oct 09, 2010

No problem man, that's what a technology social network is for!

 Respond  
Brock   -  Oct 09, 2010

thanks for you help

 Respond  
N3M3S1S   -  Oct 07, 2010

Its okay, that's why I posted that chunk for you, so you could learn. Not bad for the first time. But now your snippet has another fatal error. You forgot the "o" in on TEXT :P You can also combine the if ($nick isop $chan) and if (%access == on) into one line. Like this:

on @*:TEXT:!access*:#: {
  if ($nick isop $chan) && (%access == on) {
    if ($2 == add) { 
      cs access $chan add $3 $4
      notice $chan $3 Is added to Level $4
    }
    elseif ($2 == del) { 
      cs access $chan del $3
      notice $chan $3 Deleted from Access list
    }
    elseif ($2 == list) { 
      cs access $chan list 
      set %anick $nick
    }
    else { halt }
  }
}
 Respond  
Brock   -  Oct 07, 2010

sorry it was my first time..and first try..

 Respond  
N3M3S1S   -  Oct 06, 2010

Here this would make it more secure so that only current channel ops can add access. You also don't need the if (%access == on) more than once.

on @*:TEXT:!access*:#: {
  if (%access == on) {
    if ($2 == add) { 
      cs access $chan add $3 $4
      notice $chan $3 Is added to Level $4
    }
    elseif ($2 == del) { 
      cs access $chan del $3
      notice $chan $3 Deleted from Access list
    }
    elseif ($2 == list) { 
      cs access $chan list 
      set %anick $nick
    }
    else { halt }
  }
}
 Respond  
napa182   -  Oct 06, 2010

horrible coding habits
=/
a bit redundant with the (%access == on)
this is so unsecure any one could give them selves access
you have a set access on but no off. also what if the bot or w/e is running this has no room access. it would just error.
maybe add some flood pros to it.
ur halt is useless

 Respond  
Memoli   -  Oct 06, 2010
notice $chan $3 Is added to Level 4

You forgot the $ by 4 = $4 :)

 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.