Advertisement
Guest User

Untitled

a guest
Feb 20th, 2012
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.66 KB | None | 0 0
  1. THIS GOES ON GOD'S &STARTUP or equivalent: @dolist SAY SEMIPOSE POSE @EMIT={@hook/after %i0=#268,FUN`MAIN};
  2. Replace #268 with the DBREF of the POT code object.
  3.  
  4. This is helpfile for the commands.
  5. +help/addtop Commands/+pot=+pot, or [ansi(h,Po)]se [ansi(H,T)]racker, is a system that stores poses within the room for easy retrieval for review. Sometimes, poses are lost in spam or scroll, and that's what this system combats. To use it:%R%R'[ansi(h,+pot)]' will show you the last (maximum, or 15 by default) poses in the room.%R%R'[ansi(h,+pot/brief)]' is like +pot, but shows only about one line of the pose.%R%R'[ansi(h,+pot/private <1/0>)]' Set to 0 (default) to make your poses public, or 1 to render them private. It also accepts Yes or No. Poses made while set private will be revealed if you go public!%R%R'[ansi(h,+pot/max <#>)]' To set your maximum shown poses. It accepts only whole, positive numbers!%R%R+pot only functions normally when one is in a room that has its IC attribute set to 1. It will also work in any player-created objects, provided their IC attribute is set to 1. To do this, &IC here=1 WHILE WITHIN THE OBJECT. Please note that Pot stores an arbitrarily massive amount of attributes under the &pot attribute tree, and the system will periodically clean your object as long as it's set IC 1.
  6.  
  7.  
  8. @create Pose Order Tracker -- POT
  9. @set pot=WIZARD !NO_COMMAND
  10.  
  11. &FUN`MAIN POT=null(if(or(isic(%#),strmatch(ROOM,type(loc(%#)))),[setq(type,switch(before(%u,%B),@EMIT,|,SAY,",SEMIPOSE,;,POSE,:))][attrib_set(loc(%#)/[setr(potattr,POT`POSES`[add(lmath(max,iter(lattr(loc(%#)/POT`POSES`*),last(%i0,`))),1)])],speak(%#,%q<type>[after(%u,%B)]))][attrib_set(loc(%#)/%q<potattr>`BY,%#)][attrib_set(loc(%#)/%q<potattr>`WHEN,secs())]))
  12.  
  13. &GFN`ISIC POT=strmatch(1,get(loc(%#)/IC))
  14.  
  15. &CMD`+POT POT=$^\+pot(?\:/(\S+))?(?\: +(.+))?$:@assert or(isic(%#),orflags(%#,Wr))=@nspemit %#=This room is not IC!;@assert or(not(strlen(%1)),match(v(VAR`PLAYFLAGS),%1,|))=@nspemit %#=%1 is not a valid flag for +pot!;@include v(pot)/INC`[strfirstof(%1,MAIN)]
  16. @set pot/CMD`+POT=regexp
  17.  
  18. &INC`MAIN POT=@assert words(setr(listposes,filterbool(#lambda/lte(sub(secs(),get(loc(%#)/POT`POSES`%%0`WHEN)),mul(3600,v(VAR`TIMEOUTHOURS))),sort(iter(lattr(loc(%#)/POT`POSES`*),last(%i0,`)),n))))=@nspemit %#=No recent poses tracked in this location.;@nspemit %#=[header(Recent Poses)];th null(iter(revwords(elements(revwords(%q<listposes>),lnum(1,default(%#/POT`MAX,15)))),[nspemit(%#,ansi(hc,<[name(get(loc(%#)/POT`POSES`%i0`BY))]'s [if(and(orflags(%#,Wr),get(get(loc(%#)/POT`POSES`%i0`BY)/POT`PRIVACY)),[ansi(hr,PRIVATE)]%B)]Pose from [timestring(sub(secs(),get(loc(%#)/POT`POSES`%i0`WHEN)))] Ago>))][if(or(orflags(%#,Wr),not(get(get(loc(%#)/POT`POSES`%i0`BY)/POT`PRIVACY))),nspemit(%#,get(loc(%#)/POT`POSES`%i0)),nspemit(%#,<Pose hidden by privacy settings>))]));@nspemit %#=[header(End of Poses)]
  19.  
  20. &INC`BRIEF POT=@assert words(setr(listposes,filterbool(#lambda/lte(sub(secs(),get(loc(%#)/POT`POSES`%%0`WHEN)),mul(3600,v(VAR`TIMEOUTHOURS))),sort(iter(lattr(loc(%#)/POT`POSES`*),last(%i0,`)),n))))=@nspemit %#=No recent poses tracked in this location.;@nspemit %#=[header(Summary of Recent Poses)];th null(iter(revwords(elements(revwords(%q<listposes>),lnum(1,default(%#/POT`MAX,15)))),[nspemit(%#,ansi(hc,<[name(get(loc(%#)/POT`POSES`%i0`BY))]'s [if(and(orflags(%#,Wr),get(get(loc(%#)/POT`POSES`%i0`BY)/POT`PRIVACY)),[ansi(hr,PRIVATE)]%B)]Pose from [timestring(sub(secs(),get(loc(%#)/POT`POSES`%i0`WHEN)))] Ago>))][if(or(orflags(%#,Wr),not(get(get(loc(%#)/POT`POSES`%i0`BY)/POT`PRIVACY))),nspemit(%#,left(get(loc(%#)/POT`POSES`%i0),68)...),nspemit(%#,<Pose hidden by privacy settings>))]));@nspemit %#=[header(End of Poses)]
  21.  
  22. &INC`LAST POT=@assert words(setr(listposes,revwords(filterbool(#lambda/lte(sub(secs(),get(loc(%#)/POT`POSES`%%0`WHEN)),mul(3600,v(VAR`TIMEOUTHOURS))),sort(iter(lattr(loc(%#)/POT`POSES`*),last(%i0,`)),n)))))=@nspemit %#=No recent poses tracked in this location.;@assert strlen(%2)=@nspemit %#=Whose pose do you wish to recall?;@assert isdbref(setr(target,pmatch(%2)))=@nspemit %#=%2 [if(strmatch(%q<target>,#-2*),matches multiple players!,does not match a player!)];@assert strlen(setr(pose,first(filterbool(#lambda/strmatch(%q<target>,get(loc(%#)/POT`POSES`%%0`BY)),%q<listposes>))))=@nspemit %#=[name(%q<target>)] has no recent poses in this location!;@assert or(orflags(%#,Wr),not(get(%q<target>/POT`PRIVACY)))=@nspemit %#=That player has chosen to keep their poses private.;@nspemit %#=[header(name(%q<target>)'s Pose from [timestring(sub(secs(),get(loc(%#)/POT`POSES`%q<pose>`WHEN)))] Ago)];@nspemit %#=[get(loc(%#)/POT`POSES`%q<pose>)];@nspemit %#=[header(End of Pose)]
  23.  
  24. &INC`PRIVATE POT=@switch/inline 1=or(strmatch(1,%2),strmatch(Yes,%2)),{@nspemit %#=Your poses are now considered private.;th attrib_set(%#/POT`PRIVACY,1)},or(strmatch(0,%2),strmatch(No,%2)),{@nspemit %#=Your poses are now considered public.;th attrib_set(%#/POT`PRIVACY,0)},{@nspemit %#=You must enter Yes or 1 to set your poses private, or No or 0 to set them Public.}
  25.  
  26. &INC`MAX POT=@assert and(isint(%2),gt(%2,0))=@nspemit %#=You must enter a whole number greater than 0 for your maximum poses!;th attrib_set(%#/POT`MAX,%2);@nspemit %#=You will now see only the last %2 poses in +pot.
  27.  
  28. &STARTUP POT=@assert v(var`selfclean)=@include v(pot)/INC`SELFCLEAN;@wait mul(3600,v(var`timeouthours))=@trigger v(pot)/STARTUP
  29.  
  30. &INC`SELFCLEAN POT=@dolist setunion(lsearch(all,type,room),lsearch(all,ething,\[nattr(##/POT`POSES`*)\]))=@dolist filterbool(#lambda/gte(sub(secs(),get(loc(%#)/POT`POSES`\%0`WHEN)),mul(3600,v(VAR`TIMEOUTHOURS))),sort(iter(lattr(loc(%#)/POT`POSES`*),last(%i0,`)),n))=@wipe %i1/%i0
  31.  
  32. &VAR`SELFCLEAN POT=1
  33. &VAR`PLAYFLAGS POT=BRIEF|PRIVATE|LAST|MAX
  34. &VAR`TIMEOUTHOURS POT=2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement