Advertisement
depwl9992

Modified MUSHCode +WHO

Jan 13th, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. @@ This +WHO is originally spawned from Nefara's +WHO
  2. @@ off of http://www.mushcode.com:
  3. @@ (http://www.mushcode.com/ViewFile.aspx?Id=47),
  4. @@ but upgraded to use align() and custom client width()
  5. @@ functions rather than brute force spacing for columns.
  6. @@
  7. @@ Note: #4332 is an object which I use to simulate darkness/
  8. @@ hidden movements without explicitly setting players DARK.
  9. @@ Also, #6555 is a specific zone/area called the Dreamrealm.
  10. @@ You can set this as your OOC ZMR or just remove it from
  11. @@ the code if you don't want to use it.
  12. @@
  13. @@ I'm also adding a few of my time functions, just to make
  14. @@ this thing work more smoothly out of the box (otherwise
  15. @@ conv_time2() will break, and such.
  16.  
  17. &do_who Global Command Object=$^(who|\+who)$:@pemit %#=%r[listbar(%B[poll()]%B,[width(%#)])]%r[align(<8(hw) [add([config(player_name_len)],4)](hw) 10(hw) [sub([width(%#)],[add(9,[add([config(player_name_len)],5)],12)])](hw),Flags,Name,Conn/Idle,Location)]%r[if(screenread(%#),,[repeat(-,[width(%#)])])][setq(l,if(isstaff(%#),lwho(),mwho()))][iter([setunion(%ql,%ql)],[setq(0,[tag(send,href="+finger [name(##)]")][name(##)][endtag(send)][if(hasflag(##,away),%b\(A\))])][setq(1,if(hasattr(##,sex),capstr(trim(get(##/sex))),N))][setq(2,switch(hasattr(##,race),1,trim(get(##/race)),-Unknown-))][setq(3,switch([or(hasflag(##,D),hasflag(loc(##),U),hasflag(##,U),gt(match([xget(#4332,hidden_list)],##),0))],0,[if(strmatch(zone(loc(##)),#6555),*ASLEEP*,name(loc(##)))],*Unfindable*))][setq(4,switch(hasflag(##,W),1,W,switch(hasflag(##,royalty),1,R,switch(hasflag(##,robot),1,B,P))))][setq(5,switch([t(parent(loc(##)))],1,IC,OOC))][setq(6,u(conv_time2,idle(##)))][setq(7,switch(orflags(%#,Wr),1,[switch([hasflag(%#,myopic)],0,\([loc(##)]\))]))][setq(8,[words([matchall(%ql,##)])])][setq(9,u(conv_time2,conn(##)))]%r[align(<8 [add([config(player_name_len)],4)] 10 [sub([width(%#)],[add(9,[add([config(player_name_len)],5)],12)])],[left(%q4,1)]-[left(%q1,1)][if(gt(%q8,1),-[left(%q8x,3)])],[left(%q0,23)],\([left(%q9,3)]/[if(strmatch(%q3,*ASLEEP*),---,[left(%q6,3)])]\),[if(or(strmatch(%q3,*Unfindable*),strmatch(%q3,*ASLEEP*)),%q3,%q3%b%q7)])])][if(screenread(%#),,%r[repeat(-,[width(%#)])][ansi(hw,[setq(n,[words([iter([setunion(%ql,%ql)],[switch(or(hasflag(##,dark),hidden(##)),0,##)])])])]There [if(gt(%qn,1),are,is)] %qn player[if(gt(%qn,1),s)] connected.)][if(screenread(%#),,%r[repeat(-,[width(%#)])])]
  18.  
  19.  
  20. @@ A few standard time functions to make idle and connected time work:
  21.  
  22. &conv_time2 Global Command Object=[left([u(days_[gt(div(%0,86400),0)],%0)][u(hours_[gt(div(%0,3600),0)],%0)][u(minutes_[gt(div(%0,60),0)],%0)][mod(%0,60)]s[space(5)],3)]
  23.  
  24. &days_0 Global Command Object=[]
  25. &days_1 Global Command Object=[div(%0,86400)]d%b
  26. &hours Global Command Object=[trunc(div(conn(%0),3600))]
  27. &hours_0 Global Command Object=[]
  28. &hours_1 Global Command Object=[div(mod(%0,86400),3600)]h%b
  29. &minutes Global Command Object=[div(sub(conn(%0),[mul([u(hours,%0)],3600)]),60)]
  30. &minutes_0 Global Command Object=[]
  31. &minutes_1 Global Command Object=[div(mod(%0,3600),60)]m%b
  32.  
  33.  
  34. @@ A few global Functions to declare in a @startup:
  35.  
  36. &f_listbar Global Functions=[center(%0,[switch([t(%1)],1,%1,80)],[switch([screenread(%#)],0,[switch([and([t(%2)],[t(%3)])],1,[ansi(%2,-)][ansi(%3,_)],[ansi([xget(#4109,default.color_listbar)],-_)])],%b)])]
  37. &f_screenread Global Functions=[hasflag(%0,screenreader)]
  38.  
  39. @function screenread=Global Functions,f_screenread,0,10
  40. @function listbar=Global Functions,f_listbar,0,10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement