All pastes #103524 Raw Edit

HamLIST Script

public text v1 · immutable
#103524 ·published 2006-07-28 10:41 UTC
rendered paste body
dialog hamLIST {
  title "HamLIST Blacklist Script"
  size -1 -1 294 215
  option dbu
  list 1, 20 32 238 90, size
  box "Hostmasks:", 2, 11 17 259 124
  button "Remove", 3, 98 124 37 12
  button "Update", 4, 60 124 37 12
  edit "", 5, 20 152 238 10
  button "Add", 6, 22 124 37 12
  box "Add Hostmask:", 7, 11 143 260 24
  text "HamLIST Blacklist Script", 8, 15 4 121 12
  button "OK", 9, 43 179 37 12, ok
  button "Cancel", 10, 81 179 37 12, cancel
}

on *:DIALOG:HamLIST:sclick:6:{
  set %hlist.hmask $did(HamLIST,5).text
  writeini HamLIST.ini HamLIST %hlist.hmask on
  did -a HamLIST 1 %hlist.hmask
}

on *:DIALOG:HamLIST:sclick:3:{
  set %hlist.remove $did(HamLIST,1,1).sel
  remini HamLIST.ini HamLIST $did(HamLIST,1,1).seltext
  did -d HamLIST 1 %hlist.remove
}

on *:DIALOG:HamLIST:sclick:4:{
  set %hlist.update $did(HamLIST,5).text
  remini HamLIST.ini HamLIST $did(HamLIST,1,1).seltext
  writeini HamLIST.ini HamLIST %hlist.update on
  did -o $did(HamLIST,1,1).sel %hlist.update
}

alias hamlist {
  dialog -ma hamlist hamlist
}

on *:join:#:{
  if ($readini(HamLIST.ini,HamLIST,$address($nick,1)) == on ) {
    inc %kicks 1
    ban -k $chan $nick 2  You have been HamLISTED) ( $+ %kicks dudes kicked
  }
}
on *:join:#:{
  if ($readini(HamLIST.ini,HamLIST,$address($nick,2)) == on ) {
    inc %kicks 1
    ban -k $chan $nick 2  You have been HamLISTED) ( $+ %kicks dudes kicked
  }
}
on *:join:#:{
  if ($readini(HamLIST.ini,HamLIST,$address($nick,3)) == on ) {
    inc %kicks 1
    ban -k $chan $nick 2  You have been HamLISTED) ( $+ %kicks dudes kicked
  }
}

menu channel {
  HamLIST:/HamLIST
}
menu status {
  HamLIST:/HamLIST
}
menu query {
  HamLIST:/HamLIST
}

menu nicklist {
  HamLIST
  .Add Address
  .. $+ $address($$1,1) $+ :/hamlist | /set %hlist.hmask $address($$1,1) | /did -a HamLIST 5 %hlist.hmask
  .. $+ $address($$1,2) $+ :/hamlist | /set %hlist.hmask $address($$1,2) | /did -a HamLIST 5 %hlist.hmask
  .. $+ $address($$1,3) $+ :/hamlist | /set %hlist.hmask $address($$1,3) | /did -a HamLIST 5 %hlist.hmask
}

on *:DIALOG:hamLIST:init:0:{
  var %a 1
  while (%a <= $lines(hamLIST.ini)) {
    if (*=* iswm $read(hamLIST.ini,%a)) {
      did -a hamLIST 1 $gettok($v2,1,61)
    }
    inc %a 1
  }
}