Simple VIP script [UPDATED]

By xelent on Jul 18, 2008

Copy/Paste in remote (ALT+R) then load, an dialog will come up with further information.

You need to be connect to an IRC network to set Bot owner.

And btw, I'm not the best one in english. But I did my try

Vip skin command will be added soon :)

on *:start:{
  readme-vip
}
on *:Text:$*:%chan.vip:{
  if ($1 == $chr(36) $+ addvipmaster) {
    if (!$address($nick,1)) { notice $nick Fetched your ip-address! write command again! | whois $nick }
    elseif (!$read(vipmasters.txt,s,$address($nick,1))) { notice $nick You are not VIPmaster (Access denied)! }
    elseif (!$2) { notice $nick You have forgotten written nickname! Usage: $chr(36) $+ addvipmaster <nick> }
    else { whois $2 | set %var addvipmaster $nick $2 }
  }
  elseif ($1 == $chr(36) $+ delvipmaster) {
    if (!$address($nick,1)) { notice $nick Fetched your ip-address! write command again! | whois $nick }
    elseif (!$read(vipmasters.txt,s,$address($nick,1))) { notice $nick You are not VIPmaster (Access denied)! }
    elseif (!$2) { notice $nick You have forgotten written nickname! Usage: $chr(36) $+ delvipmaster <nick> }
    elseif ($read(vipmasters.txt,s,$address($2,1))) { write -dl $+ $readn vipmasters.txt | Notice $nick $2 Is now removed! }
    elseif ($read(vipmasters.txt,s,$2)) { write -dl $+ $readn vipmasters.txt | Notice $nick $2 Is now removed! }
    else { whois $2 | set %var delvipmaster $nick $2 }
  }
  elseif ($1 == $chr(36) $+ vipmasterlist) {
    if (!$address($nick,1)) { notice $nick Fetched your ip-address! write command again! | whois $nick }
    elseif (!$read(vipmasters.txt,s,$address($nick,1))) { notice $nick You are not VIPmaster (Access denied)! }
    elseif ($lines(vipmasters.txt) == 0) { notice $nick There is no one in the vip list yet }
    else {
      var %i 1
      var %b 0
      while (%i <= $lines(vipmasters.txt)) {
        timer 1 %b notice $nick %i $+ : $read(vipmasters.txt,%i )
        inc %i
        inc %b 2
      }
    }
  }
  elseif ($1 == $chr(36) $+ addvipchannel) {
    if (!$address($nick,1)) { notice $nick Fetched your ip-address! write command again! | whois $nick }
    elseif (!$read(vipmasters.txt,s,$address($nick,1))) { notice $nick You are not VIPmaster (Access denied)! }
    elseif (!$3) { notice $nick You have forgotten to write a channel or a flag! Usage: $chr(36) $+ addvipchannel <#channel> <+ or @> }
    else {
      if ($read(vipchannels.txt,s,$2)) { write -dl $+ $readn vipchannels.txt }
      write vipchannels.txt $2 $3
      notice $nick $2 Is now a VIP channel and all ops on $2 gets @/+ $3  %chan.vip $+ !
    }
  }
  elseif ($1 == $chr(36) $+ delvipchannel) {
    if (!$2) { notice $nick You forget something! Usage: $chr(36) $+ addvipchannel <#channel> }
    elseif ($read(vipchannels.txt,s,$2)) { write -dl $+ $readn vipchannels.txt | Notice $nick $2 Is now removed! }
  }
  elseif ($1 == $chr(36) $+ vipchannellist) {
    if (!$address($nick,1)) { notice $nick Fetched your ip-address! write command again! | whois $nick }
    elseif (!$read(vipmasters.txt,s,$address($nick,1))) { notice $nick You are not VIPmaster (Access denied)! }
    elseif ($lines(vipchannels.txt) == 0) { notice $nick There is no one in the vip list yet }
    else {
      var %i 1
      var %b 0
      while (%i <= $lines(vipchannels.txt)) {
        timer 1 %b notice $nick %i $+ : $read(vipchannels.txt,%i )
        inc %i
        inc %b 2
      }
    }
  }
  elseif ($1 == $chr(36) $+ addvip) {
    if (!$address($nick,1)) { notice $nick Fetched your ip-address! write command again! | whois $nick }
    elseif (!$read(vipmasters.txt,s,$address($nick,1))) { notice $nick You are not VIPmaster (Access denied)! }
    elseif (!$3) { notice $nick You have forgotten written a nick or a flag!! Usage: $chr(36) $+ addvip <nick> <@ or +> }
    elseif (!$istok(@.+,$3,46)) { notice $nick You have written the sentence to sort! It is + or @! Usage: $chr(36) $+ addvip <nick> <@ or +> }
    else { whois $2 | set %var addvip $nick $2 $3 }
  }
  elseif ($1 == $chr(36) $+ delvip) {
    if (!$address($nick,1)) { notice $nick Fetched your ip-address! write command again! | whois $nick }
    elseif (!$read(vipmasters.txt,s,$address($nick,1))) { notice $nick You are not VIPmaster (Access denied)! }
    elseif (!$2) { notice $nick No nickname written! Usage: $chr(36) $+ delvip <nick> }
    elseif ($read(vipusers.txt,s,$address($2,1))) { write -dl $+ $readn vipusers.txt | Notice $nick $2 Is now removed! }
    elseif ($read(vipusers.txt,s,$2)) { write -dl $+ $readn vipusers.txt | Notice $nick $2 Is now removed! }
    else { whois $2 | set %var delvip $nick $2 }
  }
  elseif ($1 == $chr(36) $+ viplist) {
    if (!$address($nick,1)) { notice $nick Fetched your ip-address! write command again! | whois $nick }
    elseif (!$read(vipmasters.txt,s,$address($nick,1))) { notice $nick You are not VIPmaster (Access denied)! }
    elseif ($lines(vipusers.txt) == 0) { notice $nick There is no one in the vip list yet }
    else {
      var %i 1
      var %b 0
      while (%i <= $lines(vipusers.txt)) {
        timer 1 %b notice $nick %i $+ : $read(vipusers.txt,%i )
        inc %i
        inc %b 2
      }
    }
  }
}
on *:Join:%chan.vip:{
  whois $nick
}
raw 318:*:{
  if (addvipmaster* iswm %var) {
    notice $gettok(%var,2,32) Could not find $gettok(%var,3,32) 
    unset %var
  }
  elseif (delvipmaster* iswm %var) {
    notice $gettok(%var,2,32) Could not find $gettok(%var,3,32)
    unset %var
  }
  elseif (addvip* iswm %var) {
    notice $gettok(%var,2,32) Could not find $gettok(%var,3,32)
    unset %var
  }
  elseif (delvip* iswm %var) {
    notice $gettok(%var,2,32) Could not find $gettok(%var,3,32)
    unset %var
  }
}
raw 311:*:{
  if (addvipmaster* iswm %var) {
    if ($read(vipmasters.txt,s,$address($gettok(%var,3,32),1))) { write -dl $+ $readn vipmasters.txt }
    write vipmasters.txt $address($gettok(%var,3,32),1) $gettok(%var,4,32) 1
    notice $gettok(%var,2,32) $2 Is now VIPmaster and can now add VIP guests
    unset %var
  }
  elseif (delvipmaster* iswm %var) {
    if ($read(vipmasters.txt,s,$address($gettok(%var,3,32),1))) { write -dl $+ $readn vipmasters.txt | Notice $gettok(%var,2,32) $gettok(%var,3,32) Is now removed! }
    else { notice $gettok(%var,2,32) Could not find $gettok(%var,3,32) }
    unset %var
  }
  elseif (addvip* iswm %var) {
    if ($read(vipusers.txt,s,$address($gettok(%var,3,32),1))) { write -dl $+ $readn vipusers.txt }
    write vipusers.txt $address($gettok(%var,3,32),1) $gettok(%var,4,32)
    notice $gettok(%var,2,32) $2 Is now VIP and got $gettok(%var,4,32) when she/he joins!
    unset %var
  }
  elseif (delvip* iswm %var) {
    if ($read(vipusers.txt,s,$address($gettok(%var,3,32),1))) { write -dl $+ $readn vipusers.txt | Notice $gettok(%var,2,32) $gettok(%var,3,32) Is now removed! }
    else { notice $gettok(%var,2,32) Could not find $gettok(%var,3,32) }
    unset %var
  }
  elseif ($istok(@.o.op,$read(vipusers.txt,s,$address($2,1)),46)) && ($2 !isop %chan.vip) {
    inc %counter
    msg %chan.vip 7,1«0,1 VIP detected 7::0,1 7N0,1ick: $2 7::0,1 7H0,1ost: $address($2,2) 7:: I0,1D: %counter 7::0,1 7G0,1ets: (+v)7,1 »
    mode %chan.vip +o $2
  }
  elseif ($istok(+.v.voice,$read(vipusers.txt,s,$address($2,1)),46)) && ($2 !isvoice %chan.vip) && ($nick !isop %chan.vip) {
    inc %counter
    msg %chan.vip 7,1«0,1 VIP detected 7::0,1 7N0,1ick: $2 7::0,1 7H0,1ost: $address($2,2) 7:: I0,1D: %counter 7::0,1 7G0,1ets: (+v)7,1 »
    mode %chan.vip +v $2
  }
  echo -a $1-
}
raw 319:*:{
  if (!%viprot. [ $+ [ $2 ] ]) {
    set -u5 %viprot. [ $+ [ $2 ] ] on
    unset %vipsv
    unset %vipso
    var %i 3
    while (%i <= 24) {
      if ($read(vipchannels.txt,s,$remove($ [ $+ [ %i ] ],@,+))) && (@ == $left($ [ $+ [ %i ] ],1)) {
        if ($istok(@.o.op,$read(vipchannels.txt,s,$remove($ [ $+ [ %i ] ],@,+)),46)) && ($nick !isop %chan.vip) && (!$read(vipusers.txt,s,$address($2,1))) {
          set %vipso $2
        }
        elseif ($istok(+.v.voice,$read(vipchannels.txt,s,$remove($ [ $+ [ %i ] ],@,+)),46)) && ($2 !isvoice %chan.vip) && ($nick !isop %chan.vip) && (!$read(vipusers.txt,s,$address($2,1))) {
          set %vipsv $2
        }
      }
      inc %i
    }
    if (%vipso == $2) { inc %counter | mode %chan.vip +o $2 | msg %chan.vip 7,1«0,1 VIP detected 7::0,1 7N0,1ick: $2 7::0,1 7H0,1ost: $address($2,2) 7:: I0,1D: %counter 7::0,1 7G0,1ets: (+v)7,1 » }
    elseif (%vipsv == $2) { inc %counter | mode %chan.vip +v $2 |  msg %chan.vip 7,1«0,1 VIP detected 7::0,1 7N0,1ick: $2 7::0,1 7H0,1ost: $address($2,2) 7:: I0,1D: %counter 7::0,1 7G0,1ets: (+v)7,1 »
    }
  }
}
alias Readme-VIP {
  dialog -m VIP VIP
}
dialog VIP {
  icon xelent.ico
  title "© xelent - #xelent (all rights reserved)"
  size -1 0 278 265
  option dbu

  text "Readme", 1, 0 2 278 10, style (center)
  box "Read", 2, 2 10 274 253
  text "© xelent ", 3, 4 255 253 10
  text "Beskrivelse:", 4, 4 20 270 12
  text "The V.I.P bot can add channels or user as vip.", 5, 4 26 270 24

  text "Commands:", 6, 4 50 270 6

  text "$addvipmaster <nick> - Adds a admin who can adds channels/users as VIP", 7, 33 57 245 14
  text "$delvipmaster <nick> - Deletes a users admin rights", 8, 33 72 245 6
  text "$vipmasterlist - Shows all VIP admins in bot", 9, 33 81 245 6

  text "$addvipchannel <#channel> <@/+> - Adds a VIP channel)", 10, 33 95 245 14
  text "$delvipchannel <#channel> <@/+> - Deletes a VIP channel", 11, 33 104 245 6
  text "$vipchannellist - Shows all VIP channels", 12, 33 113 245 6

  text "$addvip <nick> <@/+> - Adds a users as VIP", 13, 33 130 245 14
  text "$delvip <nick> <@/+> - Deletes a users VIP status", 14, 33 139 245 6
  text "$viplist - Shows all users in VIP list", 15, 33 148 245 6

  text "Example:   $addvip xelent @                           - This will give xelent +o when she/he joins", 16, 4 160 270 24
  text "$addvip xelent +                            - This will give xelent +v when she/he joins", 17, 35 170 270 24
  text "$addvipchannel #xelent @          - This will give all users on #xelent +o on the VIP channel", 18, 35 180 270 24
  text "$viplist                                                    - Shows all vips", 19, 35 190 270 24

  text "Name on the first VIPadmin also know as bot onwer:", 22, 6 202 170 14
  edit "", 20, 180 205 90 10
  text "Channel name of VIP channel (main channel):", 23, 6 221 170 10
  edit %chan.vip, 21, 180 220 90 10
  Button "Gem og Luk", 24, 90 237 90 10, style (ok)
}
on *:dialog:VIP:sclick:*: {
  if ($did == 24) {
    if ($did(20)) { whois $did(20) | set %var addvipmaster 0 $did(20) }
    if ($did(21)) { set %chan.vip $did(21) }
  }
}

Comments

Sign in to comment.
Lenooox   -  Dec 15, 2011

tell me if this script work :) wont work for me
im vipmaster but nothing reaction when i connected to vip my channel ,and i cant add a new user to vip list $addvip Lenoox +
Could not find Nico

 Respond  
xelent   -  Oct 01, 2008

Comment's deleted, new script ( kinda big update ).

 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.