begin process at 2012 02 11 02:19:40
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Scripts

 > SCRIPT DE PICKUP

SCRIPT DE PICKUP


 Information sur la source

 Description

Un script de pickup pour jeux en ligne (Cs...), 5 contre 5.
Il gère tous les évènements qui interfèrent dans le pickup: part, quit, kick, changement de nick (malgrés un petit bug là dessus que je n'ai pas corrigé il faut que je cherche; il faut que la fenêtre active lors d'un !add sois celle du salon en question)...
Utilisation des variables et des hashs tables.

Source

  • on *:join:%chan:{
  • if (%pickok == on) {
  • notice $nick Un pickup est en cours sur %chan pour y participer tappez !add
  • }
  • }
  • on *:text:pass*:?:{
  • if ($nick isop %chan) {
  • set %pass $$2
  • msg $nick Ok, pass du serveur enregistré: %pass
  • }
  • else {
  • msg $nick Erreur ! Vous n'êtes pas opérateur de %chan
  • }
  • }
  • on *:text:!pickup*:#:{
  • if ($nick isop $chan) {
  • set %chan $chan
  • set %map $$2
  • set %serveur $3
  • set %stopic $chan($chan).topic
  • set %pickok on
  • topic $chan Pickup Lancé - Team A: En attente de joueurs tappez !add - Team B: En attente de joueurs tappez !add - Serveur: %serveur - Map: %map
  • notice $nick Définissez le mot de pass sur le serveur puis tappez /msg $me pass LeMotDePass
  • msg %chan Pickup lancé en attente de joueurs tappez !add pour y participer
  • }
  • }
  • on *:text:!stop:#:{
  • if ($nick isop $chan) {
  • msg $chan Pickup annulé.
  • topic $chan %stopic
  • hfree -sw *team*
  • set %pickok off
  • unset %team*
  • unset %pass
  • unset %serveur
  • }
  • }
  • alias stop {
  • hfree -sw *team*
  • set %pickok off
  • unset %team*
  • unset %pass
  • unset %serveur
  • }
  • on *:text:!add:#:{
  • if (%pickok == on) {
  • if (($hget(teama,0).item < 5) && ($hfind(teama,$nick,0) == 0)) {
  • hadd -m teama $nick
  • mode $chan +v $nick
  • msg $chan $nick ajouté à la team A
  • var %a = $hget(teama,0).item, %i = 1
  • while (%i <= %a) {
  • set %teama %teama $hget(teama,%i).item
  • inc %i
  • }
  • topic %chan Pickup Lancé - Team A: %teama - Team B: %teamb - Serveur: %serveur - Map: %map
  • }
  • else {
  • if (($hget(teama,0).item < 5) && ($hfind(teama,$nick,0) == 0) && ($hfind(teamb,$nick,0) == 0)) {
  • hadd -m teamb $nick
  • mode $chan +v $nick
  • msg $chan $nick ajouté à la team B
  • var %a = $hget(teamb,0).item, %i = 1
  • while (%i <= %a) {
  • set %teamb %teamb $hget(teamb,%i).item
  • inc %i
  • }
  • topic %chan Pickup Lancé - Team A: %teama - Team B: %teamb - Serveur: %serveur - Map: %map
  • }
  • else {
  • if (($hget(teama,0).item == 5) && ($hget(teamb,0).item == 5)) {
  • msg $chan Pickup complet sur %serveur les participants vont recevoir le mot de pass en privé.
  • topic %chan %stopic
  • send.pass
  • stop
  • }
  • }
  • }
  • }
  • else {
  • msg $chan Désolé pas de pickup en cours.
  • }
  • }
  • on *:text:!remove:#:{
  • if ($hfind(teama,$nick,0) != 0) {
  • hdel -s teama $nick
  • msg $chan $nick à été retiré du pickup.
  • mode $chan -v $nick
  • set %teama $replace(%teama, $nick, $chr(0))
  • }
  • elseif ($hfind(teamb,$nick,0) != 0) {
  • hdel -s teamb $nick
  • msg $chan $nick à été retiré du pickup.
  • mode $chan -v $nick
  • set %teamb $replace(%teamb, $nick, $chr(0))
  • }
  • else {
  • msg $chan $nick vous n'êtes pas dans le pickup en cours.
  • }
  • }
  • on *:part:%chan:{
  • if ($hfind(teama,$nick,0) != 0) {
  • hdel -s teama $nick
  • set %teama $replace(%teama, $nick, $chr(0))
  • msg $chan $nick à été retiré du pickup.
  • }
  • elseif ($hfind(teamb,$nick,0) != 0) {
  • hdel -s teamb $nick
  • set %teamb $replace(%teamb, $nick, $chr(0))
  • msg $chan $nick à été retiré du pickup.
  • }
  • }
  • on *:quit:%chan:{
  • if ($hfind(teama,$nick,0) != 0) {
  • hdel -s teama $nick
  • set %teama $replace(%teama, $nick, $chr(0))
  • msg $chan $nick à été retiré du pickup.
  • }
  • elseif ($hfind(teamb,$nick,0) != 0) {
  • hdel -s teamb $nick
  • set %teamb $replace(%teamb, $nick, $chr(0))
  • msg $chan $nick à été retiré du pickup.
  • }
  • }
  • on *:kick:%chan:{
  • if ($hfind(teama,$knick,0) != 0) {
  • hdel -s teama $nick
  • set %teama $replace(%teama, $nick, $chr(0))
  • msg $chan $knick à été retiré du pickup.
  • }
  • elseif ($hfind(teamb,$knick,0) != 0) {
  • hdel -s teamb $nick
  • set %teamb $replace(%teamb, $nick, $chr(0))
  • msg $chan $knick à été retiré du pickup.
  • }
  • }
  • on *:NICK:{
  • if ($active != Status Window) {
  • if ($hfind(teama,$nick,0) != 0) {
  • hdel -s teama $nick
  • hadd -m teama $newnick
  • set %teama $replace(%teama, $nick, $chr(0))
  • set %teama %teama $newnick
  • msg %chan Pseudo de $nick changé en $newnick dans le pickup.
  • }
  • elseif ($hfind(teamb,$nick,0) != 0) {
  • hdel -s teamb $nick
  • hadd -m teamb $newnick
  • set %teamb $replace(%teamb, $nick, $chr(0))
  • set %teamb %teamb $newnick
  • msg %chan Pseudo de $nick changé en $newnick dans le pickup.
  • }
  • }
  • else {
  • msg %chan /!\Attention/!\ veuillez modfifier la fenêtre en cours qui est: $active
  • }
  • }
  • alias send.pass {
  • var %a = $hget(teama,0).item, %i = 1
  • while (%i <= %a) {
  • msg $hget(teama,%i).item Le pickup va commencer, ip: %serveur Pass: %pass Gogogo !
  • inc %i
  • }
  • var %a = $hget(teamb,0).item, %i = 1
  • while (%i <= %a) {
  • msg $hget(teamb,%i).item Le pickup va commencer, ip: %serveur Pass: %pass Gogogo !
  • inc %i
  • }
  • }
on *:join:%chan:{
  if (%pickok == on) {
    notice $nick Un pickup est en cours sur %chan pour y participer tappez !add
  }
}
on *:text:pass*:?:{
  if ($nick isop %chan) {
    set %pass $$2
    msg $nick Ok, pass du serveur enregistré: %pass
  }
  else {
    msg $nick Erreur ! Vous n'êtes pas opérateur de %chan
  }
}
on *:text:!pickup*:#:{
  if ($nick isop $chan) {
    set %chan $chan
    set %map $$2
    set %serveur $3
    set %stopic $chan($chan).topic
    set %pickok on
    topic $chan Pickup Lancé - Team A: En attente de joueurs tappez !add - Team B: En attente de joueurs tappez !add - Serveur: %serveur - Map: %map
    notice $nick Définissez le mot de pass sur le serveur puis tappez /msg $me pass LeMotDePass
    msg %chan Pickup lancé en attente de joueurs tappez !add pour y participer
  }
}
on *:text:!stop:#:{
  if ($nick isop $chan) {
    msg $chan Pickup annulé.
    topic $chan %stopic
    hfree -sw *team*
    set %pickok off
    unset %team*
    unset %pass
    unset %serveur
  }
}
alias stop {
  hfree -sw *team*
  set %pickok off
  unset %team*
  unset %pass
  unset %serveur
}

