All pastes #368233 Raw Edit

Untitled

public text v1 · immutable
#368233 ·published 2007-02-22 22:46 UTC
rendered paste body
; Telnet multi-client - par Averell (p.chevee@libertysurf.fr)

on 1:sockread:telnet*:{ if ( $sockerr == 0 ) { sockread %temp
if ( %temp != $null ) aline -ph 1 @ $+ $sockname %temp
; if ( %temp != $null && $active != @ $+ $sockname ) echo 6 -a %temp
}
}
on 1:sockclose:telnet*:aline -ph 4 @ $+ $sockname Session Telnet interrompue | titlebar @ $+ $sockname déconnecté

on 1:input:@Telnet*:{
%temp = $gettok($active,1,58) | %temp = $right(%temp,$calc($len(%temp)-1))
if ( $sock(%temp).port == $null ) { aline -ph 4 @ $+ %temp Tu n'es pas connecté(e) | halt | return }
aline -ph 2 @ $+ %temp $1-
sockwrite -n %temp $1- | halt }


menu menubar {
Clients
.Client telnet:telnet $$?="Adresse du site telnet et port (Ex: 127.0.0.1 6667)"
}

alias telnet {
if ( $2 == $null ) return
set %i 1
:boucle
set %j 1
:boucle2
%temp = Telnet $+ %j
if ( $sock(%temp).name == $null ) { sockopen %temp $1 $2 | goto suite2 }
inc %j
goto boucle2
:suite2
window -ek @ $+ %temp ms sans serif 14 | titlebar @ $+ %temp sur $1 ( $+ $2 $+ )
aline -ph 4 @ $+ %temp Client Telnet - par Averell

}

on 1:sockopen:Telnet*: {
; %temp2 = $right($sockname,$calc($len($sockname)-6))
if ( $sockerr > 0 ) aline -ph 2 @ $+ $sockname Pas de connexion trouvée
else aline -ph 4 @ $+ $sockname Connexion établie
}

on 1:close:@telnet*: %temp = $gettok($target,1,58) | %temp = $right(%temp,$calc($len(%temp)-1)) | sockclose %temp