Объект «script»
Last updated
Was this helpful?
Was this helpful?
script.random(min, max)script.random(min, max);a = script.random(0, 10) # случайное число от 0 до 10var a = script.random(0, 10); // случайное число от 0 до 10script.readAll("fileName")script.readAll("fileName");lines = script.readAll("input.txt") # считывает текстовый файл input.txtvar lines = script.readAll("input.txt"); // считывает текстовый файл input.txtscript.removeFile("fileName")script.removeFile("fileName");script.removeFile("file.txt"); # удалить файл file.txtscript.removeFile("file.txt"); // удалить файл file.txtscript.run()script.run();ript.system()script.system();script.system("reboot")script.system("reboot");script.time()script.time();script.timer(n)script.timer(n);def foo():
print("It's Alive!!!")
tim = script.timer(500) # таймер на 500 мс
tim.timeout.connect(foo) # подписываем функцию foo на срабатывание по таймеру tim
script.wait(5000)
tim.stop()function foo(){
print("It's Alive!!!")
}
tim = script.timer(500) // таймер на 500 мс
tim.timeout.connect(foo) // подписываем функцию foo на срабатывание по таймеру tim
script.wait(5000)
tim.stop()script.wait(msCount)script.wait(msCount);script.wait(1000) # остановить выполнение скрипта на одну секундуscript.wait(1000); // остановить выполнение скрипта на одну секундуscript.writeToFile("fileName", "text")script.writeToFile("fileName", "text");script.writeToFile("output.txt", "Hello, world") # записать «Hello, world» в файл output.tscript.writeToFile("output.txt", "Hello, world"); // записать «Hello, world» в файл output.t