However, when I want to modify the schedule of an interrupt I mostly have to fall back on the get table, modify table, set table method.
I have two proposals for adding full support for modifying the API. The first follows the examples set by drag_redcord, get_record, etc. to add an optional interrupt index parameter. Here's the changes to the API in bold:
The second proposal would be to have get_interrupt return a stripped down LuaSchedule where many members wouldn't apply. Here's the API where the struck through members wouldn't apply to the interrupt schedules:add_wait_condition(record_index, condition_index, type, interrupt_index?)
remove_wait_condition(record_index, condition_index, interrupt_index?)
set_wait_condition_mode(record_index, condition_index, mode, interrupt_index?)
change_wait_condition(record_index, condition_index, wait_condition, interrupt_index?)
add_record(data, interrupt_index?)
remove_record(index, interrupt_index?)
copy_record(source_schedule, source_index, destination_index, source_interrupt_index?, destination_interrupt_index?)
add_interrupt(interrupt)
remove_interrupt(index)
activate_interrupt(index)
change_interrupt(index, interrupt)
rename_interrupt(old_name, new_name)
go_to_station(schedule_index)
set_stopped(stopped)
set_allow_unloading(index, allow)
drag_record(from, to, interrupt_index?)
drag_interrupt(from, to)
drag_wait_condition(index, from, to, interrupt_index?)
get_record(index, interrupt_index?)
get_records(interrupt_index?)
set_records(records, interrupt_index?)
clear_records(interrupt_index?)
get_interrupt(index)
get_interrupts()
set_interrupts(interrupts)
clear_interrupts()
get_wait_condition(schedule_index, condition_index, interrupt_index?)
get_wait_conditions(schedule_index, interrupt_index?)
get_wait_condition_count(index, interrupt_index?)
get_record_count(interrupt_index?)
owner
interrupt_count
current
tick_of_last_schedule_change
tick_of_last_activity
ticks_in_station
group
valid
object_name
This immediately suggests to me a refactoring LusSchedule to split it into LuaScheduleStatus which gets all of those crossed out members as well as get_schedule. Of course that would be a breaking change, soadd_wait_condition(record_index, condition_index, type)
remove_wait_condition(record_index, condition_index)
set_wait_condition_mode(record_index, condition_index, mode)
change_wait_condition(record_index, condition_index, wait_condition)
add_record(data)
remove_record(index)
copy_record(source_schedule, source_index, destination_index)
add_interrupt(interrupt)
remove_interrupt(index)
activate_interrupt(index)
change_interrupt(index, interrupt)
rename_interrupt(old_name, new_name)
go_to_station(schedule_index)
set_stopped(stopped)
set_allow_unloading(index, allow)
drag_record(from, to)
drag_interrupt(from, to)
drag_wait_condition(index, from, to)
get_record(index)
get_records()
set_records(records)
clear_records()
get_interrupt(index)
get_interrupts()
set_interrupts(interrupts)
clear_interrupts()
get_wait_condition(schedule_index, condition_index)
get_wait_conditions(schedule_index)
get_wait_condition_count(index)
get_record_count()
owner
interrupt_count
current
tick_of_last_schedule_change
tick_of_last_activity
ticks_in_station
group
valid
object_name

Either of these changes could be further enhanced by allowing the wait condition calls to refer to the interrupt triggers when schedule_index is 0 or nil.