on *:text:!add:#:{
  if (%pickok == on) {
    if (($hget(teama,0).item < 5) && ($hfind(teama,$nick,0) == 0)) {
      hadd -m teama $nick
      mode $chan +v $nick
      msg $chan $nick ajouté à la team A
      var %a = $hget(teama,0).item, %i = 1
      while (%i <= %a) {
        set %teama %teama $hget(teama,%i).item
        inc %i
      }
      topic %chan Pickup Lancé - Team A: %teama - Team B: %teamb - Serveur: %serveur - Map: %map
    }
    else {
      if (($hget(teama,0).item < 5) && ($hfind(teama,$nick,0) == 0) && ($hfind(teamb,$nick,0) == 0)) {
        hadd -m teamb $nick
        mode $chan +v $nick
        msg $chan $nick ajouté à la team B
        var %a = $hget(teamb,0).item, %i = 1
        while (%i <= %a) {
          set %teamb %teamb $hget(teamb,%i).item
          inc %i
        }
        topic %chan Pickup Lancé - Team A: %teama - Team B: %teamb - Serveur: %serveur - Map: %map
      }
      else {
        if (($hget(teama,0).item == 5) && ($hget(teamb,0).item == 5)) {
          msg $chan Pickup complet sur %serveur les participants vont recevoir le mot de pass en privé.
          topic %chan %stopic
          send.pass
          stop
        }
      }
    }
  }
  else {
    msg $chan Désolé pas de pickup en cours.
  }
}


on *:text:!remove:#:{
  if ($hfind(teama,$nick,0) != 0) {
    hdel -s teama $nick
    msg $chan $nick à été retiré du pickup.
    mode $chan -v $nick
    set %teama $replace(%teama, $nick, $chr(0))
  }
  elseif ($hfind(teamb,$nick,0) != 0) {
    hdel -s teamb $nick
    msg $chan $nick à été retiré du pickup.
    mode $chan -v $nick
    set %teamb $replace(%teamb, $nick, $chr(0))
  }
  else {
    msg $chan $nick vous n'êtes pas dans le pickup en cours.
  }
}
on *:part:%chan:{
  if ($hfind(teama,$nick,0) != 0) {
    hdel -s teama $nick
    set %teama $replace(%teama, $nick, $chr(0))
    msg $chan $nick à été retiré du pickup.
  }
  elseif ($hfind(teamb,$nick,0) != 0) {
    hdel -s teamb $nick
    set %teamb $replace(%teamb, $nick, $chr(0))
    msg $chan $nick à été retiré du pickup.
  }
}

on *:quit:%chan:{
  if ($hfind(teama,$nick,0) != 0) {
    hdel -s teama $nick
    set %teama $replace(%teama, $nick, $chr(0))
    msg $chan $nick à été retiré du pickup.
  }
  elseif ($hfind(teamb,$nick,0) != 0) {
    hdel -s teamb $nick
    set %teamb $replace(%teamb, $nick, $chr(0))
    msg $chan $nick à été retiré du pickup.
  }
}
on *:kick:%chan:{
  if ($hfind(teama,$knick,0) != 0) {
    hdel -s teama $nick
    set %teama $replace(%teama, $nick, $chr(0))
    msg $chan $knick à été retiré du pickup.
  }
  elseif ($hfind(teamb,$knick,0) != 0) {
    hdel -s teamb $nick
    set %teamb $replace(%teamb, $nick, $chr(0))
    msg $chan $knick à été retiré du pickup.
  }
}
on *:NICK:{
  if ($active != Status Window) {
    if ($hfind(teama,$nick,0) != 0) {
      hdel -s teama $nick
      hadd -m teama $newnick
      set %teama $replace(%teama, $nick, $chr(0))
      set %teama %teama $newnick
      msg %chan Pseudo de $nick changé en $newnick dans le pickup. 
    }
    elseif ($hfind(teamb,$nick,0) != 0) {
      hdel -s teamb $nick
      hadd -m teamb $newnick
      set %teamb $replace(%teamb, $nick, $chr(0))
      set %teamb %teamb $newnick
      msg %chan Pseudo de $nick changé en $newnick dans le pickup. 
    }
  }
  else {
    msg %chan /!\Attention/!\ veuillez modfifier la fenêtre en cours qui est: $active
  }
}

alias send.pass {
  var %a = $hget(teama,0).item, %i = 1
  while (%i <= %a) {
    msg $hget(teama,%i).item Le pickup va commencer, ip: %serveur Pass: %pass Gogogo !
    inc %i
  }
  var %a = $hget(teamb,0).item, %i = 1
  while (%i <= %a) {
    msg $hget(teamb,%i).item Le pickup va commencer, ip: %serveur Pass: %pass Gogogo !
    inc %i
  }
}

 Conclusion

