Questions about special Condition, use script and auto event

Hello all,
i have some stuggels with my phbot.(Isro)
First Problem:
I made a script from hotan(respawn) to walk to jangan and do auto trade back to hotan. I need a condition to use this script “trade.txt” when Jobinventory (speciality goods) are full. I mean return to town and use this script 1 time.
I tryed it without condition. 2 Profils. Default: normal botting and Thief: do the script, no town loop. After the bot is finishing trading, he is using it again. So he walks back to jangan again. I tryed it in the script at the end with load profil Default, but it is not working well.

In normal botting he should pick Thanks event and bring it back when all item count is maybe 10. Someone has a script for the townloop of that?

Thx for helping.