I received a question through email that I wanted to post here. The user asked if it was possible to modify an FR1 session to also restrict the hours that the FED3 was active.
The answer is yes! I'm attaching a script that does this. It operates like the normal FR1 task but only during certain hours. If you hold down both pokes at startup it will enter a small edit menu where you can set the number of the device and set the hours that the FED3 is active, stored in the variables timedStart and timedEnd. The attached script makes use of these variables to set the times that FED3 is active. This same approach can be used for any task.
To give some background on how time restrictions work:
There is a variable in the FED3 library called fed3.currentHour that can be queried at any time to get the current hour. So if you want FED3
to dispense on a Left poke only after 5PM, you can make that part of
the contingency for whether a Left poke is registered. ie:
if (fed3.Left and fed3.currentHour >= 17 ) {
fed3.Feed();
}
Hope this is helpful! -Lex