![]() ![]() the ID (number) of a stopwatch or, from 4.4.0: a nil error message if the name has already been used. ![]() name (string) a unique text to use to identify the stopwatch.This difference between the cases with and without a name argument is to allow for older scripts to continue to work with 4.4.0 or later versions of Mudlet without change, yet to allow for more functionality - such as presetting a time when the stopwatch is created but not to start it counting down until some time afterwards - to be performed as well with a named stopwatch. start immediately (bool) used to override the behaviour prior to Mudlet 4.4.0 so that if it is the only argument then a false value will cause the stopwatch to be created but be in a stopped state, however if a name parameter is provided then this behaviour is assumed and then a true value is required should it be desired for the stopwatch to be started on creation.Prior to 4.4.0 the function took no parameters and the stopwatch would start automatically when it was created. ![]() #Mudlet delete all areas updateStopwatches can be started, stopped, reset, asked how much time has passed since the stop watch has been started and, following an update for Mudlet 4.4.0: be adjusted, given a name and be made persistent between sessions (so can time real-life things). ĬlearCmdLineSuggestions () createStopWatch createStopWatch(, ) createStopWatch()ĬreateStopWatch() This function creates a stopwatch, a high resolution time measurement tool. lua mission ( 60 * 60 ) Better hurry up, the clock is ticking on an existing mission and you only have 00 : 59 : 52 h : m : s left. seconds )) end end end end - in use: lua mission ( 60 * 60 ) Get cracking, you have 01 : 00 : 00 h : m : s left. seconds )) else echo ( string.format ( "Uh oh! You failed to meet the deadline on an existing mission by i:i:i h:m:s ! \n ", missionTimeTable. negative then echo ( string.format ( "Well done! You have already completed a mission i:i:i h:m:s before the deadline. seconds )) else echo ( string.format ( "Bad news, you are past the deadline on an existing mission by i:i:i h:m:s ! \n ", missionTimeTable. negative then echo ( string.format ( "Better hurry up, the clock is ticking on an existing mission and you only have i:i:i h:m:s left. name = "missionStopWatch" then missionTimeTable = v end end if missionTimeTable. seconds )) startStopWatch ( "missionStopWatch" ) else - it already exists, so instead report what is/was the time on it -=] for k, v in pairs ( getStopWatches ()) do if v. See also: clearCmdLineSuggestions(), removeCmdLineSuggestion()ĪddCmdLineSuggestion ( "help" ) local suggestions = if createStopWatch ( "missionStopWatch" ) then adjustStopWatch ( "missionStopWatch", - tonumber ( time )) setStopWatchPersistence ( "missionStopWatch", true ) missionTimeTable = getStopWatchBrokenDownTime ( "missionStopWatch" ) echo ( string.format ( "Get cracking, you have i:i:i hg:m:s left. Non-word characters are skipped (this is the reason why they can't be added at start of suggestion), therefore it's also possible to type: /he and hit TAB. For example, start typing he and hit TAB until help appears in command line. Collection of functions to manipulate Mudlet's scripting objects - triggers, aliases, and so forth.ĪddCmdLineSuggestion addCmdLineSuggestion(, suggestion) Add suggestion for tab completion for specified command line. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |