
@name 
@inputs 
@outputs TIME Cancel PM READY ANTILOOP
@persist G:string N:string  H:string 
@trigger 
if(dupefinished()|first()){
    TIME = 500
    ANTILOOP  = 0
runOnChat(1)
interval(1)
Cancel = 0
PM = 1
setName("Automatic Admin Chip By Ammut")
timer("advert",1000)
READY = 0
}

if(READY ==0){
G = lastSaid():lower()
N = lastSpoke():name()

}

if(G:find("admin")){
    if(N != owner():name()){
         
              timer("print",10)
        gSetStr(1,N)
        gSetStr(2,G)
        H = "!ADMIN"    
}
}
if(G:find("rdm")){
             timer("print",10)
        gSetStr(1,N)
        gSetStr(2,G)
        H = "rdm"     
        
}


if(G:find("prop surf")){
         timer("print",10)
        gSetStr(1,N)
        gSetStr(2,G)
        H = "propsurf"    
 
}
if(G:find("cdm")){
         timer("print",10)
                gSetStr(1,N)
        gSetStr(2,G)
          H = "CDM"   
 
}
if(G:find("minge")){
         timer("print",10)
                gSetStr(1,N)
        gSetStr(2,G)
          H = "Minge"   
 
}
if(G:find("propblock")){
         timer("print",10)     
           gSetStr(1,N)
        gSetStr(2,G)
          H = "Prop Block"   
 
}
if(G:find("prop block")){
         timer("print",10)
                gSetStr(1,N)
        gSetStr(2,G)
              H = "Prop Block"   
 
}
if(G:find("hacker")){
timer("print",10)
        gSetStr(1,N)
        gSetStr(2,G)
                  H = "hacker"   
 
}
if(G:find("hacking")){
timer("print",10)
        gSetStr(1,N)
        gSetStr(2,G)
                  H = "hacking"   
 
}
if(G:find("!cancel")){
Cancel =1
stoptimer("loop2")
stoptimer("loop")
 timer("reset",10000)
timer("pm",1500)
}
if(clk("pm")){
if(PM==1){
concmd("say /pm " + gGetStr(1) + " The Admin : " + owner():name() + " Is too busy currently to handle your request, please try again later.")}
PM = 0
}
if(clk("reset")){
    ANTILOOP = 0
    stoptimer("loop2")
stoptimer("loop")
READY = 1
    TIME = 500
    PM = 1
Cancel = 0}
if(clk("print")){
        concmd("say /pm " + +gGetStr(1) + " An admin is on the way!")
    timer("loop2",2)
}
if(clk("loop2")){
        timer("loop",2)
}
if(clk("loop")){
    timer("loop2",2)
}

if(clk("loop")){

if(ANTILOOP==0){
    TIME = TIME - 1

    print(_HUD_PRINTCENTER, "You will be teleported to " + gGetStr(1) + " In " + TIME + " Ticks" + "--- For Reason : " + H)
    if(Cancel == 0){
        if(TIME == 0){
        if(ANTILOOP==0){
                    concmd("say /goto " + gGetStr(1))
                    Cancel =1
                    TIME = 500
                    READY = 1
                    ANTILOOP = 1
stoptimer("loop2")
stoptimer("loop")
 timer("reset",10000)
                    
    }}
}}
}

if(owner():lastSaid()=="!ready"){
READY=0}

if(READY==0){
if(clk("advert")){
  concmd("say /advert Need an admin? Say !admin to have one brought to you!")
timer("advert", 50000)
}

}

if(owner():lastSaid():lower()=="!return"){owner():tele(entity():pos())}
