;IRcap8 2f57e0f251f5d5f60c7772875a61ba60

; DALnet bot control 3.0

alias dalnet.nombrecbots return $gettok($netcon(3),1,64)  $gettok($netcon(4),1,64)  $gettok($netcon(5),1,64)

alias dalnet.CBOTCOM-1 {
  %cbots.p = mns | if $1 == n { %cbots.kesaco = 1 } | var %s = %cbots.kesaco

  var %i = 1 | x grupo %i $iif(%i isin %s,1,2) $s(129)
  if %i isin %s {
    x infoinfo &n
    x accacc &n
  }
  var %i = 3 | x grupo %i $iif(%i isin %s,1,2) $s(130)
  if %i isin %s {
    x identify* identify ?pas
    x register $me $+ * register ?ppas ?mail <npass>
    x access listaccess list
    x access addaccess add ?mask
    x access delaccess del ?mask
    x access wipeaccess wipe
    x ghost* ghost &n ?ppas
    x recover* recover &n ?ppas
    x release* release &n ?ppas
    x sendpasssendpass &n ?mail
    x passwd* set PASSWD ?pas ?ppas <npass>
    x dropdrop $me <conf>
  }
  var %i = 5 | x grupo %i $iif(%i isin %s,1,2) $s(131)
  if %i isin %s {
    x enforceset enforce onoff
    x noopset noop onoff
    x nomemoset nomemo onoff
    x email* set email ?pas ?mail
    x showemailset showemail onoff
    x mailblockset mailblock onoff
    x urlset url ?txt
  }
}

alias dalnet.CBOTCOM-2 {
  %cbots.p = mcs | if $1 == n { %cbots.kesaco = 1 } | var %s = %cbots.kesaco

  var %i = 1 | x grupo %i $iif(%i isin %s,1,2) $s(121)
  if %i isin %s {
    x identify* identify &c ?cpas
    x infoinfo &c
    x accessaccess &c &n
    x whywhy &c &n
    x opop &c &n
    x deopdeop &c &n
    x mdeopmdeop &c <conf>
    x mkickmkick &c <conf>
    x unbanunban &c
    x unban *unban &c *
    x countcount &c
    x inviteinvite &c
  }

  var %i = 2 | x grupo %i $iif(%i isin %s,1,2) $s(131)
  if %i isin %s {
    x register* register &c ?cppas ?txt <cpass>
    x sendauthsendauth &c S
    x sendpasssendpass &c ?mail
    x successorset &c successor &n <conf>
    x successor delsuccessor &c DEL <conf>
    x descset &c desc ?txt
    x urlset &c url ?txt
    x founderset &c founder <conf>
    x identset &c ident onoff
    x keeptopicset &c keeptopic onoff
    x leaveopsset &c leaveops onoff
    x mailblockset &c mailblock onoff
    x memoset &c memo noneaopsopfounder
    x mlockset &c mlock ?txt
    x opguardset &c opguard onoff
    x privateset &c private onoff
    x restrictset &c restrict onoff
    x topiclockset &c topiclock sopfounderoff
    x unsecureset &c unsecure onoff
    x verboseset &c verbose onoff
    x webpasswd* set &c webpasswd ?cppas
    x passwd* set &c PASSWD ?cpas ?cppas <cpass>
    x dropdrop &c <conf>
  }
  var %i = 3 | x grupo %i $iif(%i isin %s,1,2) AOP
  if %i isin %s {
    x aop +aop &c add ?mask
    x aop -aop &c del ?mask
    x aop listaop &c list
    x aop wipeaop &c wipe <conf>
  }
  var %i = 4 | x grupo %i $iif(%i isin %s,1,2) SOP
  if %i isin %s {
    x sop +sop &c add ?mask
    x sop -sop &c del ?mask
    x sop listsop &c list
    x sop wipesop &c wipe <conf>
  }
  var %i = 5 | x grupo %i $iif(%i isin %s,1,2) Akick
  if %i isin %s {
    x akick +akick &c add ?mask
    x akick -akick &c del ?num
    x akick listakick &c list
  }
}
alias dalnet.CBOTCOM-3 {
  %cbots.p = mms | if $1 == n { %cbots.kesaco = 13 } | var %s = %cbots.kesaco

  var %i = 1 | x grupo %i $iif(%i isin %s,1,2) $s(121)
  if %i isin %s {
    x readread ?num
    x list *list *
    x listlist
    x send?run loadu g-memosend &n
    x sendsopsendsop &c ?txt
    x newsnews
    x deldel ?num
    x purgepurge
    x undelundel ?num
    x forward* forward &n ?cpas
  }
}

alias -l X {
  if $1 == grupo { $larbol(@cbots1,$2 $+ g $+ $4- $+    $+ $3).ana | %tmp.sg = $2 | return }
  aline @cbots1 %tmp.sg $+ i $+ $1- $+  3
}
alias -l S return $hget(tool,$1)



menu menubar,@barra {
  -
  $iif(dalnet.inb isin %netcon. [ $+ [ $cid ] ],$netcon(2))
  .$m(401) $me: if ($dapass(nick. $+ $nnet,$me)) mns * identify $ifmatch | else mns * identify $$?*=" $mg(ppass) "
  .$m(402) $me: var %d = $$?=" $mg(ppassdal) " | mns * register %d | mns set enforce on | adpass nick. $+ $nnet $me $gettok(%d,1,32)
  .-
  .info nick: mns info $$?=" $mg(nick) "
  .info $me: mns info $me
  .-
  .memo - list: mms list
  .memo - read:mms read $$?=" $mg(num) "
  .memo - send: loadu g-memosend
  .-
  .info chan: mcs info #$$?=" $mg(canal) "
  .unban: mcs unban #$$?=" $mg(canal) " me
  $iif(dalnet.inb isin %netcon. [ $+ [ $cid ] ],$m(400)): cbots 1 - -
}

menu Nicklist {
  $iif(dalnet.inb isin %netcon. [ $+ [ $cid ] ],$netcon(2))
  .op / deop: if $1 isop # { mcs deop # $$1 } | else { mcs op # $$1 }
  .-
  .info: mns info $1
  .access: mcs access # $1
  .memo: loadu g-memosend $1
  .-
  .aop
  ..$m(221): mcs aop # list
  ..+: mcs aop # add $1
  ..-: mcs aop # list | mcs aop # del $$?=" $mg(num) "
  .sop
  ..$m(221): mcs sop # list
  ..+: mcs sop # add $1
  ..-: mcs sop # list | mcs sop # del $$?=" $mg(num) "
  .akick
  ..$m(221): mcs akick # list
  ..+: mcs akick # add $$1
  ..-: mcs akick # list | mcs akick # del $$1
  .-
  .$m(400): cbots 2 # $1
}

menu channel {
  $iif(dalnet.inb isin %netcon. [ $+ [ $cid ] ],$netcon(2))
  .info: mcs info #
  .founder
  ..identify: if ($dapass(canal. $+ $nnet,#)) mcs * identify # $ifmatch | else mcs * identify # $$?*=" $mg(ppass) "
  ..register: mcs * register # $$?*=" $mg(ppass) " $$?=" $mg(descrip) "
  .mlock: mcs set # mlock $$?=" $mg(pmodo) ( -+smtinlpk )"
  .unban: mcs # unban
  .-
  .$m(400): cbots 2 # -
}

menu query {
  $iif(dalnet.inb isin %netcon. [ $+ [ $cid ] ],$netcon(2))
  .info: mns info $$1
  .memo: loadu g-memosend $1
  .-
  .$m(400): cbots 1 - $1
}

#autolmemo on
on +69:NOTICE:*Password accepted*:*: if ($netcon(1) == dalnet.inb) mms list
#autolmemo end
on ^+69:NOTICE:*:*: if ($nick == memoserv) && ($netcon(1) == dalnet.inb) { write $logdir $+ \memos.mem $1- }

alias dalnet.inb.protchan {
  goto $1
  :DEOP | mcs deop $chan $nick | mcs op $chan $me | return
  :KICK | mcs deop $chan $nick | mcs unban $chan | .timerREJOIN 1 3 join $chan | return
  :BAN | mcs deop $chan $nick | mcs unban $chan
}

[BOTCOM]
identify=mns * IDENTIFY <pass>
ghost=mns * GHOST <me> <pass>

menu status {
  $iif(dalnet.inb isin %netcon. [ $+ [ $cid ] ],$m(194))
  .-
  .$m(403)
  .-
  .$iif(k isincs $usermode,$style(1)) +k ( kill messages ): if (k isincs $usermode) { mode $me -k } | else { mode $me +k }
  .$iif(R isincs $usermode,$style(1)) +R ( only reg. queries ): if (R isincs $usermode) { mode $me -R } | else { mode $me +R }
}

menu channel {
  $iif(dalnet.inb isin %netcon. [ $+ [ $cid ] ],$m(226))
  .$m(227)
  ..-
  ..$m(403)
  ..-
  ..$iif(c isincs $chan(#).mode,$style(1)) +c ( strip colors ): if (c isincs $chan(#).mode) { mode # -c } | else { mode # +c }
  ..$iif(R isincs $chan(#).mode,$style(1)) +R ( only join regs. ): if (R isincs $chan(#).mode) { mode # -R } | else { mode # +R }
}
;EOF