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
ENUMERABLECOLLECTIONENUMERABLECOLLECTION par Matthieu MEZIL
Prenons le scénario suivant. On utilise MVVM. On a les deux classes suivantes dans le model : public class Child { } public class Parent { private ObservableCollection < Child > _children; public ObservableCollection < Child > Children { get {...
Cliquez pour lire la suite de l'article par Matthieu MEZIL [HS] CHROME 6 + MOI = COUP DE GUEULE ![HS] CHROME 6 + MOI = COUP DE GUEULE ! par JeremyJeanson
Attention, le poste qui suit n'est pas la complainte d'une personne : Qui n'aime pas Chrome. D'un anti Google. D'un développeur qui a un poil énorme dans la main. Ceux qui me fréquentent savent que je change de navigateur favori tous les 2 ou 3 mois afin ...
Cliquez pour lire la suite de l'article par JeremyJeanson [WP7] UTILISER UN WRAPPANEL DANS UNE APPLICATION WINDOWS PHONE 7[WP7] UTILISER UN WRAPPANEL DANS UNE APPLICATION WINDOWS PHONE 7 par Audrey
Lors de la réalisation de ma 2ème application Windows Phone 7, j'ai souhaité utiliser un WrapPanel pour afficher plusieurs photos. Mais le contrôle WrapPanel ne fait pas parti de la liste des contrôles inclus dans le SDK de la version Beta des outils pour...
Cliquez pour lire la suite de l'article par Audrey [WP7] BESOIN D'AVOIR DES DONNéES EN CACHE[WP7] BESOIN D'AVOIR DES DONNéES EN CACHE par Nicolas
Les développeurs ASP.NET ont l'habitude de mettre des données en cache pour éviter de requêter a chaque fois la base de données. Et il est toujours utilie de penser que vos utilisateurs mobiles n'ont pas troujours une super connexion 3G/WIFI et un for...
Cliquez pour lire la suite de l'article par Nicolas [TFS] COMMENT FORCER LA SAISIE D'UN AREA OU ITERATION[TFS] COMMENT FORCER LA SAISIE D'UN AREA OU ITERATION par cyril
Lorsque l'on créé un Work Item dans TFS, il est possible de le classer dans un "area" et dans une "iteration". Dans la plupart des types de projet, un "area" correspond à une catégorie, une "iteration" à un numéro de version. Il est possible de cré...
Cliquez pour lire la suite de l'article par cyril
Logiciels
Bureau de Gestion - ERP Devis Facturation (2.02)BUREAU DE GESTION - ERP DEVIS FACTURATION (2.02)
- Version gratuite du 10/06/2010
Le Bureau de Gestion est un logiciel dédié à la gestion de l'en...
Cliquez pour télécharger Bureau de Gestion - ERP Devis Facturation sDEVIS-FACTURES vlPRO (3.8.0)SDEVIS-FACTURES VLPRO (3.8.0)sDEVIS-FACTURES vlPRO a été mis au point pour permettre besoins des particuliers, créateurs, entr... Cliquez pour télécharger sDEVIS-FACTURES vlPRO LettresFaciles (5.6.0)LETTRESFACILES (5.6.0)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles MyPlanning 2010 (5.6.0)MYPLANNING 2010 (5.6.0)MyPlanning 2010 permet de créer des plannings sous la représentation de diagrammes. Plannings pré... Cliquez pour télécharger MyPlanning 2010 Emicsoft Mac DVD en iPad Convertisseur (3.1.16)EMICSOFT MAC DVD EN IPAD CONVERTISSEUR (3.1.16)Emicsoft Mac DVD en iPad Convertisseur, logiciel professionnel de convertir les fichiers DVD en i... Cliquez pour télécharger Emicsoft Mac DVD en iPad Convertisseur
|