All pastes #577158 Raw Edit

Something

public text v1 · immutable
·published 2007-06-19 20:04 UTC
rendered paste body
on *:load:{
  set %presistemstatus Desligado
  set %presistembot NEW
  set %presistementrada RevolutionIRC
  set %presistemsaida PTnet
  set %presistemsaidacanal #d&r
  set %presistementradacanal #revo-pre
  echo -a Aqui tens mais um trabalhito :P Um obrigado por me fazeres um user activo. É graças a ti que sou o helper mais activo da minha equipa :P
}

on *:text:*:#:{
  if ($chan = %presistementradacanal) {
    if (($nick == %presistembot) && ($network == %presistementrada)) {
      if (*[-PRE-]* iswm $1-) {
        var %t 1 , %z $scid(0)
        while (%t <= %z) {
          if ($scid(%t).network = %presistemsaida) {
            set %clean $strip($1-,burc)
            set %pre_ $mid(%clean,10,999)
            set %pre $replace(%pre_,$chr(93),$chr(32))
            var %calc $calc($len($gettok(%pre,2-,32)) - 3)
            var %another $mid($gettok(%pre,2-,32),3,999)
            var %another_ $len(%another)
            var %another__ $calc(%another_ - 1)
            set %cor $gettok(%pre,1,32)
            if (%presistemstatus = ligado) { scid %t msg %presistemsaidacanal ..:: 0PRE ::.. »07 $cor « ..::0 $left(%another,%another__) ::.. }
            write DB.txt PRE $strip($cor $left(%another,%another__)) $date $time
            write -l1 DataBase.txt PRE $calc($gettok($read(DataBase.txt,1),2,32) + 1)

            set %ahhetalques $replace($strip($left(%another,%another__)),-,$chr(32))
            set %groupdoahetal $gettok(%ahhetalques,$numtok(%ahhetalques,32),32)
            set %grouprelease $calc($readini(groups.ini,%groupdoahetal,release) + 1)

            if (!$readini(groups.ini,%groupdoahetal,first)) { writeini groups.ini %groupdoahetal first PRE $strip($cor $left(%another,%another__)) $date $time }
            writeini groups.ini %groupdoahetal last PRE $strip($cor $left(%another,%another__)) $date $time
            writeini groups.ini %groupdoahetal release %grouprelease

            inc %pres.count
            halt
          }
          inc %t
        }

      }
      if (*[-NUKE-]* iswm $1-) { 
        var %t 1 , %z $scid(0)
        while (%t <= %z) {
          if ($scid(%t).network = %presistemsaida) {
            set %clean $strip($1-,burc)
            set %pre_ $mid(%clean,10,999)
            set %pre $replace(%pre_,$chr(93),$chr(32))
            var %calc $calc($len($gettok(%pre,2-,32)) - 3)
            var %nuke )-(
            set %msg $mid($replace($gettok(%pre,1,32),%nuke,$chr(32)),2,999)
            set %another $calc($len($gettok(%msg,2,32)) - 1)

            if (%presistemstatus = ligado) { scid %t msg %presistemsaidacanal ..:: 04NUKE ::.. »00 $gettok(%msg,1,32) « ..::04 $left($gettok(%msg,2,32),%another) ::.. }
            nukedate
            write DB.txt NUKE $strip($gettok(%msg,1,32) $left($gettok(%msg,2,32),%another)) %date
            var %gettoknuke $gettok($read(DataBase.txt,2),2,32)
            write -l2 DataBase.txt NUKE $calc(%gettoknuke + 1)

            set %ahhetalques $replace($strip($gettok(%msg,1,32)),-,$chr(32))
            set %groupdoahetal $gettok(%ahhetalques,$numtok(%ahhetalques,32),32)
            set %groupnuke $calc($readini(groups.ini,%groupdoahetal,nuke) + 1)

            if (!$readini(groups.ini,%groupdoahetal,first)) { writeini groups.ini %groupdoahetal first PRE $strip($cor $left(%another,%another__)) $date $time }
            writeini groups.ini %groupdoahetal last PRE $strip($cor $left(%another,%another__)) $date $time
            writeini groups.ini %groupdoahetal nuke %groupnuke

            inc %nuke.count
            halt
          }
          inc %t
        }
      }
      if (*[-UNNUKE-]* iswm $1-) { 
        var %t 1 , %z $scid(0)
        while (%t <= %z) {
          if ($scid(%t).network = %presistemsaida) {
            set %clean $strip($1-,burc)
            set %pre_ $mid(%clean,10,999)
            set %pre $replace(%pre_,$chr(93),$chr(32))
            var %calc $calc($len($gettok(%pre,2-,32)) - 3)
            var %nuke )-(
            set %msg $mid($replace($gettok(%pre,1,32),%nuke,$chr(32)),3,999)
            set %another $calc($len($gettok(%msg,2,32)) - 1)

            if (%presistemstatus = ligado) { scid %t msg %presistemsaidacanal ..:: 09UNNUKE ::.. »00 $gettok(%msg,1,32) « ..::09 $left($gettok(%msg,2,32),%another) ::.. }
            nukedate
            write DB.txt UNNUKE $Strip($gettok(%msg,1,32) $left($gettok(%msg,2,32),%another)) %date
            var %gettokunnuke $gettok($read(DataBase.txt,3),2,32)
            write -l3 DataBase.txt UNNUKE $calc(%gettokunnuke + 1) 

            set %ahhetalques $replace($strip($gettok(%msg,1,32)),-,$chr(32))
            set %groupdoahetal $gettok(%ahhetalques,$numtok(%ahhetalques,32),32)

            set %groupunnuke $calc($readini(groups.ini,%groupdoahetal,unnuke) + 1)

            if (!$readini(groups.ini,%groupdoahetal,first)) { writeini groups.ini %groupdoahetal first PRE $strip($cor $left(%another,%another__)) $date $time }
            writeini groups.ini %groupdoahetal last PRE $strip($cor $left(%another,%another__)) $date $time

            writeini groups.ini %groupdoahetal unnuke %groupunnuke

            inc %unnuke.count
            halt 
          }
          inc %t
        }
      }
    }
  }
}

