This is untested but should give you a good idea of how to do an antiafk script (until ama gets something put into the extension hopefully). This script will look for a button being hit (be it keyboard or mouse) and if none is hit in 45 minutes it will toggle your bags.
Code:
variable int afkStart = ${Time.Epoch}
function main()
{
Event[OnKeyDown]:AttachAtom[resetAfkStart]
while (1)
{
if ((${Time.Epoch} - ${afkStart}) > 2700)
{
press b
wait 20
press b
afkStart:Set[${Time.Epoch}]
}
wait 10
}
}
atom resetAfkStart()
{
afkStart:Set[${Time.Epoch}]
}
function atexit()
{
Event[OnKeyDown]:DetachAtom[resetAfkStart]
}