Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 3.24 KB | None | 0 0
  1. on *:text:!say*:*: {
  2.   ;if ($readini(access.ini,users,$nick)) {
  3.   if ($2 == part) {
  4.     if ($3 == $null) { /part $chan }
  5.     else { /part $3 }
  6.   }
  7.   else if ($2 == logina) { /nick AndyD | /ns id ***}
  8.   else if ($2 == logins) { /nick Spartain | /ns id ***}
  9.   else if ($2 == loginb) { /nick [Lt]Caller | /ns id ***}
  10.   else if ($2 == /j) || ($2 == join) || ($2 == /join) { /j $3 }
  11.   else if ($2 == channel) { /msg $3 14[Message from $nick $+ ] $+   $4- }
  12.   else if ($2 == rank) {
  13.     set %done = false
  14.     set %rank $4
  15.     set %test.access True
  16.     set %test.nick1 $nick
  17.     set %test.nick2 $3
  18.     set %test.nick $nick
  19.     set %test.chan $chan
  20.     set %try 0
  21.     /cs access $chan list
  22.     /echo Variables set, reading Access list (var1 = %read3 var2 = %read5 $+ )
  23.     /timer 1 2 /cs Wait
  24.   }
  25.   else { /msg $chan $2- }
  26. }
  27. on *:notice:*:*: {
  28.   /set %read6 $1-
  29.   if (%test.access == True) {
  30.     if (Denied isin %read6) { /msg %test.channel The bot does not have the access level required to rank people, you need to find another means. | goto unset }
  31.     /set %read $2-
  32.     if (%test.nick1 isin %read) {
  33.       /set %read2 %read
  34.       /set %read3 $remove( %read2, %test.nick1 )
  35.       if (%read3 isnum) /msg %test.chan %test.nick1 $+ 's access is %read3
  36.    }
  37.    if (%test.nick2 isin %read) {
  38.      /set %read4 %read
  39.      /set %read5 $remove( %read4, %test.nick2 )
  40.      if (%read5 isnum) /msg %test.chan %test.nick2 $+ 's access is %read5
  41.       /timer 1 1 /set %done true
  42.       /timer 1 10 /set %test.access False
  43.     }
  44.     if ( wait isin %read6 ) {
  45.       if (%done != true) {
  46.         if (%try < 1) {
  47.           timer 1 2 /cs Wait
  48.           set %try $calc(%try + 1)
  49.         }
  50.         else {
  51.           /set %done true
  52.           /cs Wait
  53.           /set %read5 0
  54.           /msg %test.chan %test.nick2 $+ 's access is 0.
  55.        }
  56.      }
  57.      else if (%done == true) {
  58.        if (%read3 > %read5) {
  59.          if (%rank >= %read3) {
  60.            /msg %test.chan %test.nick $+ , That rank is higher than you are normally able to access. Sorry
  61.            goto unset
  62.          }
  63.          else {
  64.            /echo access list read, Variables found, posting results, unsetting variables
  65.            /cs access %test.chan add %test.nick2 %rank
  66.            /msg %test.chan %test.nick1 has ranked %test.nick2 to access level %rank
  67.          }
  68.        }
  69.        Else if (%read3 == %read5) { /msg %test.chan %test.nick1 $+ , You and %test.nick2 are the same rank, therfore, you cannot change their access.
  70.        }
  71.        Else if (%read5 > %read3) { /msg %test.chan %test.nick1 $+ , you do not have enough access to rank him. Sorry.
  72.        }
  73.      }
  74.      goto end
  75.      :unset
  76.      /timer 1 10 unset %done = false
  77.      /timer 1 10 unset %rank $4
  78.      /timer 1 10 unset %test.access True
  79.      /timer 1 10 unset %test.nick1 $nick
  80.      /timer 1 10 unset %test.nick2 $3
  81.      /timer 1 10 unset %test.nick $nick
  82.      /timer 1 10 unset %test.chan $chan
  83.      /timer 1 10 unset %read
  84.      /timer 1 10 unset %read2
  85.      /timer 1 10 unset %read3
  86.      /timer 1 10 unset %read4
  87.      /timer 1 10 unset %read5
  88.      /timer 1 10 unset %read6
  89.      /timer 1 10 unset %try
  90.      /timer 1 10 /set %test.access False
  91.      :end
  92.    }
  93.  }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement