You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace IDE watcher to integrated watcher and use it as demon for this mode.
On change, compile with inject dev script as lualib and add to files .build with timestamp/hash.
Dev scripts
AutoRestart:
Looking .build file on the root resouce dir and on change restart resource.
import'.build'//Hello from https://github.com/mtasa-typescript/mtasa-lua-utils/issues/401new(classAutoRestart{privatefileName='.build'privatebuild=''privateinterval=5//interval checksprivatewait=5//wait before restartprivatedebug=false//show debugprivatetimer: Timerconstructor(){this.build=this.getResourceBuild()this.timer=setTimer(()=>{this.checkBuild()},this.interval*1000,0)}getResourceBuild() : string{if(fileExists(this.fileName)){constfile=fileOpen(this.fileName,true)constbuild=fileRead(file,fileGetSize(file))fileClose(file)returnbuild}elsereturnthis.build}checkBuild() : void{if(this.build!==this.getResourceBuild()){outputServerLog(`Build changed! Restart after ${this.wait} seconds...`)killTimer(this.timer)setTimer(()=>{restartResource(getThisResource())},this.wait*1000,1)}elseif(this.debug)outputServerLog(`Build: ${this.build}/${this.getResourceBuild()}`)}})
The text was updated successfully, but these errors were encountered:
Replace IDE watcher to integrated watcher and use it as demon for this mode.
On change, compile with inject dev script as
lualib
and add to files.build
with timestamp/hash.Dev scripts
AutoRestart:
Looking
.build
file on the root resouce dir and on change restart resource.The text was updated successfully, but these errors were encountered: