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 }
}
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. :)
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.