Skip to content

How to extend known global records? #1138

Description

@qEagleStrikerp

Hi there,
I'm currently working on a Teal script for Final Fantasy XI's Windower. Most things have worked so far, however, Windower globally extends the Lua coroutine module, and I haven't figured out how to declare this in Teal yet.

From the Windower Wiki:

Furthermore, two functions are added to the coroutine table:

coroutine.schedule(fn, time)

  • fn function - Function to be scheduled
  • time number - Time in seconds when fn is supposed to be run

Executes fn delayed by time seconds. Returns the scheduled coroutine.

coroutine.sleep(time)

  • time number - Time in seconds

Sleeps the current evaluation for the given period of time.

I tried declaring it in windower.d.tl like so:

global record coroutine
    schedule: function(fn: function, time: number): thread
    sleep: function(time: number)
end

but unfortunately, Teal does not recognize the functions this way. What is the correct way of declaring them?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions