mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-12 05:07:46 +02:00
feat(scripting): sleep
This commit is contained in:
@ -80,6 +80,12 @@ class JSModule(
|
||||
field.get(obj.unwrap())
|
||||
}
|
||||
|
||||
moduleObject.putFunction("sleep") { args ->
|
||||
val time = args?.get(0) as? Number ?: return@putFunction Undefined.instance
|
||||
Thread.sleep(time.toLong())
|
||||
Undefined.instance
|
||||
}
|
||||
|
||||
moduleObject.putFunction("findClass") {
|
||||
val className = it?.get(0).toString()
|
||||
val useModClassLoader = it?.getOrNull(1) as? Boolean ?: false
|
||||
|
Reference in New Issue
Block a user