Remotes de mon bot [auth/op/kick/welcome/texte]

Contenu du snippet

Voici quelques remotes de mon bot. Il dit bonjour en arrivant sur le chan, donne une liste de commandes !cmd. Permet de rajouter des news ou pub dans un txt et de lancer un timer séparer pour les afficher sur le chan

N'oubliez pas de changer les "tonchan" par votre channel
Pour l'auth il suffit de recrer un user dans votre userlist avec le level 400 pour pouvoir en rajouter manuellement avec les commandes !addop !addvoice !addmaster

example:
400:Votrenick!*ident@users.quakenet.org(/guser 400 Votrenick!*ident@users.quakenet.org)

Source / Exemple :


ON *:CONNECT:{
  if (%my-chan == $null) { /set %my-chan #$$?="Enter the name of channel where the bot must work" }
  if (%my-web == $null) { /set %my-web $$?="Enter the url of your website" }
  if (%password == $null) { /set %password $$?="Enter the password to auth" }
  if (%affluence.courant == $null) { /set %affluence.courant 0 }
  if (%record.affluence == $null) { /set %record.affluence 0 }
  if (%record.affluence.date == $null) { /set %record.affluence.date April 01  }
  if (%record.affluence.nick == $null) { /set %record.affluence.nick default }
  if (%record.affluence.time == $null) { /set %record.affluence.time 00:00 }
  if (%record.kick == $null) { /set %record.kick 0 }
  if (%record.ban == $null) { /set %record.ban 0 }
  if (%record.unban == $null) { /set %record.unban 0 }
  if (%record.op == $null) { /set %record.op 0 }
  if (%record.deop == $null) { /set %record.deop 0 }
  if (record.op == $null) { /set %record.op 0 }
  if (record.voice == $null) { /set record.voice 0 }
  if (%record.devoice == $null) { /set %record.devoice 0 }
  if (%db.news == $null) { /set db.news 0 }
  if (%db.pub == $null) { /set db.pub 0 }
}
ON *:JOIN:%my-chan:{
  if ($ulevel >= 1) {
    /notice $nick #Origine-Online 0,1 .::7,1 [BoT]0,1 Type !Cmd for the list of commands ::.
    /set %affluence.courant $nick($chan, 0)
    if (%affluence.courant > %record.affluence) {
      /set %record.affluence.nick $nick
      /set %record.affluence %afflu.courant
      /set %record.affluence.date $date(mmmm dd)
      /set %record.affluence.time $asctime(HH:nn)
      /msg $chan 0,1 .::7,1[ANNOUNCEMENT] 0,1: %ori-chan broke a new record attendance with %record.affluence connected ::.
      /msg $chan 0,1 .::7,1[ANNOUNCEMENT] 0,1: The record was established on %record.affluence.date at %record.affluence.time minutes, by %record.affluence.nick ::.
    }
  }
  if ($ulevel = 100) {
    if (users.quakenet.org isin $address) { halt }
    elseif ($nick !isvoice %my-chan) {
      /mode %my-chan +v $nick
      /inc %record.voice 1
      if (!$window(@MONITORING-YOU)) { window -k0nze @MONITORING-YOU }
      /echo @MONITORING-YOU $nick has been automatically VOICE at $asctime(HH:nn:ss)
    }
  }
  if ($ulevel >= 200) {
    if (users.quakenet.org isin $address) { halt }
    elseif ($nick !isop %my-chan) {
      /mode %my-chan +o $nick
      /inc %record.op 1
      if (!$window(@MONITORING-YOU)) { window -k0nze @MONITORING-YOU }
      /echo @MONITORING-YOU $nick has been automatically OP at $asctime(HH:nn:ss)
    }
  }
}
ON *:TEXT:*:?:{
  if ($1 == !auth) && ($2 != %password ) { 
    /notice $nick 0,1 .:: 7,1[INFORMATION]0,1 Wrong password ::.
    /closemsg
    /halt
  }
  elseif ($1 == !auth) && ($2 == %password ) {
    /notice $nick 0,1 .:: 7,1[INFORMATION]0,1 You've been auth with success $nick ::.
    /guser 400 $nick 3
    /closemsg
    /halt
  }
  else {
    /msg $nick 0,1 .::7,1 [BoT]0,1 Ohh yeeahhh I'm a bad guyz :) ::.
    /closemsg
  }
}
ON *:TEXT:*:%my-chan: {
  if ($ulevel >= 1) {
    if ($1 == !cmd) {
      /notice $nick 7,1 The following commands are available to you !
      /notice $nick 7,1 !CHUCK 0,1 ( show a random quote from www.chucknorrisisgod.com )
      /notice $nick 7,1 !FORUM 0,1 ( show url of our forum )
      /notice $nick 7,1 !NEWS 0,1 ( show a random news )
      /notice $nick 7,1 !RANDOM ( Funny :) )
      /notice $nick 7,1 !RECRUITMENT 0,1 ( show url for more information about recruitment )
      /notice $nick 7,1 !RECORD 0,1 ( show some record )
      /notice $nick 7,1 !SPONSORS 0,1 ( show url of our sponsors )
      /notice $nick 7,1 !WEB 0,1 ( show url of our website )
    }

    if ($1 == !chuck) { if (%chuck == 0) { sockopen chuck chucknorrisisgod.com 80 | %chuck = 1 } }
    if ($1 == !forum) { /msg $chan 0,1 .::7,1 [Forum]0,1 http://forum.origine-online.com/ ::. }
    if ($1 == !news) { /msg $chan $iif(($2 isnum 1- $+ $lines(news.txt)),$read(news.txt,$2),$read(news.txt)) }
    if ($1 == !random) { /set %random.nick $nick | /play -cr %my-chan funny.txt }
    if ($1 == !recruitment) { /msg $chan 0,1 .::7,1 [Recruitment]0,1 www.origine-online.com/rejoindre  ::. }
    if ($1 == !record) { /msg $chan 0,1 .::7,1 [Record]0,1 The record of affluence is %record.affluence established the %record.affluence.date at %record.affluence.time minutes, by %record.affluence.nick  ::. }
    if ($1 == !sponsors) { /msg $chan 0,1 .::7,1 [Sponsors]0,1 www.PexCreativ.com - www.Webadev.com ::. }
    if ($1 == !web) { /msg $chan 0,1 .::7,1 [Website]0,1 %my-web ::. }
  }
  if ($ulevel >= 100) {
    if ($me isop %my-chan) {
      if ($1 == !cmd) { /notice $nick 7,1 !VOICE 0,1 ( voice you on the channel ) }
      if ($1 == !voice) { /inc %record.voice 1 | /mode %my-chan +v $nick }
    }
  }
  if ($ulevel >= 200) {
    if ($me isop %my-chan) {
      if ($1 == !cmd) {
        /notice $nick 7,1 !DEVOICE 0,1 ( Devoices you or other users on the channel )
        /notice $nick 7,1 !OP 0,1 ( Ops you or other users on the channel )
        /notice $nick 7,1 !DEOP 0,1 ( Deops you or other users on the channel )
        /notice $nick 7,1 !KICK 0,1 ( Kick a user on the channel )
        /notice $nick 7,1 !BAN 0,1 ( Ban a user for 10 min )
        /notice $nick 7,1 !PERMBAN 0,1 ( Ban permanently a user )
        /notice $nick 7,1 !UNBAN 0,1 ( Remove a user from the banlist )
      }
      if ($1 == !op) { /inc %record.op 1 | /mode %my-chan +ooooo $2- }
      if ($1 == !deop) { /inc %record.deop 1 | /mode %my-chan -ooooo $2- }
      if ($1 == !voice) { /inc %record.voice 1 | /mode %my-chan +vvvvv $2- }
      if ($1 == !devoice) { inc %record.devoice 1 | /mode %my-chan -vvvvv $2- }
      if ($1 == !kick) { /inc %record.kick 1 | /kick %my-chan $2 }
      if ($1 == !ban) { /inc %record.ban 1 | /inc %record.kick 1 | /ban -u600 %my-chan $address($2-,4) | /kick %my-chan $2 0,1 .:: Banned 10 min ::. }
      if ($1 == !permban) { /inc %record.ban 1 | /inc %record.kick 1 | /ban %my-chan $address($2-,4) | /kick %my-chan $2 0,1 .:: Banned permanently ::. }
      if ($1 == !unban) { /inc %record.unban 1 | /ban -r %my-chan $nick } 
    }
    if ($ulevel >= 300) {
      if ($me isop %my-chan) {
        if ($1 == !cmd) {
          /notice $nick 7,1 !ADDNEWS 0,1 ( Adds a news to the list )
          /notice $nick 7,1 !ADDPUB 0,1 ( Adds a advertising to the list )
          /notice $nick 7,1 !DELNEWS 0,1 ( Removes a news from the list )
          /notice $nick 7,1 !DELPUB 0,1 ( Removes a advertising from the list )
          /notice $nick 7,1 !STARTNEWS 0,1
          /notice $nick 7,1 !STOPNEWS 0,1
          /notice $nick 7,1 !STARTPUB 0,1
          /notice $nick 7,1 !STOPPUB 0,1
          /notice $nick 7,1 !ADDVOICE 0,1
          /notice $nick 7,1 !ADDOP 0,1
        }
        if ($1 == !addnews) {
          if ($2 == $null) || ($3 == $null) { /notice $nick 0,1 .:: 7,1[INFORMATION]0,1 To add a news, type 7,1!ADDNEWS GAME 0,1followed by your message ::. | halt }
          else {
            /notice $nick 0,1 .:: 7,1[INFORMATION]0,1 A news has been added ::.
            /inc %db.news 1
            /write news.txt 0,1 .:: 7,1[NEWS][ $2 ]0,1 $3- (  $+ posted on $date(mmmm dd) $+ , $date(yyyy) ) ::.
            /write newslog.txt *** $+ $date(dd/mm/yy) at $asctime(HH:nn) : Added by $nick : $3-
            if (!$window(@MONITORING)) { window -k0nze @MONITORING }
            /echo @MONITORING $nick have added a news at $asctime(HH:nn:ss)
          }
        }
        if ($1 == !delnews) {
          if ($2 == $null) { /notice $nick 0,1 .:: 7,1[INFORMATION]0,1 To delete a news, type 7,1!DELNEWS0,1 [ligne] ::. | halt }
          else {
            /notice $nick 0,1 .:: 7,1[INFORMATION]0,1 A news has been deleted ::.
            /dec %db.news 1
            /write $+(-dl,$2.sel) news.txt
            /write newslog.txt *** $+ $date(dd/mm/yy) at $asctime(HH:nn) : News n° $2- deleted by $nick .
            if (!$window(@MONITORING)) { window -k0nze @MONITORING }
            /echo @MONITORING $nick have deleted a news at $asctime(HH:nn:ss)
          }
        }
        if ($1 == !addpub) {
          if ($2 == $null) { /notice $nick 0,1 .:: 7,1[INFORMATION]0,1 To add a advertising, type 7,1!ADDPUB0,1 followed by your message ::. | halt }
          else {
            /notice $nick 0,1 .:: 7,1[INFORMATION]0,1 A advertising has been added ::.
            /inc %db.pub 1
            /write pub.txt 0,1 .:: 7,1[ADVERTISING]0,1 $2- (  $+ posted on $date(mmmm dd) $+ , $date(yyyy) ) ::.
            /write publog.txt *** $+ $date(dd/mm/yy) at $asctime(HH:nn) : Added by $nick : $2-
            if (!$window(@MONITORING)) { window -k0nze @MONITORING }
            /echo @MONITORING $nick have added a advertising at $asctime(HH:nn:ss)
          }
        }
        if ($1 == !delpub) {
          if ($2 == $null) { /notice $nick 0,1 .:: 7,1[INFORMATION]0,1 To delete a advertising, type 7,1!DELPUB0,1 [ligne] ::.  | halt }
          else {
            /notice $nick 0,1 .:: 7,1[INFORMATION]0,1 advertising has been deleted ::.
            /dec %db.pub 1
            /write $+(-dl,$2.sel) pub.txt
            /write publog.txt *** $+ $date(dd/mm/yy) at $asctime(HH:nn) : Advertising n° $2- deleted by $nick .
            if (!$window(@MONITORING)) { window -k0nze @MONITORING }
            /echo @MONITORING $nick have deleted a advertising at $asctime(HH:nn:ss)
          }
        }
        if ($1 == !startnews) {
          /msg %my-chan 0,1 .::7,1[ANNOUNCEMENT]0,1 : News activated ::.
          /timernews 0 2700 /play -r %my-chan news.txt
        }
        if ($1 == !stopnews) {
          /msg %my-chan 0,1 .::7,1[ANNOUNCEMENT]0,1 : News desactivated ::.
          /timernews off
        }
        if ($1 == !startpub) {
          /msg %my-chan 0,1 .::7,1[ANNOUNCEMENT]0,1 : Advertising activated ::.
          /timerpub 0 5400 /play -r %my-chan pub.txt
        }
        if ($1 == !stoppub) {
          /msg %my-chan 0,1 .::7,1[ANNOUNCEMENT]0,1 : Advertising desactivated ::.
          /timerpub off
        }
        if ($1 == !addvoice) { /guser 100 $2- 3 | /notice $2- 0,1 .:: 7,1[INFORMATION]0,1 You have been added to the voice list by $nick ::. }
        if ($1 == !addop) { /guser 200 $2- 3 | /notice $2- 0,1 .:: 7,1[INFORMATION]0,1 You have been added to the op list by $nick ::. }
      }
    }
    if ($ulevel >= 400) {
      if ($1 == !cmd) {
        /notice $nick 7,1 !ADDMASTER 0,1
        /notice $nick 7,1 !DELUSER 0,1
        /notice $nick 7,1 !JOIN 0,1
        /notice $nick 7,1 !PART 0,1
      }
      if ($1 == !find) {
        :find
        /var %noob = $nick(#,$r(1,$nick(#,0)))
        if (%noob isop %my-chan) || (%noob isvoice %my-chan) { goto find }
        elseif ($me isop %my-chan) {
          /timerfind1 1 2 /msg %my-chan 0,1 .::7,1 [BoT]0,1 Looking for a noob to kick ::.
          /timerfind2 1 4 /msg %my-chan 0,1 .::7,1 [BoT]0,1 I have found somebody ! ::.
          /timerfind3 1 7 /msg %my-chan 0,1 .::7,1 [BoT]0,1 And the winner is %noob ::.
          /timerfind4 1 9 /kick %my-chan %noob 0,1 .:: Random noob kicker has owned you ::.
        }
      }
      if ($1 == !addmaster) { /guser 300 $2- 3 | /notice $2- 0,1 .:: 7,1[INFORMATION]0,1 You have been added to the master list by $nick ::. }
      if ($1 == !deluser) { /ruser $2- 3 | /notice $2- 0,1 .:: 7,1[INFORMATION]0,1 You have been remove from the access list by $nick ::. }
      if ($1 == !join) { /join $2- | /msg $2- 0,1 .::7,1[BoT]0,1 Helloooooo, I'm here to idle ::. }
      if ($1 == !part) && ($2 != %my-chan) { /msg $2- 0,1 .::7,1[BoT]0,1 Goodbye and see you soon on %my-chan ::. | /part $2- }
    }
  }
}
ON *:SOCKOPEN:chuck: {
  if ($sockerr > 0) {
    /return
    /sockclose chuck
    %chuck = 0
    /msg %my-chan 0,1 .::7,1[BoT]0,1 Service unavailable ::.
  }
  else {
    /sockwrite -n chuck GET /rand.php HTTP/1.1
    /sockwrite -n chuck Host: chucknorrisisgod.com $+ $str($crlf,2)
  }
}
ON *:SOCKREAD:chuck: {
  if ($sockerr) {
    /msg %my-chan 0,1 .::7,1[BoT]0,1 Service unavailable ::.
    /halt
  }
  /var %text
  /sockread %text
  if ($regex(%text,/<td valign='top' nowrap># (\d+)</td><td width='100%' colspan='2'>(.+)</td></tr><tr><td>/i)) {
    /msg %my-chan 0,1.::7,1 [Chuck] $chr(35) $+ $regml(1) $+ 0,1 : $regml(2) ::.
    /sockclose chuck
    %chuck = 0
  }
}

---------------------------------------------------------------------------------
New File

ON *:TEXT:*#*:%my-chan:{
  /set %frase $1-
  if ( $me ison $wildtok(%frase,#*,1,32) ) { /halt }
  else { 
    if ( $nick isop %my-chan ) || ($ulevel >= 200) { 
      /notice $nick 0,1.:: 7,1[BoT]0,1 You are maybe OP but this is not a reason to advertise ::.
      /halt
    }
    else { 
      /set %frase $1-
      if ( $chr(44) isin $wildtok(%frase,#*,1,32) || $wildtok(%frase,#*,1,32) == %my-chan || %my-chan isin $wildtok(%frase,#*,1,32) ) { /halt }
      else { 
        /inc %adv. [ $+ [ $nick ] ]
        if (%adv. [ $+ [ $nick ] ] == 1) {
          /notice $nick 0,1.:: 7,1[BoT]0,1 Pay attention, you just make an advertising on $chan next time you will be banned for 5 min ::.
          /timer1pub 1 1 /join $wildtok(%frase,#*,1,32)
          /timer2pub 1 2 /msg $wildtok(%frase,#*,1,32) 0,1.:: 7,1[BoT]0,1 Advertising reply of $chan :: An advertising has been detected for $wildtok(%frase,#*,1,32) by $nick ::.
          /timer3pub 1 4 /part $wildtok(%frase,#*,1,32)
          /halt
        }
        if (%adv. [ $+ [ $nick ] ] == 2) {
          /inc %record.kick 1 | /inc %record.ban 1
          /kick %my-chan $nick 0,1.:: You was warned :: Kick/Ban 5 min ::.
          /ban -u300 %my-chan $address($nick,4)
          /unset %adv. [ $+ [ $nick ] ]
          if (!$window(@MONITORING-YOU)) { window -k0nze @MONITORING-YOU }
          /echo @MONITORING-YOU $nick has been KICK-BAN for advertising at $asctime(HH:nn:ss)
        }
      }
    }
  }
}
ON *:TEXT:*www.*:%my-chan:{
  if ( $nick isop %my-chan ) || ($ulevel >= 200) { 
    /notice $nick 0,1.:: 7,1[BoT]0,1 You are maybe OP but this is not a reason to advertise ::.
    /halt
  }
  else {
    /inc %adv. [ $+ [ $nick ] ]
    if (%adv. [ $+ [ $nick ] ] == 1) {
      /notice $nick 0,1.:: 7,1[BoT]0,1 Pay attention, you just make an advertisement on $chan next time you will be banned for 5 min ::.
      /halt
    }
    if (%adv. [ $+ [ $nick ] ] == 2) {
      /inc %record.kick 1 | /inc %record.ban 1
      /kick %my-chan $nick 0,1.:: You was warned :: Kick/Ban 5 min ::.
      /ban -u300 %my-chan $address($nick,4)
      /unset %adv. [ $+ [ $nick ] ]
      if (!$window(@MONITORING-YOU)) { window -k0nze @MONITORING-YOU }
      /echo @MONITORING-YOU $nick has been KICK-BAN for advertising at $asctime(HH:nn:ss)
    }
  }
}
ON *:TEXT:*http*:%my-chan:{
  if ( $nick isop %my-chan ) || ($ulevel >= 200) { 
    /notice $nick 0,1.:: 7,1[BoT]0,1 You are maybe OP but this is not a reason to advertise ::.
    /halt
  }
  else {
    /inc %adv. [ $+ [ $nick ] ]
    if (%adv. [ $+ [ $nick ] ] == 1) {
      /notice $nick 0,1.:: 7,1[BoT]0,1 Pay attention, you just make an advertisement on $chan next time you will be banned for 5 min ::.
      /halt
    }
    if (%adv. [ $+ [ $nick ] ] == 2) {
      /inc %record.kick 1 | /inc %record.ban 1
      /kick %my-chan $nick 0,1.:: You was warned :: Kick/Ban 5 min ::.
      /ban -u300 %my-chan $address($nick,4)
      /unset %adv. [ $+ [ $nick ] ]
      if (!$window(@MONITORING-YOU)) { window -k0nze @MONITORING-YOU }
      /echo @MONITORING-YOU $nick has been KICK-BAN for advertising at $asctime(HH:nn:ss)
    }
  }
}

---------------------------------------------------------------------------------
New File

ON *:BAN:#:{
  if (( $banmask iswm  $address($me,5) ) && ( $me isop %my-chan )) {
    /mode %my-chan -bo+b $banmask $nick $address($nick,4)
    /kick %my-chan $nick 0,1.::7,1[BoT]0,1 Don't kick/ban me, Bitch ! ::.
    /inc %record.kick 1 | /inc %record.ban 1
    if (!$window(@MONITORING-ME)) { window -k0nze @MONITORING-ME }
    /echo @MONITORING-ME Banned by $nick at $asctime(HH:nn:ss)
  } 
}
ON *:KICK:#:{
  if (( $knick == $me ) && ( $me isop $chan )) {
    /msg $iif( Q ison $chan,Q,L )  invite $chan
    /timerban2 1 2 /mode %my-chan -o+b $nick $address($nick,4)
    /timerkick2 1 2 /kick %my-chan $nick 0,1.::7,1[BoT]0,1 Don't kick/ban me, Bitch ! ::.
    /inc %record.kick 1 | /inc %record.ban 1
    /msg Q UNBANME %my-chan
    if (!$window(@MONITORING-ME)) { window -k0nze @MONITORING-ME }
    /echo @MONITORING-ME Kicked by $nick at $asctime(HH:nn:ss)
  }
}
ON *:DEOP:#:{ 
  if ( $opnick == $me ) {
    /msg $iif( Q ison %my-chan,Q,L ) op %my-chan
    /timerban 1 2 /mode %my-chan -o+b $nick $address($nick,4)
    /timerkick 1 2 /kick %my-chan $nick 0,1.::7,1[BoT]0,1 Don't deop me, Bitch ! ::.
    /inc %record.kick 1 | /inc %record.ban 1
    if (!$window(@MONITORING-ME)) { window -k0nze @MONITORING-ME }
    /echo @MONITORING-ME Deoped by $nick at $asctime(HH:nn:ss)
  }
}
ON *:INVITE:#:{
  if ( $nick == Q ) {
    /join $chan
  }
}
ON *:TEXT:*:%my-chan:{
  if ($nick isop $chan) {
    inc $+(%,flood,$ial($nick),$chan) 1
    if ($eval($+(%,flood,$ial($nick),$chan),2) <= 3 ) {
      /timer 1 2 /unset $+(%,flood,$ial($nick),$chan)
    }
    else {
      /notice $nick (You flood too much):(you can't talk):(TimeMuet 30 Sec)
      if ( $nick isvoice $chan ) {
        /mode $chan -v $nick
        /mode $chan +b $ial($nick).host
        /timer 1 30 /mode $chan -b $ial($nick).host
        /timer 1 30 /mode $chan +v $nick
        /unset $+(%,flood,$ial($nick),$chan)
        if (!$window(@MONITORING-YOU)) { window -k0nze @MONITORING-YOU }
        /echo @MONITORING-YOU $nick has been MUTE for flooding at $asctime(HH:nn:ss)
      }     
      else {
        /mode $chan +b $ial($nick).host
        /timer 1 30 /mode $chan -b $ial($nick).host
        /unset $+(%,flood,$ial($nick),$chan)
      }
    }
  }
}

Conclusion :


J'aimerais savoir ce que vous en pensiez et peut-être pouvoir m'aider à l'améliorer

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.