I have run into little problem because I uses the wrong variable sometime.   I'm trying to understand why.  I have read the tutorial and start cleaning and rebuild my old script.
1) finditem %itemA C_ , #BACKPACKID    ( this work every time)
2) finditem %itemA C_ , %BACKPACKID   ( this one to so good) 
This work great for casting spell
checkHP:
if #hits < 120
{
    wait 20
    event macro 15 28 ; greather heal
    target 3s
    event macro 23 0
    goto checkPH
   }
this doesn't work 
sub recallhome
    set %runebookID %book     ; book to recall home
    finditem %runebookID C_ , %backpackid
    set #ltargetID %runebookID
    set #ltargetkind 1
    wait 2s
    event macro 15 31  ; Recall Spell
    target 1s
    event macro 22 0  ; Last target
    wait 5s
Return
But if I do this, it work perfectly to recall of a book.   
sub recallhome
    set %runebookID %book     ; book to recall home
    finditem %runebookID C_ , %backpackid
    set #ltargetID %runebookID
    set #ltargetkind 1
    wait 2s
    event macro 15 31  ; Recall Spell
    wait 1s
    target 
    event macro 22 0  ; Last target
    wait 5s
Return
So what the difference between those target wait.
and is this proper coding 
sub unloadmainpack
repeat
finditem %leather C_ , #backpackid
    IF #findkind <> -1
       {
        exevent drag #findid #findstack
       exevent dropc %secure
        wait %lwait   ; 1s  wait
        }
     until #findkind = -1
Return
Thx