+B users list dialog

By PuNkTuReD on Sep 16, 2010

Ok this one was requested by Cheiron on the forums.
It's a dialog which will list all +B users on the server.

It also has a command (!bots) which can be used in a "staff" channel to list the bots to the channel.

From within the dialog you can, kill, shun or gline a user from your server.

There is also a button to message the assigned channel the bot list.

To set your channel, see the in-script config area.

Image

;====================================
; ===================================
;
; +B Users Dialog Kill/Shun/G:Line
; Made By PuNkTuReD
; http://www.sassirc.com
;
; ===================================
;====================================

;====================================
; ===================================
; CONFIG
;

; This is where you set the channel which !bots may be used in for staff purposes.
alias botdatachan return #SassIRC-Staff

;
; END CONFIG
; ===================================
;====================================

on *:text:!bots:$($botdatachan): { 
  if (%botdatawait) { return }
  else {
    set -u10 %botdatawait 10
    botdata $chan 
  }
}

alias botautokillreason return Auto-reason For Server /kill
alias botautoshunreason return Auto-reason For Server /shun
alias botautoglinereason return Auto-reason For Server /gline
alias botdatadialog { dialog $iif($dialog(botdata),-v,-dm) botdata botdata }
alias botdata { 
  set -u5 %botdata $true
  if ($1) { set -u5 %botdatachan $1 | who +m B }
  else { did -r botdata 2 | who +m B }
}
alias botdataaction {
  tonenize 32 $1-
 $iif($istok(sajoin sapart kill,$2,32),$2 $1 $3-,$2 $3 $1 $4-)
}

menu channel,nicklist,status {
  List +B Users : botdatadialog
}

dialog botdata {
  title +B Users on $network
  size -1 -1 200 270
  option dbu
  box "", 1, 5 5 190 105
  list 2, 10 15 180 90, hsbar, vsbar
  box "Actions", 3, 5 110 190 30
  button "SAJoin", 4, 10 120 30 10
  button "SAPart", 5, 45 120 30 10
  button "Kill", 6, 80 120 30 10
  button "Shun", 7, 115 120 30 10
  button "G:Line", 8, 150 120 30 10
  box "Reason", 9, 5 140 190 30
  edit "", 10, 10 150 180 10, autohs
  box "Channel", 11, 5 170 190 30
  edit "", 12, 10 180 180 10, autohs
  box "Period", 15, 5 200 190 30
  radio "10m", 16, 10 210 30 10
  radio "15m", 17, 40 210 30 10
  radio "30m", 18, 70 210 30 10
  radio "1h", 19, 100 210 30 10
  radio "24h", 20, 130 210 30 10
  radio "Perm", 21, 160 210 30 10
  box "Extra Options", 22, 5 230 190 30
  button "Refresh List", 23, 10 240 90 10
  button "Show List In Channel", 24, 100 240 90 10
}

on *:dialog:botdata:*:*: {
  var %a = $dname, %b = $devent, %c = $did
  if (%b == init) { botdata }
  elseif (%b == sclick) {
    if ($istok(4 5 6 7 8,%c,32)) {
      if ($did(botdata,2).seltext) { 
        if ($did(botdata,16).state == 1) { var %period = $did(botdata,16) }
        elseif ($did(botdata,17).state == 1) { var %period = $did(botdata,17) }
        elseif ($did(botdata,18).state == 1) { var %period = $did(botdata,18) }
        elseif ($did(botdata,19).state == 1) { var %period = $did(botdata,19) }
        elseif ($did(botdata,20).state == 1) { var %period = $did(botdata,20) }
        elseif ($did(botdata,21).state == 1) { var %period = 0 }
        var %botdatachan = $iif($did(botdata,12),$iif($left($did(botdata,12),1) == $chr(35),$did(botdata,12),$+($chr(35),$did(botdata,12))),$botdatachan)
        if (%c == 4) { botdataaction $did(botdata,2).seltext sajoin %botdatachan | botdata }
        elseif (%c == 5) { botdataaction $did(botdata,2).seltext sapart %botdatachan | botdata }
        elseif (%c == 6) { botdataaction $did(botdata,2).seltext kill $iif($did(botdata,10),$did(botdata,10),$botautokillreason) | botdata }
        elseif (%c == 7) { botdataaction $did(botdata,2).seltext shun %period $iif($did(botdata,10),$did(botdata,10),$botautoshunreason) | botdata }
        elseif (%c == 8) { botdataaction $did(botdata,2).seltext gline %period $iif($did(botdata,10),$did(botdata,10),$botautoglinereason) | botdata }
      }
      else { echo -a ***** Please Select a nick to take an action against. }
    }
    elseif ($istok(23 24,%c,32)) { botdata $iif(%c == 24,$botdatachan) }
  }
}

raw *:*: {
  if (%botdata) {
    if ($numeric == 352) { 
      tokenize 32 $1-
      if (%botdatachan) {
        set -u5 %botdatabots $addtok(%botdatabots,$6,44) 
        if ($numtok(%botdatabots,44) == 10) { msg %botdatachan %botdatabots | unset %botdatabots }
      }
      else { did -a botdata 2 $6 | did -z botdata 2 }
    }
    elseif (End of /WHO list. isin $1-) && (%botdatachan) { msg %botdatachan %botdatabots | unset %botdatabots }
    haltdef
  }
}

Comments

Sign in to comment.
[Plornt]   -  Sep 19, 2010

Very nice snippit I will definatly be using this, thanks!

 Respond  
Cheiron   -  Sep 17, 2010

I like the upgrade there to include the sajoin/part. plus the neater approach with the buttons than before,
Sweet job mate :)

 Respond  
GrimReaper   -  Sep 16, 2010

Very nicely done on the dialog, Also the bot trigger work's really well.. Get's a like from me also and a 10.

Keep up the good work PuNkTuReD

 Respond  
Cheiron   -  Sep 16, 2010

thoroughly tested on all sides with no issues found. very easy to use and set up.
nice job. gets 10 and a like.

 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.