--
=ȡ()
=1
Ƿ=ȡǷӳ()
Ƿ=1
ֻȡƷ=" ç ʯ ʯ  ˿   õ ħ飨أ ħ飨磩 ħ飨 ħ飨 ħ飨棩"
ﱣ()
()
if (Ѱı ("  ֮",ȡͼ ()) <= 0) then
        ԶѪ(80)
end
function (,ͼ,npc,Ի)
    while (ȡ() == -1) do
        ٻ()
        Ѱ·2(ͼ,npc)
        (npc)
        ȴ()
        Ի(Ի)
        ȴ()
        if (Ѱı(ȡԻ(),"5") > 0) then
            ӡϢ("Ѿ5")
            return -1
        else
            ()
        end
        ȴ()
        
    end
           return 0
end

function (,ͼ,npc,Ի1,Ի2,ڵͼ)
    while(ȡ() == 0) do
        if(ȡͼ() == ͼ) then
            ٻ()
            Ѱ·2(ͼ,npc)
            ȴ()
            if((npc) == true) then
                ȴ()
                if(Ի(Ի1) == true) then
                    ȴ()
                    if(Ի(Ի2) == true) then
                         жϵͼ()
                        if(Ѱı(ȡԻ(),"ʧ") > 0) then
                            ӡϢ("ʧܣȴ30Ӻ")
                            ()
                        end
                    end
                end
            end
          
        end
      if ȡͼ()== ڵͼ then          
          break
      end

    end    
end
function (,ͼ,npc,Ի,Ƿ)
 while(ȡ() == 1) do
        Ѱ·2(ͼ,npc)
        ȴ()
        (npc)
        ȴ()
        Ի()
        ȴ()
   if Ƿ~=nil then
        ()
        ȴ()
   end
        ()
        ȴ()
 end
 while(ȡ() == 2) do
        ӡϢ("ʧܣȴ30Ӻ")
        ()
        ȴ()
 end
end

function (Ʒ,1_x,1_y)
        ٻ()
        local n=0;
		local λ=жλ()
		if λ~=Ʒ and λ~="" then 
		   return
		end
		if ȡƷ (Ʒ) == 0 and ǷǶӳ()==1 then
		   return;
		end
        if (ȡͼ () == "") then                       
            Ѱ· (1_x,1_y)
            ȴ ()
            ()	                
            while ȡƷ (Ʒ) == 1 do                  
                  n=0;
                  while(ȡΧ()==0) do 
				      if  ǷǶӳ()==1 then	      
                        ʹƷ (Ʒ)
                      end
                      ȴ (1)
                      if(n==30) then
                           break;
                      end
                      n=n+1
	              end
				  
                  if ǷǶӳ()~=1 then	      
                     break;
                  end

            end             
	        
            ȴ ()
           ::start::
           while(ȡΧ()>0) do
	          ɱ (0,1)
	          ȴ ()
               (ֻȡƷ)
	          ȴ ()
              Ѱ· (1_x,1_y)
           end
          n=0; 
          while(ȡΧ()==0) do
             if n==0 then                
               Ѱ· (1_x+14,1_y);
             elseif n==1 then
               Ѱ· (1_x,1_y+14);
             elseif n==2 then
               Ѱ· (1_x-14,1_y);
             elseif n==3 then
               Ѱ· (1_x,1_y-14);
             end 
             if (ȡΧ()>0) then
	       goto start; 
             end            
             n=n+1;
             if(n==4) then
                      break;
             end 
         end
     end 

end

function жλ()
   if ȡƷ ("ħ飨棩")==1 then
       return("ħ飨棩")
   elseif ȡƷ ("ħ飨")==1 then
       return("ħ飨")
   elseif ȡƷ ("ħ飨")==1 then
       return("ħ飨")    
   elseif ȡƷ ("ħ飨أ")==1 then
       return("ħ飨أ")
   elseif ȡƷ ("ħ飨磩")==1 then
       return("ħ飨磩")
   end
    return("")
end

function ()
  while (ȡ ("") == 0 and ȡͼ () == "") do
        ("ħ飨磩",133,197)
        ("ħ飨أ",82,70)
        ("ħ飨",182,64)
        ("ħ飨",183,167)
        ("ħ飨棩",73,137)

        =ȡλ()
        ӡϢ()

        while (ȡ ("") == 0 and ȡͼ () == "") do
            if ( == 1) then
                Ѱ· (125,105)
            end
            if ( == 2) then
                Ѱ· (120,106)
            end
            if ( == 3) then
                Ѱ· (118,111)
            end
            if ( == 4) then
                Ѱ· (128,115)
            end
            if ( == 5) then
                Ѱ· (123,115)
            end
            if ( == 6) then
                Ѱ· (125,109)
            end
            ȴ ()
            ɱ (0,0)
            ȴ ()
             (ֻȡƷ)
        end

    local ƴ = 0; 
    while (ȡͼ () ~= "¥" and ƴ < 35) do
        ƴ = ƴ + 1
         (ֻȡƷ)
        ɱ (0,0)
        ȴ (1)
    end
   end

end

function ()

  while(ȡ("") == 0 and ȡͼ() == "") do
    ӳ()
    2(ֻȡƷ)
    ȴ()
  end
end

 =ȡλ()
 ӡϢ()
 
while (ȡ ("",1) == false or ȡ ("") == 0) do  
   
    while (Ѱı ("  ֮",ȡͼ ()) == -1) do
        ٻ() 
        Ѱ·2("¥","")
        if (ȡ ("") == 2) then
           ("")
          ȴ (1800)
        end
        if ("","¥","","")==-1 then
             goto en
        end 
        if(Ƿ==1) then
           
           while(ȡ() <  and ȡͼ() == "¥") do  
               ӡϢ("")	
               Ѱ·2("¥","")			   
               ȴ()
           end
           ӡϢ("")
        end 
        ("","¥","","","ǰ","")          
    end
    while (Ѱı ("  ֮",ȡͼ ()) ~= -1) do
       if Ƿ~=true then
         ()
       else
         ()
       end
	end
end

--
 ("","¥","","")

 ::en::