The latest set_schedule and schedule modules, can change layouts as well, so you could use those scripts. But it might be a bit to heavy for the job. Making a smaller module for the task, shouldn't be too complicated.
This retreives all the layouts of the current loaded track. From a layoutfolder you have set.
The list with layouts must also exist in the default layoutfolder of your LFS directory.
Download the script below and change the extension of the file to .LPR and add the following line in addonsused.lpr in your 'includes' folder
<?php $LayoutFolder = ""; #LFSLapper must be on the same machine as the LFS Server. #Set Path to the layoutfolder of your LFSServer #$LayoutFolder = ""; #Example : C:\LFS_0.6R\data\layout #The layouts in your Layoutfolder must also exist in the default Layoutfolder of your LFS directory.
CatchEvent OnLapperStart()
GlobalVar $Timelimit; $Timelimit = 90; #This is the time in minutes GlobalVar $ElapsedTime; $ElapsedTime = 0; #Reset Value to (re)start the timer. GlobalVar $NrOfLayout; $NrOfLayout = 1; #Reset Value to start from the top of the layout list.
#ss mm hh dayOfWeek dd MM YYYY RegisterScheduleAction( "0 * * * * * *", RSA_Time ); #Execute this action each minute
EndCatchEvent
Sub RSA_Time() # Lapper Event $ElapsedTime = $ElapsedTime + 1;
#IF $ElapsedTime is bigger or equal than the timelimit #Reset $ElapsedTime and goto Load layout sub IF ($ElapsedTime >= $Timelimit) THEN $ElapsedTime = 0; LoadLayout(); ENDIF EndSub
Sub LoadLayout() #The vars below are needed to retreive the layout from the layoutfolder $Filter = ""; $Sort = "LAYOUTNAME"; $TypeSort = "ASC";
#Try to retreive the layouts from the layoutfolder you have set above $layoutlist = getlistoflayouts($Filter,$Sort,$TypeSort);
#Get numberoflayouts from the current track $MaxNumberOfLayouts = $layoutlist["NumberOfLayouts"];
#Load the layout privmsg("Loading Layout:".$layoutlist[$NrOfLayout,"LayoutName"]); cmdLFS("/axload ".$layoutlist[$NrOfLayout,"LayoutName"]);
#Set numberoflayout for the next action $NrOfLayout = $NrOfLayout + 1; #IF $NrOfLayout is bigger or equal than the number of layouts in your layoutfolder #Reset $NrOfLayout IF ($NrOfLayout >= $MaxNumberOfLayouts) THEN $NrOfLayout = 1; ENDIF EndSub ?>
Quick question though. I run my server on a linux machine using wine/mono. How do paths work in lapper this way? Can I use a linux path or relative paths (such as ../../s2_server/data/layouts/)?
If there is no easier way to do this and it has to be absolute, I can just stick my server directory in the virtual wine C: drive.
I'll give it a go and do a report back here. I know a lot of hosts run Linux, and the performance is probably better on a small VPS compared to Windows Server.
Edit:
Actually I think I'll just try it with the virtual C: drive in Wine.