Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

ROBOT INTEGRER A VOTRE SCRIPT EN SOCKET


Information sur la source

Catégorie :Bots Niveau : Débutant Date de création : 24/11/2002 Date de mise à jour : 16/03/2003 21:05:45 Vu : 15 437

Note :
4,67 / 10 - par 6 personnes
4,67 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10

Commentaire sur cette source (19)
Ajouter un commentaire et/ou une note

Description

ben ça vous permetra de mettre un robot sur un salon sans utiliser d'autre mirc tout reste dans votre script tout sera dans la meme instance .....  
 

Source

  • pour lancer le bot : /dialog -m Robot Robot
  • alias g { return $gettok(%l.sock,$1,32) }
  • alias d { dialog - $+ $1 $str($2 $+ $chr(32) , 2 ) }
  • alias as { if ( $readini(Robot.ini,$1,auth) = ok ) { return o } | else { return n } }
  • alias cs { if ( $readini(Robot.ini,$1,salon) != all ) { if ( $2 isin $readini(Robot.ini,$1,salon) ) { return o } | else { return n } } | elseif ( $readini(Robot.ini,$1,salon) = all ) { return o } }
  • alias ps { if ( $readini(Robot.ini,$1,code) = $2 ) { return o } | else { return n } }
  • alias sn { if ( $1 = $null ) { return %nick } | else { return $1 } }
  • alias ss { sockwrite -tn Robot $1 }
  • alias ts { return $replace($1,$chr(32),$chr(160)) }
  • alias us { if ( $readini(Robot.ini,$1,code) != $null ) { return o } | else { return n } }
  • alias del { remini Robot.ini $1 | write -ds $+ $1 Robot.txt }
  • alias lev { if ( $readini(Robot.ini,%nick,level) < $1 ) { $smsg(%nick,$ts(niveau insufisant)) | return goto end } }
  • alias edom { if ( @ isin $1 ) { return par %nick } | else { return $remove($1,:) } }
  • alias smsg { sockwrite -tn $sockname privmsg $1 $2 }
  • alias cmd2 { if ( $1 isin $readini(Robot.ini,bot,commande) ) { return o } | elseif ( left($1,1) = ! ) && ( $1 !isin %cmdb ) && ( $a(%nick) = o ) { $s(%nick,commande $1 inconue) } }
  • alias ads {
  • if ( $readini(Robot.ini,adress,$1) = $null ) { return $1 }
  • if ( $2 = 0 ) { return $readini(Robot.ini,adress,$1) }
  • if ( $2 = 1 ) { return $gettok($readini(Robot.ini,adress,$1),1,64) }
  • if ( $2 = 2 ) { return @ $+ $gettok($readini(Robot.ini,adress,$1),2,64) }
  • }
  • alias add {
  • if ($len($read(Robot.txt, w, $1)) = 0 ) {
  • writeini Robot.ini $1 level $2
  • writeini Robot.ini $1 code $3
  • writeini Robot.ini $1 salon $4-
  • writeini Robot.ini $1 Mask $ads($1,1)
  • write Robot.txt $1
  • }
  • }
  • alias cmd {
  • goto $1
  • :!whois | $lev(4) | $ss(whois $3) | set %w.nick %nick | halt
  • :!op | $lev(1) | $ss(mode $2 +o $sn($3)) | halt
  • :!deop | $lev(1) | $ss(mode $2 -o $sn($3)) | halt
  • :!ban | $lev(1) | $ss(mode $2 +b $ads($3,2)) | halt
  • :!deban | $lev(1) | $ss(mode $2 -b $3) | halt
  • :!voice | $lev(1) | $ss(mode $2 +v $sn($3)) | halt
  • :!devoice | $lev(1) | $ss(mode $2 -v $sn($3)) | halt
  • :!mode | $lev(1) | $ss(mode $2 $g(5-)) | halt
  • :!kban | $lev(2) | $ss(mode $2 +b $ads($3,2)) | $ss(kick $2 $3 Lamer !!!) | halt
  • :!kick | $lev(1) | $ss(kick $2 $3 Lamer !!!) | halt
  • :!topic | $lev(2) | $ss(topic $2 $ts($g(5-))) | halt
  • :!va | $lev(3) | $ss(join $3) | halt
  • :!quit | $lev(5) | $ss(quit $ts(Kerrigan Pocket Bot)) | aline -ph @Robot deconection du robot | aline -ph @Robot fermeture de la fenetre | remini Robot.ini adress | timer 1 5 window -c @Robot | halt
  • :!degage | $lev(4) | $ss(part $3) | halt
  • :!dit | $lev(2) | $ss(privmsg $2 $ts($g(5-))) | halt
  • :!adduser | $lev(4) | $add($g(5),$g(6),$g(7),$g(8-)) | halt
  • :!deluser | $lev(4) | $del($2) | halt
  • :!addchan | $lev(5) | if ( $g(6) !isin $readini(Robot.ini,$g(5),salon ) ) { writeini Robot.ini $g(5) salon $readini(Robot.ini,$g(5),salon) $g(6) } | halt
  • :!delchan | $lev(5) | if ( $g(6) isin $readini(Robot.ini,$g(5),salon ) ) { writeini Robot.ini $g(5) salon $deltok($readini(Robot.ini,$g(5),salon),$findtok($readini(Robot.ini,$g(5),salon),$g(6),1,32),32) } | halt
  • :!addjoin | $lev(5) | if ( $g(5) !isin $readini(Robot.ini,bot,salon ) ) { writeini Robot.ini bot salon $readini(Robot.ini,bot,salon) $g(5) } | halt
  • :!deljoin | $lev(5) | if ( $g(5) isin $readini(Robot.ini,bot,salon ) ) { writeini Robot.ini bot salon $deltok($readini(Robot.ini,bot,salon),$findtok($readini(Robot.ini,bot,salon),$g(5),1,32),32) } | halt
  • :!addmask | $lev(5) | if ( $g(6) !isin $readini(Robot.ini,$g(5),mask) ) { writeini Robot.ini $g(5) mask $readini(Robot.ini,$g(5),mask) $+ , $+ $g(6) } | halt
  • :end
  • }
  • dialog Robot {
  • title "CloneGenerator - Configuration"
  • size -1 -1 200 300
  • button "O.K",3,2 270 198 25,flat,default,ok
  • icon $mircdirimages\archon.ico
  • text "Nick Du Bot",2,5 20 170 20
  • edit "",1,5 35 190 20,autohs
  • text "Server Du Bot",4,5 70 170 20
  • edit "",5,5 85 190 20,autohs
  • text "Port Du Bot",6,5 120 170 20
  • edit "",7,5 135 190 20,autohs
  • text "User Host Du Bot",8,5 170 170 20
  • edit "",9,5 185 190 20,autohs
  • text "Full Name Du Bot",10,5 220 170 20
  • edit "",11,5 235 190 20,autohs
  • }
  • on *:dialog:Robot:init:0:{
  • did -a Robot 1 $readini(Robot.ini,bot,pseudo)
  • did -a Robot 5 $readini(Robot.ini,bot,serveur)
  • did -a Robot 7 $readini(Robot.ini,bot,port)
  • did -a Robot 9 $readini(Robot.ini,bot,user)
  • did -a Robot 11 $readini(Robot.ini,bot,info)
  • }
  • on *:dialog:Robot:sclick:3:{
  • writeini Robot.ini bot pseudo $did(1)
  • writeini Robot.ini bot serveur $did(5)
  • writeini Robot.ini bot port $did(7)
  • writeini Robot.ini bot user $did(9)
  • writeini Robot.ini bot info $replace($did(11),$chr(32),$chr(160))
  • window -ek @Robot 100 100 500 200
  • titlebar @Robot MiniBot De Kerrigan
  • .timer 1 1 aline -ph @Robot Connection en cour sur $readini(Robot.ini,bot,serveur) $+ : $+ $readini(Robot.ini,bot,port)
  • .timer 1 2 sockopen Robot $readini(Robot.ini,bot,serveur) $readini(Robot.ini,bot,port)
  • titlebar @Robot $readini(Robot.ini,bot,pseudo) Neodyme Pocket Bot server $readini(Robot.ini,bot,serveur) : port : $readini(Robot.ini,bot,port)
  • if ( %start.bot != ok ) {
  • var %owner $$?="rentre ton pseudo "
  • var %salon $$?="rentre le salon du bot"
  • writeini Robot.ini %owner owner %owner
  • writeini Robot.ini %owner code $$?="rentre un mot de pass"
  • writeini Robot.ini %owner salon %salon
  • writeini Robot.ini %owner level 6
  • writeini Robot.ini %owner auth ok
  • write Robot.txt %owner
  • writeini Robot.ini bot salon %salon
  • writeini Robot.ini bot commande !whois !op !deop !ban !deban !voice !devoice !kban !mode !auth !kick !topic !va !quit !degage !dit !adduser !deluser !addchan !addjoin !deljoin !delchan
  • set %start.bot ok
  • }
  • }
  • on 1:sockopen:Robot: {
  • set %itr 1
  • sockwrite -n $sockname user $readini(Robot.ini,bot,user) $readini(Robot.ini,bot,user) $readini(Robot.ini,bot,user) $readini(Robot.ini,bot,info)
  • sockwrite -n $sockname nick $readini(Robot.ini,bot,pseudo)
  • aline -ph @Robot Connection etablie
  • while ( %itr <= $gettok($readini(Robot.ini,bot,salon),0,32) ) { $ss(join $gettok($readini(Robot.ini,bot,salon),%itr,32)) | inc %itr }
  • }
  • on 1:sockclose:Robot: {
  • aline -ph @Robot deconection du robot
  • aline -ph @Robot fermeture de la fenetre
  • remini Robot.ini adress
  • timer 1 5 window -c @Robot
  • }
  • on 1:sockread:Robot:{
  • if ($sockerr > 0) { return }
  • :loop
  • sockread %l.sock
  • if ($sockbr == 0) { return }
  • if ($gettok(%l.sock,1,32) == ping ) { sockwrite -n $sockname PONG $g(2-) }
  • set %g.l.sock $replace(%l.sock,$chr(58),$chr(32))
  • set %nick $gettok($gettok(%g.l.sock,1,33),1,32)
  • if ( $window(@Robot) = $null ) { echo -s $b(robot) deconecter a $time | sockclose Robot | goto end }
  • echo @robot %l.sock
  • if ( $readini(Robot.ini,adress,%nick) = $null ) || ( $readini(Robot.ini,adress,%nick) != $gettok($gettok(%g.l.sock,2,33),1,32) ) { if ( $gettok($gettok(%g.l.sock,2,33),1,32) != $null ) || ( @ isin $gettok($gettok(%g.l.sock,2,33),1,32) ) { writeini Robot.ini adress %nick $gettok($gettok(%g.l.sock,2,33),1,32) } }
  • if ( $g(2) = privmsg ) {
  • if ( $us(%nick) = o ) && ( $ads(%nick,1) isin $readini(Robot.ini,%nick,mask) ) && ( $gettok($g(4),1,58) = !auth ) && ( $g(5) = $readini(Robot.ini,%nick,code) ) { writeini Robot.ini %nick auth ok | $ss(privmsg %nick $ts(%nick Reconnu)) }
  • if ( $as(%nick) = n ) && ( $us(%nick) = o ) && ( $cmd2($gettok($g(4),1,58)) = o ) { $ss(privmsg %nick $ts(tu n'es pas identifier)) }
  • if ( $left($g(3),1) != $chr(35) ) { if ( $as(%nick) = o ) && ( $cs(%nick,$g(5)) = o ) && ( $us(%nick) = o ) && ( $cmd2($gettok($g(4),1,58)) = o ) { $cmd($gettok($g(4),1,58),$g(5),$g(6)) } }
  • if ( $left($g(3),1) = $chr(35) ) { if ( $as(%nick) = o ) && ( $us(%nick) = o ) && ( $cs(%nick,$g(3)) = o ) && ( $cmd2($gettok($g(4),1,58)) = o ) { $cmd($gettok($g(4),1,58),$g(3),$g(5)) } }
  • }
  • if ( $g(2) = nick) {
  • echo @Robot %nick devient $gettok($g(3),1,58)
  • if ( $as(%nick) = o) {
  • writeini Robot.ini $gettok($g(3),1,58) auth ok
  • writeini Robot.ini %nick auth nick
  • if ( $us($gettok($g(3),1,58)) = n ) {
  • writeini Robot.ini $gettok($g(3),1,58) level $readini(Robot.ini,%nick,level)
  • writeini Robot.ini $gettok($g(3),1,58) salon $readini(Robot.ini,%nick,salon)
  • writeini Robot.ini $gettok($g(3),1,58) code $readini(Robot.ini,%nick,code)
  • writeini Robot.ini $gettok($g(3),1,58) mask $readini(Robot.ini,%nick,mask)
  • write Robot.txt $gettok($g(3),1,58)
  • }
  • }
  • }
  • if ( $g(2) = quit ) { if ( $as(%nick) = o ) { writeini Robot.ini %nick auth quit } | echo @robot %nick a quitter l'irc }
  • if ( $g(2) = mode ) { echo @Robot Mode sur $g(3) : $focus($g(4-)) $edom($g(1)) }
  • if ( $g(2) = notice ) { echo @Robot Notice de %nick : $remove($g(4-),:) }
  • if ( $g(2) = join ) { echo @Robot %nick entre sur $remove($g(3),:) }
  • if ( $g(2) = part ) { if ( $as(%nick) = o ) && ( $gettok($readini(Robot.ini,%nick,salon),0,32) = 1 ) { writeini Robot.ini %nick auth part } | echo @robot %nick est parti de $g(3) }
  • if ( $g(2) = 001 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 002 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 003 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 004 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 005 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 251 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 252 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 254 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 255 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 265 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 266 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 311 ) { $smsg(%w.nick,$ts($g(4) : $g(5) $+ @ $+ $g(6))) | $smsg(%w.nick,$ts(info $g(8-))) }
  • if ( $g(2) = 312 ) { $smsg(%w.nick,$ts(Serveur $g(5))) }
  • if ( $g(2) = 317 ) { $smsg(%w.nick,$ts(Idle $g(5) secondes)) }
  • if ( $g(2) = 318 ) { $smsg(%w.nick,$ts(Whois terminer) ) }
  • if ( $g(2) = 319 ) { $smsg(%w.nick,$ts(Salon $gettok($g(5-),1,58))) }
  • if ( $g(2) = 332 ) { echo @Robot topic $g(4) : $g(5-) }
  • if ( $g(2) = 333 ) { echo @Robot qu'est ce que c'est ? : $g(5-) }
  • if ( $g(2) = 353 ) { echo @Robot Robot $g(5) => $g(6-) }
  • if ( $g(2) = 366 ) { echo @Robot Robot fin de liste des pseudo de $g(4) }
  • if ( $g(2) = 372 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 375 ) { echo @Robot Motd $remove($g(4-),:) }
  • if ( $g(2) = 376 ) { echo @Robot Motd fin Motd }
  • if ( $g(2) = 401 ) && ( $as($g(4)) = o) { if ( $as($g(4)) = o ) { writeini Robot.ini $g(4) auth part } | $smsg(%nick,$ts($g(4) n'est pas sur l'irc)) }
  • if ( $g(2) = 412 ) { echo @Robot pas de texte a envoyer }
  • if ( $g(2) = 421 ) { echo @Robot Erreur commande inconue : $g(4) }
  • if ( $g(2) = 441 ) && ( $as($g(4)) = o) { if ( $as($g(4)) = o ) && ( $gettok($readini(Robot.ini,%nick,salon),0,32) = 1 ) { writeini Robot.ini $g(4) auth part } | $smsg(%nick,$ts($g(4) n'est pas sur $g(5))) }
  • if ( $g(2) = 461 ) { echo @Robot Probleme d'enregistrement }
  • goto loop
  • :end
  • }
  • menu @Robot {
  • Neodyme Pocket Bot : echo -a Robot de poche pour Neodyme Script by Kerrigan
  • Deconnecter le bot : $ss(quit $ts(Kerrigan Pocket Bot)))
  • Aller sur un salon : $ss(join $$?="entre le salon")
  • Autojoin
  • .ajouter : set %add $$?="Salon a rajouter" if ( %add !isin $readini(Robot.ini,bot,salon ) ) { writeini Robot.ini bot salon $readini(Robot.ini,bot,salon) %add }
  • .retirer : set %del $$?= "salon a enlever" if ( %del isin $readini(Robot.ini,bot,salon ) ) { writeini Robot.ini bot salon $deltok($readini(Robot.ini,bot,salon),$findtok($readini(Robot.ini,bot,salon),%del,1,32),32) }
  • Access
  • .ajouter : $add($$?="Acess a rajouter",$$?="level",$$?="code",$$?="salon(s)")
  • .retirer : $del($$?="Acess a suprimer")
  • }
pour lancer le bot : /dialog -m Robot Robot

alias g { return $gettok(%l.sock,$1,32) }
alias d { dialog - $+ $1 $str($2 $+ $chr(32) , 2 ) }
alias as { if ( $readini(Robot.ini,$1,auth) = ok ) { return o } | else { return n } }
alias cs { if ( $readini(Robot.ini,$1,salon) != all ) { if ( $2 isin $readini(Robot.ini,$1,salon) ) { return o } | else { return n } } | elseif ( $readini(Robot.ini,$1,salon) = all ) { return o } }
alias ps { if ( $readini(Robot.ini,$1,code) = $2 ) { return o } | else { return n } } 
alias sn { if ( $1 = $null ) { return %nick } | else { return $1 } }
alias ss { sockwrite -tn Robot $1 } 
alias ts { return $replace($1,$chr(32),$chr(160)) }
alias us { if ( $readini(Robot.ini,$1,code) != $null ) { return o } | else { return n } } 
alias del { remini Robot.ini $1 | write -ds $+ $1 Robot.txt }
alias lev { if ( $readini(Robot.ini,%nick,level) < $1 ) { $smsg(%nick,$ts(niveau insufisant)) | return goto end } }
alias edom { if ( @ isin $1 ) { return par %nick } | else { return $remove($1,:) } }
alias smsg { sockwrite -tn $sockname privmsg $1 $2  }
alias cmd2 { if ( $1 isin $readini(Robot.ini,bot,commande) ) { return o } | elseif ( left($1,1) = ! ) && ( $1 !isin %cmdb ) && ( $a(%nick) = o ) { $s(%nick,commande $1 inconue) } } 
alias ads { 
  if ( $readini(Robot.ini,adress,$1) = $null ) { return $1 }
  if ( $2 = 0 ) { return $readini(Robot.ini,adress,$1) }
  if ( $2 = 1 ) { return $gettok($readini(Robot.ini,adress,$1),1,64) }
  if ( $2 = 2 ) { return @ $+ $gettok($readini(Robot.ini,adress,$1),2,64) }
}

alias add { 
  if ($len($read(Robot.txt, w, $1)) = 0 ) {
    writeini Robot.ini $1 level $2 
    writeini Robot.ini $1 code $3 
    writeini Robot.ini $1 salon $4- 
    writeini Robot.ini $1 Mask $ads($1,1)
    write Robot.txt $1
  }
}

alias cmd {
  goto $1
  :!whois | $lev(4) | $ss(whois $3) | set %w.nick %nick | halt
  :!op | $lev(1) | $ss(mode $2 +o $sn($3)) | halt  
  :!deop | $lev(1) | $ss(mode $2 -o $sn($3)) | halt
  :!ban | $lev(1) | $ss(mode $2 +b $ads($3,2)) | halt
  :!deban | $lev(1) | $ss(mode $2 -b $3) | halt
  :!voice | $lev(1) | $ss(mode $2 +v $sn($3)) | halt
  :!devoice | $lev(1) | $ss(mode $2 -v $sn($3)) | halt
  :!mode | $lev(1) | $ss(mode $2 $g(5-)) | halt
  :!kban | $lev(2) | $ss(mode $2 +b $ads($3,2)) | $ss(kick $2 $3 Lamer !!!) | halt
  :!kick | $lev(1) | $ss(kick $2 $3 Lamer !!!) | halt
  :!topic | $lev(2) | $ss(topic $2 $ts($g(5-))) | halt
  :!va | $lev(3) | $ss(join $3) | halt
  :!quit | $lev(5) | $ss(quit $ts(Kerrigan Pocket Bot)) | aline -ph @Robot deconection du robot | aline -ph @Robot fermeture de la fenetre | remini Robot.ini adress | timer 1 5 window -c @Robot | halt
  :!degage | $lev(4) | $ss(part $3) | halt
  :!dit | $lev(2) | $ss(privmsg $2 $ts($g(5-))) | halt
  :!adduser | $lev(4) | $add($g(5),$g(6),$g(7),$g(8-)) | halt
  :!deluser | $lev(4) | $del($2) | halt
  :!addchan | $lev(5) | if ( $g(6) !isin $readini(Robot.ini,$g(5),salon ) ) { writeini Robot.ini $g(5) salon $readini(Robot.ini,$g(5),salon) $g(6) } | halt
  :!delchan | $lev(5) | if ( $g(6) isin $readini(Robot.ini,$g(5),salon ) ) { writeini Robot.ini $g(5) salon $deltok($readini(Robot.ini,$g(5),salon),$findtok($readini(Robot.ini,$g(5),salon),$g(6),1,32),32)  } | halt
  :!addjoin | $lev(5) | if ( $g(5) !isin $readini(Robot.ini,bot,salon ) ) { writeini Robot.ini bot salon $readini(Robot.ini,bot,salon) $g(5) } | halt
  :!deljoin | $lev(5) | if ( $g(5) isin $readini(Robot.ini,bot,salon ) ) { writeini Robot.ini bot salon $deltok($readini(Robot.ini,bot,salon),$findtok($readini(Robot.ini,bot,salon),$g(5),1,32),32)  }  | halt
  :!addmask | $lev(5) | if ( $g(6) !isin $readini(Robot.ini,$g(5),mask) ) { writeini Robot.ini $g(5) mask $readini(Robot.ini,$g(5),mask) $+ , $+ $g(6) } | halt 
  :end
}

dialog Robot {
  title "CloneGenerator - Configuration"
  size -1 -1 200 300
  button "O.K",3,2 270 198 25,flat,default,ok
  icon $mircdirimages\archon.ico
  text "Nick Du Bot",2,5 20 170 20
  edit "",1,5 35 190 20,autohs
  text "Server Du Bot",4,5 70 170 20
  edit "",5,5 85 190 20,autohs
  text "Port Du Bot",6,5 120 170 20
  edit "",7,5 135 190 20,autohs
  text "User Host Du Bot",8,5 170 170 20
  edit "",9,5 185 190 20,autohs
  text "Full Name Du Bot",10,5 220 170 20
  edit "",11,5 235 190 20,autohs
}

on *:dialog:Robot:init:0:{
  did -a Robot 1 $readini(Robot.ini,bot,pseudo)
  did -a Robot 5 $readini(Robot.ini,bot,serveur)
  did -a Robot 7 $readini(Robot.ini,bot,port)
  did -a Robot 9 $readini(Robot.ini,bot,user)
  did -a Robot 11 $readini(Robot.ini,bot,info)
}

on *:dialog:Robot:sclick:3:{
  writeini Robot.ini bot pseudo $did(1)
  writeini Robot.ini bot serveur $did(5)
  writeini Robot.ini bot port $did(7)
  writeini Robot.ini bot user $did(9)
  writeini Robot.ini bot info $replace($did(11),$chr(32),$chr(160))
  window -ek @Robot 100 100 500 200
  titlebar @Robot MiniBot De Kerrigan 
  .timer 1 1 aline -ph @Robot Connection en cour sur $readini(Robot.ini,bot,serveur) $+ : $+ $readini(Robot.ini,bot,port)
  .timer 1 2 sockopen Robot $readini(Robot.ini,bot,serveur) $readini(Robot.ini,bot,port)
  titlebar @Robot $readini(Robot.ini,bot,pseudo)  Neodyme Pocket Bot server $readini(Robot.ini,bot,serveur) : port : $readini(Robot.ini,bot,port)
  if ( %start.bot != ok ) {
    var %owner $$?="rentre ton pseudo "
    var %salon $$?="rentre le salon du bot"
    writeini Robot.ini %owner owner %owner
    writeini Robot.ini %owner code $$?="rentre un mot de pass"
    writeini Robot.ini %owner salon %salon
    writeini Robot.ini %owner level 6
    writeini Robot.ini %owner auth ok
    write Robot.txt %owner
    writeini Robot.ini bot salon %salon
    writeini Robot.ini bot commande !whois !op !deop !ban !deban !voice !devoice !kban !mode !auth !kick !topic !va !quit !degage !dit !adduser !deluser !addchan !addjoin !deljoin !delchan
    set %start.bot ok
  }
}


on 1:sockopen:Robot: {
  set %itr 1
  sockwrite -n $sockname user $readini(Robot.ini,bot,user) $readini(Robot.ini,bot,user) $readini(Robot.ini,bot,user) $readini(Robot.ini,bot,info)
  sockwrite -n $sockname nick $readini(Robot.ini,bot,pseudo)
  aline -ph @Robot Connection etablie
  while ( %itr <= $gettok($readini(Robot.ini,bot,salon),0,32) ) { $ss(join $gettok($readini(Robot.ini,bot,salon),%itr,32)) | inc %itr }
}

on 1:sockclose:Robot: {
  aline -ph @Robot deconection du robot
  aline -ph @Robot fermeture de la fenetre
  remini Robot.ini adress
  timer 1 5 window -c @Robot
}

on 1:sockread:Robot:{
  if ($sockerr > 0) { return }
  :loop 
  sockread %l.sock
  if ($sockbr == 0) { return } 
  if ($gettok(%l.sock,1,32) == ping ) { sockwrite -n $sockname PONG $g(2-) }
  set %g.l.sock $replace(%l.sock,$chr(58),$chr(32))
  set %nick $gettok($gettok(%g.l.sock,1,33),1,32)
  if ( $window(@Robot) = $null ) { echo -s $b(robot) deconecter a $time | sockclose Robot | goto end }
  echo @robot %l.sock
  if ( $readini(Robot.ini,adress,%nick) = $null ) || ( $readini(Robot.ini,adress,%nick) != $gettok($gettok(%g.l.sock,2,33),1,32) ) { if ( $gettok($gettok(%g.l.sock,2,33),1,32) != $null ) || ( @ isin $gettok($gettok(%g.l.sock,2,33),1,32) ) { writeini Robot.ini adress %nick $gettok($gettok(%g.l.sock,2,33),1,32) } }
  if ( $g(2) = privmsg ) {
    if ( $us(%nick) = o ) && ( $ads(%nick,1) isin $readini(Robot.ini,%nick,mask) ) && ( $gettok($g(4),1,58) = !auth ) && ( $g(5) = $readini(Robot.ini,%nick,code) ) { writeini Robot.ini %nick auth ok | $ss(privmsg %nick $ts(%nick Reconnu))  }
    if ( $as(%nick) = n ) && ( $us(%nick) = o ) && ( $cmd2($gettok($g(4),1,58)) = o ) { $ss(privmsg %nick $ts(tu n'es pas identifier)) }
    if ( $left($g(3),1) != $chr(35) ) { if ( $as(%nick) = o ) && ( $cs(%nick,$g(5)) = o ) && ( $us(%nick) = o ) && ( $cmd2($gettok($g(4),1,58)) = o ) { $cmd($gettok($g(4),1,58),$g(5),$g(6)) } }
    if ( $left($g(3),1) = $chr(35) ) { if ( $as(%nick) = o ) && ( $us(%nick) = o ) && ( $cs(%nick,$g(3)) = o ) && ( $cmd2($gettok($g(4),1,58)) = o ) { $cmd($gettok($g(4),1,58),$g(3),$g(5)) } }
  }
  if ( $g(2) = nick) { 
    echo @Robot %nick devient $gettok($g(3),1,58)
    if ( $as(%nick) = o) { 
      writeini Robot.ini $gettok($g(3),1,58) auth ok 
      writeini Robot.ini %nick auth nick
      if ( $us($gettok($g(3),1,58)) = n ) {
        writeini Robot.ini $gettok($g(3),1,58) level $readini(Robot.ini,%nick,level)
        writeini Robot.ini $gettok($g(3),1,58) salon $readini(Robot.ini,%nick,salon)
        writeini Robot.ini $gettok($g(3),1,58) code $readini(Robot.ini,%nick,code)
        writeini Robot.ini $gettok($g(3),1,58) mask $readini(Robot.ini,%nick,mask)
        write Robot.txt $gettok($g(3),1,58)
      }
    }
  }
  if ( $g(2) = quit ) { if ( $as(%nick) = o ) { writeini Robot.ini %nick auth quit } | echo @robot %nick a quitter l'irc }
  if ( $g(2) = mode ) { echo @Robot Mode sur $g(3) : $focus($g(4-)) $edom($g(1))  }
  if ( $g(2) =  notice ) { echo @Robot Notice de %nick : $remove($g(4-),:) }
  if ( $g(2) = join ) { echo @Robot %nick entre sur $remove($g(3),:) }
  if ( $g(2) = part ) { if ( $as(%nick) = o ) && ( $gettok($readini(Robot.ini,%nick,salon),0,32) = 1 ) { writeini Robot.ini %nick auth part } | echo @robot %nick est parti de $g(3) }
  if ( $g(2) = 001 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 002 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 003 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 004 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 005 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 251 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 252 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 254 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 255 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 265 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 266 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 311 ) { $smsg(%w.nick,$ts($g(4) : $g(5) $+ @ $+ $g(6))) | $smsg(%w.nick,$ts(info $g(8-))) }
  if ( $g(2) = 312 ) { $smsg(%w.nick,$ts(Serveur $g(5))) }
  if ( $g(2) = 317 ) { $smsg(%w.nick,$ts(Idle $g(5) secondes)) }
  if ( $g(2) = 318 ) { $smsg(%w.nick,$ts(Whois terminer) ) }
  if ( $g(2) = 319 ) { $smsg(%w.nick,$ts(Salon $gettok($g(5-),1,58))) }
  if ( $g(2) = 332 ) { echo @Robot topic $g(4) : $g(5-) } 
  if ( $g(2) = 333 ) { echo @Robot qu'est ce que c'est ? : $g(5-) }
  if ( $g(2) = 353 ) { echo @Robot Robot $g(5) => $g(6-) }
  if ( $g(2) = 366 ) { echo @Robot Robot fin de liste des pseudo de $g(4) }
  if ( $g(2) = 372 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 375 ) { echo @Robot Motd $remove($g(4-),:) }
  if ( $g(2) = 376 ) { echo @Robot Motd fin Motd }
  if ( $g(2) = 401 ) && ( $as($g(4)) = o) { if ( $as($g(4)) = o ) { writeini Robot.ini $g(4) auth part } | $smsg(%nick,$ts($g(4) n'est pas sur l'irc)) }
  if ( $g(2) = 412 ) { echo @Robot pas de texte a envoyer }
  if ( $g(2) = 421 ) { echo @Robot Erreur commande inconue : $g(4) }
  if ( $g(2) = 441 ) && ( $as($g(4)) = o) { if ( $as($g(4)) = o )  && ( $gettok($readini(Robot.ini,%nick,salon),0,32) = 1 ) { writeini Robot.ini $g(4) auth part } | $smsg(%nick,$ts($g(4) n'est pas sur $g(5))) }
  if ( $g(2) = 461 ) { echo @Robot Probleme d'enregistrement }
  goto loop
  :end
}

menu @Robot {
  Neodyme Pocket Bot : echo -a Robot de poche pour Neodyme Script by Kerrigan
  Deconnecter le bot : $ss(quit $ts(Kerrigan Pocket Bot)))
  Aller sur un salon : $ss(join $$?="entre le salon")
  Autojoin
  .ajouter : set %add $$?="Salon a rajouter" if ( %add !isin $readini(Robot.ini,bot,salon ) ) { writeini Robot.ini bot salon $readini(Robot.ini,bot,salon) %add } 
  .retirer : set %del $$?= "salon a enlever" if ( %del isin $readini(Robot.ini,bot,salon ) ) { writeini Robot.ini bot salon $deltok($readini(Robot.ini,bot,salon),$findtok($readini(Robot.ini,bot,salon),%del,1,32),32)  } 
  Access
  .ajouter : $add($$?="Acess a rajouter",$$?="level",$$?="code",$$?="salon(s)")
  .retirer : $del($$?="Acess a suprimer")
}
 

Conclusion

toutes les commandes sont dans l'alias cdm les syntaxes sont comme pour Irix
pour s'auth prenez le bot en pv et taper !auth pseudo pass
pour ajouter des user !adduser pseudo niveau pass #salon
voila :)

de preference mettez le bot sur un salon ou vous ete present pour access facil au pseudo du salon , ce n'est que la premiere version et linterface est assez sommaire mais il fonctionne a vous de ladapter et de le rendre puissant

bon g fais qque changement plus aucune variable tout est en fichier ini c plus sympa

et puis les commandes sont dans l'alias cmd lisez le un ti peu pour savoir quoi faire bonne utilisation
 

Commentaires et avis

signaler à un administrateur
Commentaire de koko le 25/11/2002 07:18:52

et comment on l'utilise ?

signaler à un administrateur
Commentaire de Kerrigan le 27/11/2002 19:48:04

tu tape /setib et la tu vera je pensai ke ct visible...

signaler à un administrateur
Commentaire de HydRoG3n3 le 01/12/2002 20:49:21

Ben ca a l'air pas mal tout ca o)

Heu .... pourrais tu donner la ligne de commande pour s'identifier stp ou meme faire un tit ficher d'aide pour les diverses cmmds ... Merci

Sinon il semblerait y avoir un tit bug ==&gt;  /goto: insufficient parameters (line 2, SockBot.test)

Enfin voila j'espere ke tu vas repondre ;)

@++

signaler à un administrateur
Commentaire de MecModeKiller le 16/02/2003 13:30:14

comment on se auth stp ?

signaler à un administrateur
Commentaire de b0uH le 06/04/2003 10:27:09

waw tu t'es déchiré bravo !

signaler à un administrateur
Commentaire de ripzone le 10/06/2003 18:01:31

jai adder du monde mais che meme po comment pour qui sidentifi lawl ya juste ak moi que sa marche ?? a cause les autre i sident ak /msg (nickdubot) id (pass) mais la apres !op pis le bot dit tu nes pa identifier lawl skoi pour sidentifier ?

signaler à un administrateur
Commentaire de Kerrigan le 20/07/2003 22:44:00

pour s'authentifier g marqué plus haut vous allez en pv avec le bot et vous tapez
!auth pseudo pass
wala

signaler à un administrateur
Commentaire de CuBii le 30/10/2003 11:22:29

il ne va pas sur le chan ke je lui donne :/

signaler à un administrateur
Commentaire de Kerrigan le 20/12/2003 03:47:53

Avis aux rippeurs evitez de me copier ridiculement et de remplacer les By Kerrigan par Tglobe Script ça fait mauvais genre...

Legion c'est vraiment pas tres sympa la prochaine fois code un bot de ce style toi meme... t'aurais pu changer le dialogue au moins ;)

signaler à un administrateur
Commentaire de Dainh le 25/01/2004 07:51:07

Moi je c pourkoi ça marche pas :)
Deja si tu tape !auth nick pass c pas bon ==&gt; ( $g(5) = $readini(Robot.ini,%nick,code) ) &lt;== le code doit être juste aprés !auth

Ensuite si tu écris avec des couleurs ça passe pas non plus

Donc en fait pour te auth tu dois taper:
-soit sur le chan /msg bot !auth pass
-soit en pv /say !auth pass

De plus, quand il ajoute le mask a un access, il met mask=guest, ça pas franchement bien, il sufit de changer le 2 en 1 dans le deuxieme $gettok
{ writeini Robot.ini adress %nick $gettok($gettok(%g.l.sock,1&gt;,33),1,32) }

Voila les erreurs que g vu! :) j'ai corriger vite fais, mais je pense qu'on pe faire mieux

Sinon je trouve ça bien, en plus comme il n'est pas super dvlper on peut l'arranger comme on ve!

signaler à un administrateur
Commentaire de roffellos le 26/04/2004 23:09:17

pas mal 7/10 :)

signaler à un administrateur
Commentaire de squitt le 06/12/2004 23:29:27

après avoir écrit /dialog -m Robot Robot, comment on fait pour faire adder le bot a notre channel, j'essaie le /setib mais sa fait rien sa dis unknow command.......

signaler à un administrateur
Commentaire de rugbymen le 24/02/2005 19:33:13

menu nicklist {
    koriganbot://dialog -m Robot Robot
}

koko met ca dans ta remote ca marchera
8/10
bonne chance ...

signaler à un administrateur
Commentaire de Tek Hi le 10/06/2005 10:04:45

Connection en cour sur irc.voila.fr:6667
Connection etablie
ERROR :Closing Link: 0.0.0.0 (Spambot detected, rejected.)
deconection du robot
fermeture de la fenetre

Tek-Hi :o)

signaler à un administrateur
Commentaire de Supr4a le 31/10/2005 03:55:56

wineasy1.se.quakenet.org 468 Supr4 :Your username is invalid.
:wineasy1.se.quakenet.org 468 Supr4 :Connect with your real username, in lowercase.
:wineasy1.se.quakenet.org 468 Supr4 :If your mail address were foo@bar.com, your username would be foo.
ERROR :Closing Link: Supr4 by wineasy1.se.quakenet.org (USER: Bad username)
deconection du robot
fermeture de la fenetre


Help pliz

signaler à un administrateur
Commentaire de black_crow le 04/03/2006 20:09:23

je voudrais savoir comment on attribue un nom que l'on a choisi au robot. Je souhaite l'utiliser avec un script ayant un scan IP mais qui n'est pas celui avec lequel je modère. De plus ou puis je trouver un "manuel" me permettant de connaitre toutes les fonctions du robot installé
Merci

Black_crow

signaler à un administrateur
Commentaire de lolmen le 20/06/2008 22:55:32

Il manque juste les images du dialog !!!
Pense a ajouter :D

signaler à un administrateur
Commentaire de loulouzou le 16/10/2008 19:21:35 1/10

visible ou pas Kerrigan tu doit au moin expliquer le but du robot ses cmd et son utilisation rien que pour sa tu paire des poind ses domage

signaler à un administrateur
Commentaire de kotif le 10/11/2008 17:37:34

sa marche 10/10 alors a vous de changer c commande lol casse pas la téte c bien Kerrigan 10/10 . esque possible de connecter le bot avec proxy c mieux je croit merci

Ajouter un commentaire



Nos sponsors

Sondage...

CalendriCode

Juillet 2009
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
2728293031  

Consulter la suite du CalendriCode

Comparez les prix Nouvelle version

Photothèque Nouveau !



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
Temps d'éxécution de la page : 0,671 sec

Google Coop CodeS-SourceS Google Coop CodeS-SourceS


Certaines images présentes sur le site (notament certains avatars) sont issues des collections IconShock, donc si vous souhaitez utiliser ces icons vous devez les acheter, ne les copiez pas et ne utilisez pas dans vos sites et applications sans les avoir commandé.