Pour l'utiliser:
!pickup map serveur puis /msg NomDuBot pass LeMotDePassDuServeur
!add pour s'ajouter à une équipe
!stop pour arrêter le pickup


 Sources du même auteur

MÉMORISER LES CHANS QU'ON JOIN/PART À LA MANIÈRE D'UN BNC
UN SYSTÊME VIP TRÈS SIMPLE
ANTI IDLE POUR SALON
Source avec Zip BOT POUR SALON DE TEAM COUNTER-STRIKE (CS)
SYSTÊME DE NEWS SIMPLE

 Sources de la même categorie

Source avec Zip PENDU POUR MIRC par neobidou
Source avec Zip MODIFICATION ET TRADUCTION DU SCRIPT RHYTHMBOX XCHAT ANNOUNC... par TrHiLK1L
[TCL] AUTOJOIN DE ROBOT AUTOMATIQUE par Atok
Source avec une capture TORRENT VIEWER par kamikaze97441
Source avec Zip Source avec une capture PANNEAU DE CONFIGURATION PS7 par aliassangelius

Commentaires et avis

Commentaire de wims le 06/06/2005 23:04:29

Si tu pouvais expliquer a quoi cela sert parce que je vois pas bien.
on *:NICK:{
   if ($active != Status Window) {

Lol ?

Commentaire de Hathor le 06/06/2005 23:13:59

Salut, pke j'ai un pb de check on *:nick si le bot est pas $active sur le chan. ça chie

Commentaire de wims le 06/06/2005 23:42:46

l'explication du bot ? :x

Commentaire de jhd le 07/06/2005 10:34:03

c pas mal mais y mank tjs un truc
un socket de connection UDP je crois qui permettra viaz identification RCON de changer le pass du serv et la map automatiquement , meme sans présence d un admin

Commentaire de RCA ArKanis le 07/06/2005 15:27:28

if (($nick !ison "chan") || ($newnick !ison "chan")), non ?
je mets toujours ça car j'oublie toujours lequel utiliser dans un ON NICK :D

tu aurais pu regrouper les ON TEXT sous un seul ON TEXT
c'est dommage que le nombre de joueurs soit limité, tu aurais pu le faire configurable

assez bien codé sinon
la variable %chan est assez souvent utilisée, tu aurais pu lui trouver un autre nom

sinon je crois que pour l'utilisation c'est :

!pickup "map" "serveur"

ici :
set %map $$2
set %serveur $3
pourquoi $$2 et pas pareil avec $3 ?

Commentaire de RCA ArKanis le 07/06/2005 15:32:46

on *:quit:%chan:{
lis l'aide à propos du ON QUIT
problème aussi si quelqu'un tape !stop alors que ce n'est pas sur le chan où le pickup se déroule
pareil pour le !add !remove etc

évite d'envoyer des messages au ON JOIN, si jamais il y a un retour de net split voir un boulet qui s'amuse à faire join/part ses BNCs ...

je te conseillerai de mettre plus de protections anti-flood, surtout si tu tiens à faire de ce bot un bot pour un gros salon

Commentaire de Tidam le 07/06/2005 20:03:12

[Quote] c pas mal mais y mank tjs un truc
un socket de connection UDP je crois qui permettra viaz identification RCON de changer le pass du serv et la map automatiquement , meme sans présence d un admin[/Quote]
Non non tu ne copitera pas sur #PickupCs ^^ et pis si vous voulez un bot pickup tout fait en C go on www.Tidam.com xD

Commentaire de Proutie66 le 14/06/2005 01:27:59

NOn ?? c'est le même hathor de quakenet qui a 400 trojans et qui spam tout quakenet pour venir sur son chan ?

loulilop

Commentaire de yeloww le 18/06/2005 18:48:46

Proutie66 non moi je pense plus tot a Hathor Zadmin sur jeux.fr

Commentaire de Proutie66 le 19/06/2005 11:59:49

Bha c le même ;)

Le mec il balance des script pour trojan les débutant et puis il post ses ptites sources sur quakenet ^^ comme si de rien nétait loule

Commentaire de XqTu le 09/04/2006 14:47:33

salut j'aimerais savoir ou ils faut mettre le script :( plz :D

Commentaire de RCA ArKanis le 09/04/2006 15:16:34

dans ton remote (alt + r)
nouveau fichier de préférence ^^

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,997 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales