1/30/2024 0 Comments Aimbot for roblox script lua c![]() ![]() Local p = obslua.obs_properties_add_list(properties, "mode", "My list", Combo list filled with the options from MY_OPTIONS Local properties = obslua.obs_properties_create() Called upon settings initialization and modification This function is necessary to tell OBS it is a script to set the visibility at the very first display, it is necessary to call obs_properties_apply_settings using the settings caught e.g. This is the basis, but to get it work completely, i.e. Here we change the visibility but disabling/enabling the property can be done too with obs_property_set_enabled, or any other visible change. Finally, and this is the most important here to remember (it took me literally hours to figure it out), return true from the callback to trigger the refresh of the properties!.if mynumber should be displayed in mode 1: obslua.obs_property_set_visible(obslua.obs_properties_get(props, "mynumber"), mode=1) Retrieve the value of the selection: local mode = obslua.obs_data_get_int(settings, "mode").In Lua, just define it as function set_visibility(props, property, settings). The callback is defined in C as typedef bool (*obs_property_clicked_t)(obs_properties_t *props, obs_property_t *property, void *data). Obslua.obs_property_set_modified_callback(p, set_visibility) So let's say you have a property called mode, and you want to change some properties visibility when its value changes.įirst, once your property is created, say in p, associate a callback to the property, here the callback function is named set_visibility: You could just leave all properties displayed all the time, but it would be confusing for the user. with mode 1 you need to ask the user for a number, with mode 2 you need a color. This is a common issue when you start adding different modes of operation for a script, e.g. Now a snippet to hide an existing property upon change of another property. I still have a small backlog of code to share so let's continue. That is why after entry = obslua.os_readdir(dir) it is possible to use entry.d_name There are getters and setters defined automatically in SWIG for struct data, including os_dirent. This next entry is of type struct os_dirent or simply os_dirent in Lua. Then, obslua.os_readdir returns the next entry in the directory (or nil if no more entry). The function obslua.os_opendir returns an object of type os_dir_t * treated as opaque userdata by Lua. Table.insert(filenames, obslua.obs_data_get_string(script_settings, "obsdoc"). If entry and not entry.directory and obslua.os_get_path_extension(entry.d_name)=".rst" then Local dir = obslua.os_opendir(obslua.obs_data_get_string(script_settings, "obsdoc")) The whole purpose of this thread is to share the tricks on how to use the OBS C API. But the OBS C API is full of platform-independent functions. Actually I do not know how to add a non-pure-lua library to the Lua environment. The main drawbacks of Lua are its poor standard library and the difficulty to add libraries. The Lua syntax does not rely on indentation and is quite readable. ![]() In addition, Lua is the script language of the LÖVE2D game engine, Roblox and Wireshark, so learning it can be useful.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |