Accueil > > > ROBOT INTEGRER A VOTRE SCRIPT EN SOCKET
ROBOT INTEGRER A VOTRE SCRIPT EN SOCKET
Information sur la source
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
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
TECHDAYS PARIS 2012 : SYSTEM CENTER SERVICE MANAGER 2012 VUE D'ENSEMBLETECHDAYS PARIS 2012 : SYSTEM CENTER SERVICE MANAGER 2012 VUE D'ENSEMBLE par ROMELARD Fabrice
Speakers: Julien Marechal, Gautier Confiant, Sébastien MEYER La session débute par le positionnement de la solution System Center par rapport aux concepts d'organisation ITIL. Le portail du catalogue de se...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2012 : PLEINIèRE SECOND JOURTECHDAYS PARIS 2012 : PLEINIèRE SECOND JOUR par ROMELARD Fabrice
Après une première journée dédiée aux développeurs, cette seconde journée est dédiée au monde des entreprises et de ses applications. Ainsi, cette pleinière est dédiée à faire un 360 de l'évolution des applications Business aux demandes ac...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2012 : RETOUR D'EXPéRIENCE SUR LA MISE EN PLACE D'UN CLOUD PRIVéTECHDAYS PARIS 2012 : RETOUR D'EXPéRIENCE SUR LA MISE EN PLACE D'UN CLOUD PRIVé par ROMELARD Fabrice
Speaker : Guillaume Rochette Cette session est dédiée à fournir le retour sur la mise en place d'un cloud privé (IaaS) par Osiatis pour son compte ou celui de ses clients. Ce projet s'est déroulé sur 4 mois et a permis de faire évoluer...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2012 : COMMENT SHAREPOINT A SAUVé MES TECHDAYSTECHDAYS PARIS 2012 : COMMENT SHAREPOINT A SAUVé MES TECHDAYS par ROMELARD Fabrice
Speakers : Lionel Limozin et Alain Marty La session commence par une découverte de SharePoint à travers la mise en place d'un environnement SharePoint pour la gestion des Sessions animées par BeWise. Le besoin est très ba...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice PERSPECTIVE 3.0 POUR SILVERLIGHT 5.0PERSPECTIVE 3.0 POUR SILVERLIGHT 5.0 par odewit
Je viens de publier la version 3.0 de Perspective pour Silverlight, qui regroupe un portage sous Silverlight 5.0 des fonctionnalités de Perspective 2.0, le framework 3D de haut-niveau introduit récemment et de nouveaux exemples de code. En voici la li...
Cliquez pour lire la suite de l'article par odewit
Forum
RE : AIDERE : AIDE par Nico26000
Cliquez pour lire la suite par Nico26000 RE : AIDERE : AIDE par WorldDMT
Cliquez pour lire la suite par WorldDMT AIDEAIDE par Nico26000
Cliquez pour lire la suite par Nico26000
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|