rendered paste bodydialog sm {
title "Socket maker v1.0"
size -1 -1 167 127
option dbu
text "Name your socket:", 1, 2 13 54 8, center
edit "", 2, 58 11 61 21, autohs hsbar
text "Website:", 3, 5 36 43 8, center
edit "", 4, 52 33 114 20, autohs hsbar
text "Suffix to website:", 5, 3 56 47 8, center
edit "", 6, 50 55 116 21, autohs hsbar
text "Key text:", 7, 2 103 38 8, center
edit "", 8, 43 100 124 24, autohs hsbar
text "Alias name:", 10, 2 79 36 8, center
edit "", 11, 43 76 67 22, autohs hsbar
button "Make this mfkr", 12, 115 76 52 12
button "Clear", 13, 115 88 52 12
}
menu * {
socket maker:/dialog -dm sm sm
}
on *:dialog:sm:sclick:*:{
if ($did == 13) {
did -r $dname 2
did -r $dname 4
did -r $dname 6
did -r $dname 8
did -r $dname 11
}
elseif ($did == 12) {
if ($did(2) && $did(4) && $did(6) && $did(8) && $did(11)) {
echo -s $+($chr(3),03,$str(*,10),$chr(3),04,b_u_n_s' Socket maker V1.0,$chr(3),03,$str(*,10))
echo -s Alias $did(11) $({,0)
echo -s sockopen $did(2) $did(4) 80
echo -s $(},0)
echo -s $+(on *:sockopen:,$did(2),:,$({,0))
echo -s sockwrite -nt $!sockname GET $did(6) HTTP/1.1
echo -s sockwrite -nt $!sockname Host: $did(4)
echo -s sockwrite -nt $!sockname $($crlf,0)
echo -s $(},0)
echo -s $+(on *:sockread:,$did(2),:,$({,0))
echo -s if $+($chr(40),$!sockerr,$chr(41),$chr(32),$({,0))
echo -s echo -a Error: $!sockerr
echo -s sockclose $!sockname
echo -s $(},0)
echo -s else $({,0)
echo -s var $+(%,sock)
echo -s sockread $+(%,sock)
echo -s if $+($chr(40),$did(8)) iswm $+(%,sock,$chr(41)) $({,0)
echo -s echo -a $($htmlfree(%sock),0)
echo -s sockclose $!sockname
echo -s $(},0)
echo -s $(},0)
echo -s $(},0)
echo -s $+($chr(3),03,$str(*,10),$chr(3),04,b_u_n_s' Socket maker V1.0,$chr(3),03,$str(*,10))
}
}
}