access list

By BluntMasta on Oct 02, 2012

This is my very first basic channel access list hope it works for you to learn from if you have any comments leave em thankyou

on *:TEXT:*:#yourchannelhere:{
  if ($1 == !add) && ($nick isop #) {
    writeini users.ini $2 level $3
  }
  elseif ($1 == !del) && ($nick isop #) {
    remini users.ini $2
  }
}

on *:JOIN:#itech-for-iphone-lifecasting:{
  if ($readini(users.ini,$nick,level) isnum 1-3) { mode # +v $nick }
  if ($readini(users.ini,$nick,level) isnum 4-6) { mode # +h $nick }
  if ($readini(users.ini,$nick,level) isnum 7-10) { mode # +o $nick }
  if ($readini(users.ini,$nick,level) isnum 11-9998) { mode # +a $nick }
  if ($readini(users.ini,$nick,level) isnum 9999) { mode # +q $nick }
}

Comments

Sign in to comment.
Jethro   -  Oct 03, 2012

mIRC has a nifty function to add user lists via /auser or /guser command. You can then use if ($ulevel == ) { here to check the matching nicknames that you've added. Finally you merely need one check for the op to trigger the code, rather than have one per each if statement. Good job nevertheless.

 Respond  
Abcdefmonkey   -  Oct 03, 2012

Although I haven't really tried this, it looks like it should work as-is. I would add a check to ensure that a $2 and $3 is there when triggering the command. Possibly something like this

writeini users.ini $$2 level $$3

Just a simple way to do it. The $$'s ensure that the command will on trigger if the $2/$3 are present. However, there are other ways to check for such things and also return an error possibly if desired.

Example:

if ($1 == !add) && ($nick isop #) && (!$2) || (!$3) { writeini users.ini $2 level $3 }
else { notice $nick ERROR: Wrong Syntax. Correct syntax: !Add <nick> <level> }

The ! in front of the $ checks if that parameter exists in the trigger. If the $2 or $3 doesn't exist (The || means or)

Just some tips. Don't take it as me implying you're a noob by detailing my examples. I don't mean it in any fashion as that.

Good job overall. :)

 Respond  
Sorasyn   -  Oct 03, 2012

I see you can use ini files efficiently enough. Would it not be more prudent to instead categorize them by channel? It seems that you're categorizing them by nickname, which means the file will have several sections with only one entry.

Structure is as followed:

[#Channel]
Power=10
BluntMasta=9999

Which can be called with a slight modification to that of your own. $readini(users.ini,$chan,$nick) which would return the number or level associated with that nick on the particular channel. As such on channel #Channel I would have an access level of 10 and you would have an access level of 9999.

 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.