you should probably not use "deletejournal" since the subs will take care of that for you.
Also, when you get a "hit" on a journal scan, you need to "sync" so that you won't re-trigger on a journal event. Under normal circumstances, you could use the VALID_ADVANCE flags, but the way you are using the subs, you probably should call "gosub TM_AdvJournalSync snake" when you have a valid "hit". So perhaps you will have something like this (NOT TESTED!!!)
sub setup
gosub TM_AdvJournalSync snake 100
return ; note the mispelling.....
gosub TM_AdvJournalScan snake VALID You_don't_seem_to_be_able_to_persuade_that_to_move.
if #RESULT = #TRUE
{
gosub TM_AdvJournalSync snake
return UseFlute
}
gosub TM_AdvJournalScan snake VALID The_animal_walks_where_it_was_instructed_to.
if #RESULT = #TRUE
{
gosub TM_AdvJournalSync snake
ignoreitem %snake
wait 5s
return UseFlute
}
gosub TM_AdvJournalScan snake VALID the_nest_collapses
if #RESULT = #TRUE
{
gosub TM_AdvJournalSync snake
gosub ignore
return targethole
}
sub ignore
; deletejournal ; nope, don't do this....
ignoreitem reset
return
Remember that the ADVANCE modifier automatically syncs the journal pointer. Without that, the pointer will not advance unless you explicitly "sync" the pointer to the most current place. If you play with some test code using the VALID vs. VALID_ADVANCE or using the "gosub TM_AdvJournalSync", you can see how this works for your purposes.