alias nukedate {
  var %line $line(DB.txt)
  var %linhacontador 1
  while (%linhacontador <= %line) {
    if (pre* iswm $read(DB.txt,%linhacontador)) && (* $+ $gettok(%msg,1,32) $+ * iswm $read(DB.txt,%linhacontador)) {
      var %date $gettok($read(DB.txt,%linhacontador),4) $gettok($read(DB.txt,%linhacontador),5)
    }
  }
}

alias cor {
  if (%cor = XXX) {
    return 04 $+ %cor 
  }
  if (%cor = MP3) {
    return 03 $+ %cor 
  }
  if (%cor = SVCD) {
    return 06 $+ %cor 
  }
  if (%cor = 0-Day) {
    return 09 $+ %cor 
  }
  if (%cor = TV-Rips) {
    return 06 $+ %cor 
  }
  if (%cor = DVD-R) {
    return 03 $+ %cor 
  }
  if (%cor = XviD) {
    return 11 $+ %cor 
  }
  if (%cor = MviD) {
    return 11 $+ %cor 
  }
  if (%cor = Games) {
    return 04 $+ %cor 
  }
  if (%cor = Apps) {
    return 07 $+ %cor 
  }
  if (%cor = Covers) {
    return 07 $+ %cor 
  }
  if (%cor = AudioBook) {
    return 07 $+ %cor 
  }
  if (%cor = EBook) {
    return 12 $+ %cor 
  }
  if (%cor = VCD) {
    return 06 $+ %cor 
  }
  if (%cor = MDVD-R) {
    return 06 $+ %cor 
  }
  if (%cor = Dox) {
    return 13 $+ %cor 
  }
  if (%cor = Anime) {
    return 13 $+ %cor 
  }
  if (%cor = PSP) {
    return 15 $+ %cor 
  }
  if (%cor = PS2) {
    return 15 $+ %cor 
  }
  if (%cor = XBOX) {
    return 15 $+ %cor 
  }
  if (%cor = Unknown) {
    return 09 $+ %cor 
  }
  else {
    return 00 $+ %cor
  }
}

menu channel,menubar {
  -
  Sistema Pre
  .Estado $+ $chr(58) $chr(9) %presistemstatus :halt
  .-
  .$iif(%presistemstatus = Ligado,$style(2) Ligar,Ligar):set %presistemstatus Ligado
  .$iif(%presistemstatus = Desligado,$style(2) Desligar,Desligar):set %presistemstatus Desligado
  .-
  .Definir
  ..Nick do bot $+ $chr(58) $chr(9) %presistembot :halt
  ..Definir: set %presistembot $$?="Digita o nome para o BOT"
  ..-
  ..Rede/Canal de entrada de info $+ $chr(58) $chr(9) %presistementrada $+ / $+ %presistementradacanal :halt
  ..Definir: set %presistementrada $$?="Digita a REDE de entrada da Informação" | set %presistementradacanal #$$?="Digita o CANAL de entrada da Informação"
  ..-
  ..Rede/Canal de saida de info $+ $chr(58) $chr(9) %presistemsaida $+ / $+ %presistemsaidacanal :halt
  ..Definir: set %presistemsaida $$?="Digita a REDE de saida da Informação" | set %presistemsaidacanal #$$?="Digita o CANAL de saida da Informação"
}