 target = 0
 focus = 0
 talk_start = 0

 function onThingMove(creature, thing, oldpos, oldstackpos)

 end


 function onCreatureAppear(creature)

 end


 function onCreatureDisappear(cid, pos)

 end


 function onCreatureTurn(creature)

 end



 function onCreatureSay(cid, type, msg)
     msg = string.lower(msg)

     if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 5 then
        selfLook(cid)
        selfSay('Hello ' .. creatureGetName(cid) .. '!')
         focus = cid
         talk_start = os.clock()

    elseif (string.find(msg, '(%a*)bye(%a*)') and focus ~= 0) then
        selfSay('Goodbye ' .. creatureGetName(cid) .. '!')
         focus = 0
         talk_start = 0

    elseif (string.find(msg, '(%a*)heal(%a*)') and focus ~= 0) then
	travel(cid,231,261,7)
        end
    end

 function onCreatureChangeOutfit(creature)

 end


 function onThink()
     if (os.clock() - talk_start) > 50 then
         if focus > 0 then
             selfSay('Next Please.')
         end
         focus = 0
    end
    if focus ~= 0 then
        selfLook(focus)
        if getDistanceToCreature(focus) > 4 then
            selfSay('Good bye then.')
            focus = 0
        end
    end
 end