|
Trouver une ressource
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 !
SOCKBOT (SNIPPET)
Information sur la source
Description
Toujours dans ma ligné de petits snippets, voici un "Sockbot" robot en sockets se connectant sur un serveur irc. Les commandes principales sont placées dans un dialog et les informations de connection sont enregistrées dans des hashtables. Comme le titre l'énonce, ceci est un snippet donc libre à vous de le modifier (améliorer!! :p) et heu comme dhabitude, comme le code est coupé lors du post sur ce site, je vous fourni une url où vous trouverez la code non coupé:
http://membres.lycos.fr/xdbconcept/scripting/socker.txt
Ainsi qu'un screen de ce que donne le dialog:
http://membres.lycos.fr/xdbconcept/scripting/socker.PNG
Source
- menu * {
- Sockbot:/socker
- }
- alias socker dialog -m socker socker
- dialog socker {
- title "Sockbot"
- size -1 -1 135 85
- option dbu
- tab "Connection", 1,2 1 130 80
- tab "Commandes", 2,3 1 130 80
- tab "About", 3,3 1 130 80
- text "Server:", 4, 10 19 25 10, tab 1
- text "Nick:", 5, 10 30 27 10, tab 1
- edit "" 6,47 19 80 10, autohs limit 900 tab 1
- edit "" 7,47 30 60 10, autohs limit 900 tab 1
- text "Port:" 8,10 41 25 10, tab 1
- edit "" 9, 47 41 40 10, autohs limit 900 tab 1
- button "Connecter", 10,10 52 50 10, flat tab 1
- button "Déconnecter", 11,75 52 50 10, flat tab 1
- button "Fermer", 12, 50 65 35 10, flat cancel tab 1
- text "Robot en sockets by tofu\\" 13,5 20 90 8, tab 3 nowrap disable
- text "Remerciements à kenji pour l'identifieur $_sockerr" 14, 5 30 120 8, tab 3 nowrap disable
- text "Contacts:" 15,5 40 30 8, tab 3 nowrap disable
- link "FreKi@eXagon.org" 16, 5 50 50 8, tab 3
- link "http://www.Xdb-Project.ft.tc" 17, 5 60 80 8, tab 3
- button "Join", 18, 5 20 20 10, flat tab 2
- button "Part", 19, 30 20 20 10, flat tab 2
- button "Hop", 20, 55 20 20 10, flat tab 2
- button "Msg", 21, 80 20 20 10, flat tab 2
- button "Notice", 22, 105 20 20 10, flat tab 2
- button "Kick", 23, 5 35 20 10, flat tab 2
- button "Nick", 24, 30 35 20 10, flat tab 2
- button "Voice", 25, 55 35 20 10, flat tab 2
- button "Devoice", 26, 79 35 23 10, flat tab 2
- button "Op", 27, 105 35 20 10, flat tab 2
- button "Deop", 28, 5 50 20 10, flat tab 2
- button "Whois", 29, 30 50 20 10, flat tab 2
- }
-
- on *:DIALOG:socker:*:*:{
- if ($devent == init) { if (!$hget(socker)) { hmake socker } }
- if ($devent == close) { if ($hget(socker)) { hfree socker } }
- if ($devent == edit) {
- if ($did == 6) { hadd socker server $did($dname,6) }
- if ($did == 7) { hadd socker nick $did($dname,7) }
- if ($did == 9) { hadd socker port $did($dname,9) }
- }
- if ($devent == sclick) {
- if ($did == 10) { sockbot | window -ake @Socker }
- if ($did == 11) { sockwrite -n socker QUIT $+(Socker,$chr(160),v0.1,$chr(160),by,$chr(160),tofu\\) }
- if ($did == 16) { run mailto:FreKi@eXagon.org }
- if ($did == 17) { run iexplore http://www.xdb-project.fr.tc }
- if ($did == 18) { sockwrite -n socker join $?="Entrez un canal:(n'oubliez pas le #)" $+ $crlf }
- if ($did == 19) { sockwrite -n socker part $?="Entrez un canal:(n'oubliez pas le #)" $+ $crlf }
- if ($did == 20) { sockwrite -n socker part $?="Entrez un canal:(n'oubliez pas le #)" | sockwrite -n socker join $! }
- if ($did == 21) { sockwrite -n socker privmsg $?="Entrez un canal:(n'oubliez pas le #)" : $+ $?="Entrez le phrase à dire:" $+ $crlf }
- if ($did == 22) { sockwrite -n socker notice $?="Entrez un pseudo" : $?="Entrez la phrase à dire" $+ $crlf }
- if ($did == 23) { sockwrite socker kick $?="Entrez un canal:(n'oubliez pas le #)" $?="Entrez un pseudo:" : $+ $?="Entrez une raison: (Vous pouvez laisser vierge si aucune raison)" $+ $crlf }
- if ($did == 24) { sockwrite -n socker nick $?="Entrez un pseudo:" $+ $crlf }
- if ($did == 25) { sockwrite -n socker mode $?="Entrez un canal:(n'oubliez pas le #)" +v $?="Entrez un pseudo:" $+ $crlf }
- if ($did == 26) { sockwrite -n socker mode $?="Entrez un canal:(n'oubliez pas le #)" -v $?="Entrez un pseudo:" $+ $crlf }
- if ($did == 27) { sockwrite -n socker mode $?="Entrez un canal:(n'oubliez pas le #)" +o $?="Entrez un pseudo:" $+ $crlf }
- if ($did == 28) { sockwrite -n socker mode $?="Entrez un canal:(n'oubliez pas le #)" -o $?="Entrez un pseudo:" $+ $crlf }
- if ($did == 29) { sockwrite -n socker whois $?="Entrez un pseudo" $+ $crlf }
- }
- }
-
- alias sockbot { sockclose socker | sockopen socker $hget(socker,server) $hget(socker,port) }
-
- on *:sockopen:socker:{
- if ($sockerr) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Erreur),$c(4,$b($chr(41)))) $_sockerr($sockerr) | return }
- sockwrite -n socker NICK $hget(socker,nick)
- sockwrite -n socker USER Socker Socker Socker :Socker v0.1 by tofu\}
- on *:sockread:socker:{
- var %x
- sockread %x
- tokenize 32 %x
- if ($gettok(%x,1,32) == PING) { sockwrite -n socker PONG $gettok(%x,2,32) | halt }
- if ($gettok(%x,2,32) == :Closing) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Fermeture),$c(4,$b($chr(41)))) $4- | halt }
- if ($gettok(%x,1,32) == NOTICE) && ($gettok(%x,2,32) == AUTH) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $remove($3,:) $4- | halt }
- if ($gettok(%x,2,32) == PRIVMSG) && ($gettok(%x,4,32) == :VERSION) { sockwrite -nt socker NOTICE $remove($gettok(%x,1,$asc(!)),:) :VERSION Socker v0.1 by tofu\\ }
- if ($gettok(%x,2,32) == TOPIC) { echo @Socker $+($c(3,$b($chr(40))),$c(3,/Topic),$c(3,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,3,32),:)),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:)) $c(0,$5-) | halt }
- if ($gettok(%x,2,32) == JOIN) { echo @Socker $+($c(3,$b($chr(40))),$c(3,/Join),$c(3,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,3,32),:)),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:)) $c(0,$5-) | halt }
- if ($gettok(%x,2,32) == MODE) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Mode),$c(7,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,3,32),:)),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:)) $c(0,$5-) | halt }
- if ($gettok(%x,2,32) == PART) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Part),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,3,32),:)),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:)) $c(0,$5-) | halt }
- if ($gettok(%x,2,32) == PRIVMSG) { echo @Socker $+($c(3,$b($chr(40))),$c(3,/Pmsg),$c(3,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,3,32),:)),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:)) $c(0,$5-) | halt }
- if ($gettok(%x,2,32) == NOTICE) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Notice),$c(7,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:) $5-) | halt }
- if ($gettok(%x,2,32) == 001) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 002) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 003) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 004) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 005) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 250) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 251) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 252) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $4 $remove($5,:) $6- | halt }
- if ($gettok(%x,2,32) == 253) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $4 $remove($5,:) $6- | halt }
- if ($gettok(%x,2,32) == 254) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $4 $remove($5,:) $6- | halt }
- if ($gettok(%x,2,32) == 255) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 265) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 266) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 267) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 268) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 304) { echo @Socker $+($c(12,$b($chr(40))),$c(12,/Infos),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 307) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Register: $c(12,cet utilisateur est enregistré) | halt }
- if ($gettok(%x,2,32) == 311) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois de $gettok(%x,4,32)),$c(7,$b($chr(41)))) | echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Adresse: $+($c(12,$gettok(%x,4,32)),$c(12,!),$c(12,$gettok(%x,5,32)),$c(12,@),$c(12,$gettok(%x,6,32))) | echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Nom Complet: $remove($c(12,$8),:) $c(12,$9-) | halt }
- if ($gettok(%x,2,32) == 312) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Server: $c(12,$5 $remove($6-,:)) | halt }
- if ($gettok(%x,2,32) == 317) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Idle: $c(12,$duration($5)) | halt }
- if ($gettok(%x,2,32) == 318) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois de $gettok(%x,4,32)),$c(7,$b($chr(41)))) | halt }
- if ($gettok(%x,2,32) == 319) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Chans: $c(12,$remove($5,:) $6-) | halt }
- if ($gettok(%x,2,32) == 320) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Secure: $c(12,est sous une connection sécurisée) | halt }
- if ($gettok(%x,2,32) == 353) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Names),$c(7,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,5,32),:)),$c(12,$b($chr(41)))) $remove($6,:) $7- | halt }
- if ($gettok(%x,2,32) == 366) { halt }
- if ($gettok(%x,2,32) == 375) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 372) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- if ($gettok(%x,2,32) == 376) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
- echo @Socker %x
- }
- on *:SOCKCLOSE:socker:{ echo @Socker $+($c(4,$b($chr(40))),$c(4,/Fermeture),$c(4,$b($chr(41)))) Socker déconnecté }
-
- alias _sockerr {
- if $$1 == 0 { return aucune erreur }
- elseif $$1 == 1 { return impossible d'interpréter la requête à cause d'une erreur de format }
- elseif $$1 == 2 { return impossible d'exécuter à cause d'une erreur interne du serveur }
- elseif $$1 == 3 { return l'adresse soumise n'existe pas }
- elseif $$1 == 4 { return type de la requête non supporté }
- elseif $$1 == 5 { return demande refusée }
- else { return erreur non documentée }
- }
-
- alias u { return $+($chr(31),$1,$chr(31)) }
- alias b { return $+($chr(2),$1,$chr(2)) }
- alias r { return $+($chr(22),$1,$chr(22)) }
- alias c { return $+($+($chr(3),$1),$2,$chr(3)) }
-
menu * {
Sockbot:/socker
}
alias socker dialog -m socker socker
dialog socker {
title "Sockbot"
size -1 -1 135 85
option dbu
tab "Connection", 1,2 1 130 80
tab "Commandes", 2,3 1 130 80
tab "About", 3,3 1 130 80
text "Server:", 4, 10 19 25 10, tab 1
text "Nick:", 5, 10 30 27 10, tab 1
edit "" 6,47 19 80 10, autohs limit 900 tab 1
edit "" 7,47 30 60 10, autohs limit 900 tab 1
text "Port:" 8,10 41 25 10, tab 1
edit "" 9, 47 41 40 10, autohs limit 900 tab 1
button "Connecter", 10,10 52 50 10, flat tab 1
button "Déconnecter", 11,75 52 50 10, flat tab 1
button "Fermer", 12, 50 65 35 10, flat cancel tab 1
text "Robot en sockets by tofu\\" 13,5 20 90 8, tab 3 nowrap disable
text "Remerciements à kenji pour l'identifieur $_sockerr" 14, 5 30 120 8, tab 3 nowrap disable
text "Contacts:" 15,5 40 30 8, tab 3 nowrap disable
link "FreKi@eXagon.org" 16, 5 50 50 8, tab 3
link "http://www.Xdb-Project.ft.tc" 17, 5 60 80 8, tab 3
button "Join", 18, 5 20 20 10, flat tab 2
button "Part", 19, 30 20 20 10, flat tab 2
button "Hop", 20, 55 20 20 10, flat tab 2
button "Msg", 21, 80 20 20 10, flat tab 2
button "Notice", 22, 105 20 20 10, flat tab 2
button "Kick", 23, 5 35 20 10, flat tab 2
button "Nick", 24, 30 35 20 10, flat tab 2
button "Voice", 25, 55 35 20 10, flat tab 2
button "Devoice", 26, 79 35 23 10, flat tab 2
button "Op", 27, 105 35 20 10, flat tab 2
button "Deop", 28, 5 50 20 10, flat tab 2
button "Whois", 29, 30 50 20 10, flat tab 2
}
on *:DIALOG:socker:*:*:{
if ($devent == init) { if (!$hget(socker)) { hmake socker } }
if ($devent == close) { if ($hget(socker)) { hfree socker } }
if ($devent == edit) {
if ($did == 6) { hadd socker server $did($dname,6) }
if ($did == 7) { hadd socker nick $did($dname,7) }
if ($did == 9) { hadd socker port $did($dname,9) }
}
if ($devent == sclick) {
if ($did == 10) { sockbot | window -ake @Socker }
if ($did == 11) { sockwrite -n socker QUIT $+(Socker,$chr(160),v0.1,$chr(160),by,$chr(160),tofu\\) }
if ($did == 16) { run mailto:FreKi@eXagon.org }
if ($did == 17) { run iexplore http://www.xdb-project.fr.tc }
if ($did == 18) { sockwrite -n socker join $?="Entrez un canal:(n'oubliez pas le #)" $+ $crlf }
if ($did == 19) { sockwrite -n socker part $?="Entrez un canal:(n'oubliez pas le #)" $+ $crlf }
if ($did == 20) { sockwrite -n socker part $?="Entrez un canal:(n'oubliez pas le #)" | sockwrite -n socker join $! }
if ($did == 21) { sockwrite -n socker privmsg $?="Entrez un canal:(n'oubliez pas le #)" : $+ $?="Entrez le phrase à dire:" $+ $crlf }
if ($did == 22) { sockwrite -n socker notice $?="Entrez un pseudo" : $?="Entrez la phrase à dire" $+ $crlf }
if ($did == 23) { sockwrite socker kick $?="Entrez un canal:(n'oubliez pas le #)" $?="Entrez un pseudo:" : $+ $?="Entrez une raison: (Vous pouvez laisser vierge si aucune raison)" $+ $crlf }
if ($did == 24) { sockwrite -n socker nick $?="Entrez un pseudo:" $+ $crlf }
if ($did == 25) { sockwrite -n socker mode $?="Entrez un canal:(n'oubliez pas le #)" +v $?="Entrez un pseudo:" $+ $crlf }
if ($did == 26) { sockwrite -n socker mode $?="Entrez un canal:(n'oubliez pas le #)" -v $?="Entrez un pseudo:" $+ $crlf }
if ($did == 27) { sockwrite -n socker mode $?="Entrez un canal:(n'oubliez pas le #)" +o $?="Entrez un pseudo:" $+ $crlf }
if ($did == 28) { sockwrite -n socker mode $?="Entrez un canal:(n'oubliez pas le #)" -o $?="Entrez un pseudo:" $+ $crlf }
if ($did == 29) { sockwrite -n socker whois $?="Entrez un pseudo" $+ $crlf }
}
}
alias sockbot { sockclose socker | sockopen socker $hget(socker,server) $hget(socker,port) }
on *:sockopen:socker:{
if ($sockerr) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Erreur),$c(4,$b($chr(41)))) $_sockerr($sockerr) | return }
sockwrite -n socker NICK $hget(socker,nick)
sockwrite -n socker USER Socker Socker Socker :Socker v0.1 by tofu\}
on *:sockread:socker:{
var %x
sockread %x
tokenize 32 %x
if ($gettok(%x,1,32) == PING) { sockwrite -n socker PONG $gettok(%x,2,32) | halt }
if ($gettok(%x,2,32) == :Closing) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Fermeture),$c(4,$b($chr(41)))) $4- | halt }
if ($gettok(%x,1,32) == NOTICE) && ($gettok(%x,2,32) == AUTH) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $remove($3,:) $4- | halt }
if ($gettok(%x,2,32) == PRIVMSG) && ($gettok(%x,4,32) == :VERSION) { sockwrite -nt socker NOTICE $remove($gettok(%x,1,$asc(!)),:) :VERSION Socker v0.1 by tofu\\ }
if ($gettok(%x,2,32) == TOPIC) { echo @Socker $+($c(3,$b($chr(40))),$c(3,/Topic),$c(3,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,3,32),:)),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:)) $c(0,$5-) | halt }
if ($gettok(%x,2,32) == JOIN) { echo @Socker $+($c(3,$b($chr(40))),$c(3,/Join),$c(3,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,3,32),:)),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:)) $c(0,$5-) | halt }
if ($gettok(%x,2,32) == MODE) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Mode),$c(7,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,3,32),:)),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:)) $c(0,$5-) | halt }
if ($gettok(%x,2,32) == PART) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Part),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,3,32),:)),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:)) $c(0,$5-) | halt }
if ($gettok(%x,2,32) == PRIVMSG) { echo @Socker $+($c(3,$b($chr(40))),$c(3,/Pmsg),$c(3,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,3,32),:)),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:)) $c(0,$5-) | halt }
if ($gettok(%x,2,32) == NOTICE) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Notice),$c(7,$b($chr(41)))) $+($c(12,$b($chr(40))),$c(4,$remove($gettok(%x,1,32),:)),$c(12,$b($chr(41)))) $c(0,$remove($4,:) $5-) | halt }
if ($gettok(%x,2,32) == 001) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 002) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 003) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 004) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 005) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 250) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 251) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 252) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $4 $remove($5,:) $6- | halt }
if ($gettok(%x,2,32) == 253) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $4 $remove($5,:) $6- | halt }
if ($gettok(%x,2,32) == 254) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $4 $remove($5,:) $6- | halt }
if ($gettok(%x,2,32) == 255) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 265) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 266) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 267) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 268) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 304) { echo @Socker $+($c(12,$b($chr(40))),$c(12,/Infos),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 307) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Register: $c(12,cet utilisateur est enregistré) | halt }
if ($gettok(%x,2,32) == 311) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois de $gettok(%x,4,32)),$c(7,$b($chr(41)))) | echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Adresse: $+($c(12,$gettok(%x,4,32)),$c(12,!),$c(12,$gettok(%x,5,32)),$c(12,@),$c(12,$gettok(%x,6,32))) | echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Nom Complet: $remove($c(12,$8),:) $c(12,$9-) | halt }
if ($gettok(%x,2,32) == 312) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Server: $c(12,$5 $remove($6-,:)) | halt }
if ($gettok(%x,2,32) == 317) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Idle: $c(12,$duration($5)) | halt }
if ($gettok(%x,2,32) == 318) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois de $gettok(%x,4,32)),$c(7,$b($chr(41)))) | halt }
if ($gettok(%x,2,32) == 319) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Chans: $c(12,$remove($5,:) $6-) | halt }
if ($gettok(%x,2,32) == 320) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Whois),$c(7,$b($chr(41)))) Secure: $c(12,est sous une connection sécurisée) | halt }
if ($gettok(%x,2,32) == 353) { echo @Socker $+($c(7,$b($chr(40))),$c(7,/Names),$c(7,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $+($c(12,$b($chr(40))),$u($remove($gettok(%x,5,32),:)),$c(12,$b($chr(41)))) $remove($6,:) $7- | halt }
if ($gettok(%x,2,32) == 366) { halt }
if ($gettok(%x,2,32) == 375) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 372) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
if ($gettok(%x,2,32) == 376) { echo @Socker $+($c(4,$b($chr(40))),$c(4,/Server),$c(4,$b($chr(41)))) $+($c(12,$b($chr(40))),$remove($gettok(%x,1,32),:),$c(12,$b($chr(41)))) $remove($4,:) $5- | halt }
echo @Socker %x
}
on *:SOCKCLOSE:socker:{ echo @Socker $+($c(4,$b($chr(40))),$c(4,/Fermeture),$c(4,$b($chr(41)))) Socker déconnecté }
alias _sockerr {
if $$1 == 0 { return aucune erreur }
elseif $$1 == 1 { return impossible d'interpréter la requête à cause d'une erreur de format }
elseif $$1 == 2 { return impossible d'exécuter à cause d'une erreur interne du serveur }
elseif $$1 == 3 { return l'adresse soumise n'existe pas }
elseif $$1 == 4 { return type de la requête non supporté }
elseif $$1 == 5 { return demande refusée }
else { return erreur non documentée }
}
alias u { return $+($chr(31),$1,$chr(31)) }
alias b { return $+($chr(2),$1,$chr(2)) }
alias r { return $+($chr(22),$1,$chr(22)) }
alias c { return $+($+($chr(3),$1),$2,$chr(3)) }
Conclusion
En espérant que ce code aidera certains d'entre vous, pour de plus amples informations, vous avez mon mail dans le dialog ;)
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Comparez les prix Nouvelle version
|