Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions plugins/autospec/AutoSpec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// omg it took a LOT of time to just write 23 lines of code
// plugin by soupcreamacy
// im the best tm player

import config from "./Config.js"

function wait(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}

if (config.enabled == true) {
tm.addListener("PlayerFinish", async (info: tm.FinishInfo) => {
await tm.client.call('system.multicall',
[{
method: 'ForceSpectator',
params: [{ string: info.login }, { int: 1 }]
}])
await wait(config.interval * 1000)
await tm.client.call('system.multicall',
[{
method: 'ForceSpectator',
params: [{ string: info.login }, { int: 2 }]
}])
})
}
4 changes: 4 additions & 0 deletions plugins/autospec/Config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
enabled: true, // is the plugin enabled
interval: 1, // time in spectator,
}