TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

CommHistory Script

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Finished Scripts
View previous topic :: View next topic  
Author Message
Gaebryal



Joined: 24 Jan 2011
Posts: 19

PostPosted: Mon Feb 28, 2011 1:58 pm    Post subject: CommHistory Script Reply with quote

for WotMUD, but should easily be customizable to other muds. I only showed the part for narrates, i did the same for chats, yells, and about 10 other communications, then use aliases like yellh chath etc..



Code:
#CLASS {ComHistory} {Kill}
#CLASS {ComHistory} {Open}

#LIST narrHistory {create}
#VAR narrHowMany {10} /* variable for how may narrates to display when entering  narrh */

/*
*  narrh          - displays last $narrHowMany narrates
*  narrh clear    - clears the narrHistory
*  narrh [number] - sets $narrHowMany(max of 50)
*/
#ALIAS narrh {
   #IF {"%1"=="%+"} {
      #IF {"%1"=="%d"} {
         #VAR narrHowMany %1;
         #SHOWME narrHistory set to the last $narrHowMany narr~(s~).
      } {
         #IF {"%1"=="%iclear"} {
            #LIST {narrHistory} {clear};
            #SHOWME narrHistory cleared.
         } {
            /* if params not recognized, display narrates */
            narrh 
         }
      }
   } {
      #SHOWME {--- Last $narrHowMany narr(s) received--- };
      #LOOP {-$narrHowMany} {-1} {index} {#SHOWME <aff>$narrHistory[$index]}
   }
}

/* Captures Narrates from yourself, adds them to narrHistory  */
#ACTION {You narrate '%1'$} {
   #IF (&narrHistory[]==50) {#LIST {narrHistory} {delete} {1}};
   #FORMAT timeStamp {%t} {%T};
   #LIST {narrHistory} {add} {$timeStamp - You narrated: %1}
}

/* Captures Narrates from other ppl, adds them to narrHistory  */
#ACTION {%1 narrates '%2'$} {
   #IF (&narrHistory[]==50) {#LIST {narrHistory} {delete} {1}} 
   #FORMAT timeStamp {%t} {%T};
   #LIST {narrHistory} {add} {$timeStamp - %1 narrated: %2}
}

#CLASS {ComHistory} {Close}




itll output something like



Quote:
* HP:Healthy MV:Fresh > narrh
--- Last 10 narr(s) received---








13:51:29 - You narrated: test! 1 2 testing!
13:51:32 - You narrated: :O
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Finished Scripts All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group