added an option to get the possible status in the `setstate' command
added a status command (protocol 11 ready)

> status
Pseudonyme: my displayed name
PSM: my psm
Your state is currently on : online

> setstate
Possible status are :
 online, away, busy, noactivity, brb, onphone, lunch, appearoffline

> setstate busy
State changed

need some testing, but seems ok ;)
--
Admin HLTV-Fr : http://www.hltv-fr.com
Admin, Project leader & coder Games-Tv : http://www.games-tv.org
Admin WestArena : http://www.westarena.net
Admin AAG : http://www.2ag-fr.com

http://www.yoda-bzh.net
http://blog.yoda-bzh.net

o May the Force be with you
o Do it, or not, but there's no try
--- remote.tcl  2005-07-03 20:36:54.000000000 +0200
+++ remote.setstate.tcl 2006-01-09 14:19:33.000000000 +0100
@@ -82,11 +82,16 @@
 
                write_remote "Your state is currently on : $my_state"
 
        }
 
-       proc setstate { state } {
+       proc setstate { {state ""} } {
+               if { "$state" == "" } {
+                       write_remote "Possible status are :"
+                       write_remote " online, away, busy, noactivity, brb, 
onphone, lunch, appearoffline"
+                       return
+               }
 
                set state [string tolower $state]
                if { "$state" == "online" } {
                        ChCustomState NLN
                } elseif { "$state" == "away" } {
--- remote.tcl  2005-07-03 20:36:54.000000000 +0200
+++ remote.yoda.tcl     2006-01-09 13:29:53.000000000 +0100
@@ -74,10 +74,20 @@
                                write_remote "$username - [::abook::getNick 
$username] --- [trans status] : [trans [::MSN::stateToDescription $state_code]]"
                        }
                }
        }
 
+       proc status { } {
+               set nick [::abook::getPersonal MFN]
+               write_remote "[trans nick]: $nick"
+               if {[ ::config::getKey protocol] == 11 } {
+                       set psm [::abook::getPersonal PSM]
+                       write_remote "[trans PSM]: $psm"
+               }
+               getstate
+       }
+
        proc getstate { } {
 
                set my_state [::MSN::stateToDescription [::MSN::myStatusIs]]
 
                write_remote "Your state is currently on : $my_state"

Reply via email to