Try this...
use F7 to step through the code so you can see how it works.
set %bow PPO
gosub items2quest %bow
halt
sub items2quest
finditem %1 C_ , #backpackid
if #findcnt > 0
{
gosub togglequest #true
for %i #findindex #findcnt
{
target
set #ltargetid #findid
set #ltargetkind 1
event macro 22 0
}
gosub togglequest #false
}
return
sub togglequest
if %1
{
exevent popup #charid
wait 20
click 20 130
target
}
else
{
target
key esc
}
return