Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc ::potato::send_mushage {window saveonly} {
- variable inputSwap;
- variable conn;
- variable world;
- set c [up]
- if { $window eq "" } {
- set window [connInfo $c input3]
- }
- if { [$window count -chars 1.0 end-1c] == 0 && $conn($c,connected) == 0 } {
- reconnect [up]
- return;
- }
- set w $conn($c,world)
- # Figure out the auto-prefix, if any
- set windowName [textWidgetName [activeTextWidget] $c]
- if { $windowName eq "" } {
- set windows [list _all]
- } else {
- set windows [list $windowName _all]
- }
- if { $w == 0 } {
- set worlds [list 0]
- } else {
- set worlds [list $w 0]
- }
- foreach w $worlds {
- if { [info exists prefix] } {
- break;
- }
- foreach x $windows {
- set pos [lsearch -exact -index 0 $world($w,prefixes) $x]
- if { $pos != -1 } {
- set entry [lindex $world($w,prefixes) $pos]
- if { [lindex $entry 2] == 1 } {
- set prefix [lindex $entry 1]
- break;
- }
- }
- }
- }
- if { ![info exists prefix] } {
- set prefix ""
- }
- set txt [$window get 1.0 end-1char]
- $window edit separator
- $window replace 1.0 end ""
- if { $txt eq "" } {
- get_mushageProcess $c ""
- return;
- }
- set inputSwap($window,count) -1
- set inputSwap($window,backup) ""
- addToInputHistory $c $txt
- if { $saveonly } {
- return;
- }
- send_to $c $txt $prefix
- return;
- };# ::potato::send_mushage
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement