Only events related to the selected configuration item appear in the Event Browser. COMPUTERCRAFT MULTI EVENT FILTER HOW TOIn this task, you learn how to filter the events displayed in the Event Browser by configuration item. To match a title that contains the string "Automatic assignment of " followed by the string "template" or "aspect" and more text after that. To match a title that contains five or more digits in the beginning, followed by any combination of letters and digits. To match a title that starts with the abbreviation KM and any number of digits. To match one of the following categories: OpsCx, SiS, or Internal. To match a title that ends with the word Down (for example Interface Down, or Connection Down). Some additional examples of regular expressions are listed below: "abc" only matches the exact string "abc" "\d.*" matches strings containing four or more digits anywhere "\d " matches any string consisting of digits only The match operator is similar to Java regular expressions, but requires an exact match. If called with utc, returns the hour of the day in UTC time.Note The Groovy match operator "=~" is used to evaluate the regular expressions.This is the default if nothing is passed. If called with ingame, the current world time will be returned.Returns the current time depending on the string passed in. Returns the number of seconds that the computer has been running. Returns the label of the computer, or nil if none is set. token number The ID of the alarm to cancel.This can be used to filter theĬancels an alarm previously started with setAlarm. time number The time at which to fire the alarm, in the range [0.0, 24.0).ID * returned from this function as the first parameter. When itįires, * an alarm event will be added to the event queue with the Sets an alarm that will fire at the specified in-game time. token number The ID of the timer to cancel.This can be used to filter theĬancels a timer previously started with startTimer. timer number The number of seconds until the timer fires.To the nearest multiple of 0.05 seconds, as it waits for a fixed amount The ID returned from this function as the first parameter.Īs with sleep, timer will automatically be rounded up The timer fires, a timer event will be added to the queue with Starts a timer that will run for the specified number of seconds. name string The name of the event to queue.while true do local eventData =, "/rom/programs/a" )Īdds an event to the event queue. pullEvent ( "mouse_click" ) print ( "Button", button, "was clicked at", x, ",", y ) end while true do local event, button, x, y = os. Optional additional parameters of the event. string event The name of the event that fired.Unlike os.pullEventRaw, it will stop the application upon a "terminate"Įvent, printing the error "Terminated". If no filter is supplied, this will match all events. To be resumed with a vararg list where the first element matches filter. This function yields the current process and waits for it Pause execution of the current thread and waits for any events matching name string The name of the API to unload.This effectively removes the specified table from _G. Returns a date string (or table) using a specified format string and optional time to format. Returns the number of milliseconds since an epoch depending on the locale. Returns the day depending on the locale specified. Sets an alarm that will fire at the specified in-game time.Ĭancels an alarm previously started with setAlarm. Starts a timer that will run for the specified number of seconds.Ĭancels a timer previously started with startTimer. Run the program at the given path with the specified environment and arguments. Get the current CraftOS version (for example, CraftOS 1.8). Pauses execution for the specified number of seconds, alias of _G.sleep. Pause execution of the current thread and waits for events, including the terminate event. Pause execution of the current thread and waits for any events matching filter. Unloads an API which was loaded by os.loadAPI. Loads the given API into the global environment. The os API allows interacting with the current computer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |