Accessadd

By DragonFlare on Dec 04, 2008

i got bored and decided to make this Napa182 helped me with it it only works for Admin status it dont give out any other status it uses a while loop to if the nick is in the var it +a's them plzz leave comments and Enjoy

Im working on adding some more code to it to allow you to give more status with it any suggestions would be appreciated

on @*:Text:*:#:{
  if ($strip($1) == !accessadd) {
    .cs access $chan add $2-
    set %Levels.$chan $addtok(%Levels.$chan,$2,44)
    msg $chan 4 Access List updated for $2 To $3
  }
  if ($strip($1) == !sync) { var %^ = $numtok(%Levels.$chan,44) | while (%^) { mode $chan +a $gettok(%Levels.$chan,%^,44) | dec %^ } }
}

Comments

Sign in to comment.
NIGathan   -  Dec 06, 2008

You can also reduce the lines for !sync by doing this:

if ($strip($1) == !sync) {
mode $chan + $+ $iif($replace($readini(levels.ini,Level,$2),3,v,4,h,5,o,6,o,7,o,8,o,9,o,10,a,9999,vhoaq) !isnum,$v1 $str($2 $+ $chr(32),$len($v1)),$iif($v1 > 10,a $2))
}
 Respond  
NIGathan   -  Dec 06, 2008
%var = $readini(Levels.ini,Level,$2,$3)

Why do you have that fourth parameter?
/help $readini
The only time you would ever have four params, is if you specify either of the "np" switches in the second param.

Also, whats $check?

 Respond  
DragonFlare   -  Dec 04, 2008

not yet Napa182 one sec and i will.
i think im forgetting to check for the nicks Napa182 how would i go about it on the script i just posted as a comment?

i just threw this part of the code together on the bottom part Napa182 this is what i want it to do

 on *:Text:*:#:{
  if ($me isop $chan) {
    if ($nick isop $chan) {
      if ($strip($1) == !accessadd) {
        cs access $chan add $2
        msg $chan AccessList Updated For $2 To $3
        writeini Access.ini $2 Nick $2 $3
        writeini Levels.ini Level $2 $3
      }
      if ($strip($1) == !sync) {
        %var = $readini(Levels.ini,Level,$2,$3)
        %var = $Check(Levels.ini,Level,$2)
        if (%var = 3) { Mode $chan +v $2 }
        if (%var = 4) { Mode $chan +h $2 }
        if (%var = 5) { mode $chan +o $2 }
        if (%var = 9) { mode $chan +o $2 }
        if (%var = 10) { mode $chan +a $2 }
        if {%var = 9999) { mode $chan +vhoaq $2 $2 $2 $2 $2 }
        } 
      }
    }
  }
}

thats what i want it to be like but i think it needs to check the ini file for the nick and the level how would i go about that napa182 and i still dont think the vars are right on it

 Respond  
napa182   -  Dec 04, 2008

hmm did you try the one i left as a comment

 Respond  
DragonFlare   -  Dec 04, 2008

i wanted to use something like this thou

 on *:Text:*:#:{
  if ($me isop $chan) {
    if ($nick isop $chan) {
      if ($strip($1) == !accessadd) {
        cs access $chan add $2
        msg $chan AccessList Updated For $2 To $3
        writeini Access.ini $2 Nick $2 $3
        writeini Levels.ini Level $2 $3
        msg $chan 4  AccessList Updated
      }
      if ($strip($1) == !sync) {
        %var = $readini(Levels.ini,Level,$2,$3)
        if (%var = $2,4) { Mode $chan +h $2 }
      }
    }
  }
}

but i cant get the vars on this right

 if ($strip($1) == !sync) {
%var = $readini(Levels.ini,Level,$2,$3)
if (%var = 4) { mode $chan +h $2 }
}

cause like i said i want to make it with more access add commands and i want it to sync and read from the ini file to give the right status to the right nick but i cant figure the vars out any suggestions would be appreciated i kinda wanna stay along the lines of the code.

 Respond  
napa182   -  Dec 04, 2008
on owner:Text:*:#:{  
  if ($strip($1) == !accessadd) { 
    .cs access $chan add $2- 
    set $+(%,Levels,.,$chan) $addtok($($+(%,Levels,.,$chan),2),$2,44)    
    msg $chan 4 Access List updated for $2 To $3 
  } 
  if ($strip($1) == !sync) { var %^ = $numtok($($+(%,Levels,.,$chan),2),44) | while (%^) { mode $chan +a $gettok($($+(%,Levels,.,$chan),2),%^,44) | dec %^ } }
}

but like i said you should maybe add some error checks to it.

 Respond  
guest598594   -  Dec 04, 2008

Does %Levels.$chan even work? I'm pretty sure you'd have to do it one of these ways:

%Levels. [ $+ [ $chan ] ]
;or
$(%Levels. $+ $chan,2)

And you shouldn't just let anyone use the on text, maybe only let ops use it.

 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.