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

Timing Actions w/ Probability

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
atraeyu



Joined: 12 Dec 2007
Posts: 165

PostPosted: Wed Dec 12, 2007 10:01 am    Post subject: Timing Actions w/ Probability Reply with quote

Every 100-200 seconds, I would like a 50% chance, To do one of several actions (cheer/greet all/smile).

Any idea how I would set this up? Thanks!
Back to top
View user's profile Send private message AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Wed Dec 12, 2007 11:12 am    Post subject: Reply with quote

The following code should do this:

Code:

#tick {randomsocial}
{
    #delay {1d100}
    {
        #if {1d2 == 1}
        {
            #if {1d3 == 1} {cheer}
            #if {1d2 == 1} {greet all}
            #if {1d1 == 1} {smile}
        }
    }
}
{200}

This creates a ticker that fires every 200 seconds. When it triggers it delays a command randomly between 1 and 100 seconds. When the command fires there's a 50% chance of executing one of 3 socials.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion 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