1
0
mirror of https://git.lain.church/emil/moontalk.git synced 2025-06-25 11:26:40 +00:00
This commit is contained in:
Emil Williams
2024-02-03 17:37:01 +00:00
parent 90f617dcf0
commit 7721b77c93
15 changed files with 1197 additions and 0 deletions

34
client/moontalk.tcl Executable file
View File

@ -0,0 +1,34 @@
#!/usr/bin/tclsh
package require Tk
set ::name anonymous
set ::usernu x
set ::host 7ks473deh6ggtwqsvbqdurepv5i6iblpbkx33b6cydon3ajph73sssad.onion
pack [text .msgs] -fill both -expand 1
pack [entry .entry] -fill x
proc add_msg { msg } {
.msgs insert end "$msg\n"
.msgs yview end
}
proc get_msg {} {
set curdate [clock format [clock seconds] -format "%Y/%m/%d %T"]
return "<$curdate $::name:$::usernu> [.entry get]"
}
bind .entry <Return> {
set msg [get_msg]
puts $::fd $msg
flush $::fd
add_msg $msg
.entry delete 0 end
}
fileevent [set fd [socket $::host 50000]] readable {
add_msg [gets $::fd]
}
chan configure $::fd -translation binary