Avatar billede xream Nybegynder
25. oktober 2003 - 17:57 Der er 4 kommentarer og
1 løsning

Hvordan laver man et script

Jeg har fået sat en normal mirc bot op, og så vil jeg have at hvis folk reklamer for deres channel skal botten først kick personen, men næste gang han gør det skal den ban ham i 120 min eller sådan noget..
Avatar billede zyberdog Nybegynder
26. oktober 2003 - 08:34 #1
;The '@' in the on text event will make sure only to react to the advert if you are op on the channel.
;Remember to type your own channel in the event instead of '#Your_Channel'.

on @*:TEXT:*:#Your_Channel:{
  ;In most cases you dont want a script like this to effect other ops.
  ;Here we make sure that the user is not an op on your channel before even thinking about punishing him.
  ;If it should count for everyone in the channel remove the line and a '}' from the end.
  if ($nick !isop $chan) {
    ;We check if theres is the main advert letter '#' in the users message.
    if ($chr(35) isin $strip($1-)) {
      ;Then we make sure that the advertisement is not your own channel.
      var %a 1,%ads = 0
      while ($matchtok($strip($1-),$chr(35),%a,32)) {
        if ($ifmatch != $chan) {
          ;Foreach of the channels in the message which is not your channel we increase a variable to keep track of advertisements.
          inc %ads 1
        }
        inc %a
      }
      ;Only if there actually was some hostile advertisements in the message we should go on.
      if (%ads > 0) {
        ;We keep track of the advertisements the nick has done so that we can warn/kick/ban customly.
        inc %ads. $+ $nick 1
        ;if this is the users first advertisement we only warn him.
        if (%ads. [ $+ [ $nick ] ] == 1) {
          .notice $nick The system registrered an advert in your message. That is not allowed in $chan $+ . Consider this a warning.
        }
        ;next time the users does it we get more agressive...
        if (%ads. [ $+ [ $nick ] ] == 2) {
          kick $chan $nick You where told not to advertise, but you did it again.
        }
        ;Now, if the users keeps advertising... he will be banned.
        if (%ads. [ $+ [ $nick ] ] == 3) {
          ;we choose to ban for 10 minuts or 600 seconds.. thats the -u600
          ;the last number is the address identfier.. we choose 3 to ban him regardless of dynamic ip. Syntax: *!*user@*.host
          ban -u600 $chan $nick 3
          kick $chan $nick You where warned twice until the point of no return. (10min. ban!)
          ;we start his 'personal statistics' all over...
          unset %ads. [ $+ [ $nick ] ]
        }
      }
    }
  }
}
Avatar billede zyberdog Nybegynder
26. oktober 2003 - 08:35 #2
Med kommentarer osv.. udfra det burde du godt kunne lave det.
Avatar billede xream Nybegynder
26. oktober 2003 - 16:28 #3
tak skal du have. vil se om jeg kan finde ud af det.
Avatar billede xream Nybegynder
26. oktober 2003 - 18:35 #4
er ret dårlig til det men hvor skal jeg sætte det ind henne det du har skrevet til mig jeg mener det er i remote.. men er ikke sikker
Avatar billede zeppelin1 Nybegynder
14. januar 2004 - 23:07 #5
Ja remote
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester



IT-JOB

Udviklings- og Forenklingsstyrelsen

Erfaren teamleder til årsopgørelsen

Euronext Securities

Software Developer

Nitor Energy A/S

IT Infrastructure Specialist

Udviklings- og Forenklingsstyrelsen

Controller til økonomi og compliance