@name Robotboy655's Bot
@persist Model:string Active Height Name:string Weight Perefix:string Rot OrbitPos:vector Time
@model models/hunter/plates/plate1x1.mdl

#Made by robotboy655
# BOT, REWRITE, BAD CODED, TO BE DELETEd

#Execution
runOnChat(1)
runOnTick(1)
#Execution

#Variables
Time++
Perefix = "!"
Model = "models/hunter/plates/plate1x1.mdl"
E = entity()
O = owner()
Pos = O:shootPos()
Said = O:lastSaid()
Arr = Said:explode(" ")
Arr1 = Arr:string(1)
Arr2 = Arr:string(2)
Arr3 = Arr:string(3)
Arr4 = Arr:string(4)
Arr5 = Arr:string(5)
Arr6 = Arr:string(6)
Arr7 = Arr:string(7)
Arr8 = Arr:string(8)
Arr9 = Arr:string(9)
Arr10 = Arr:string(10)
Everything = Said:right(Said:length()-Perefix:length()-Name:length()-Arr2:length()-2)
#Variables

#Duped
if(duped())
{
    hint("Robotboy655: My chips are for personal use!",5)
    selfDestruct()
}
#Duped

#First run
if(first())
{
    Name = "Bot"
    Height = 75
    Active = 1
    Weight = E:mass()
    Rot = 0
    OrbitPos = vec(0,0,0)
    
    hint("Hello! My name is "+Name+"!",5)
    hint(Name+": My height is "+Height+"!",5)
    hint(Name+": My mass is "+Weight+"!",5)
    hint(Name+": I'm activated!",5)
}
#First run

#Commands
if(tickClk())
{
    #Mouse attack
    if(O:weapon():type() == "weapon_crowbar" & O:keyAttack2())
    {
        Pos = O:aimPos()-vec(0,0,Height)
    }
    #Mouse attack
    
    #Float
    if(Active>=1)
    {
        E:applyForce(((Pos+vec(cos(Time)*OrbitPos:x(),sin(Time)*OrbitPos:y(),cos(Time)*OrbitPos:z())+vec(0,0,Height)-E:pos())*10-E:vel())*E:mass())
        E:applyAngForce((-E:angles():setYaw(Rot)*20-E:angVel())*E:mass())
    }
    else
    {
    }
    #Float
    
    #Check model
    if(E:model() == Model)
    {
    }
    else
    {
        hint(Name+": Please change my model to \""+Model+"\"!",5)
        concmd("wire_expression2_model "+Model)
        selfDestruct()

    }
    #Check model
    
    #Check constraints
    if(E:isConstrained())
    {
        hint(Name+": I don't like to be constrained to anything!",5)
        selfDestruct()
    }
    else
    {
    }
    #Check constraints
    
    #Weight
    E:setMass(Weight)
    #Weight
}
elseif(chatClk())
{
    #Weight
    if(Said:find(Perefix+Name:lower()+" weight"))
    {
        if(Arr3:toNumber()>=0.0001 & Arr3:toNumber()<=50000)
        {
            Weight = Arr3:toNumber()
            hint(Name+": I weight "+Arr3+" now!",5)
        }
        else
        {
            hint(Name+": I can't weight like that!",5)
        }
    }
    #Weight
    
    #Height
    if(Said:find(Perefix+Name:lower()+" height"))
    {
        if(Arr3:toNumber() >=1)
        {
            Height = Arr3:toNumber()
            hint(Name+": Height set to "+Arr3+"!",5)
        }
        else
        {
            hint(Name+": I can't go to that height",5)
        }
    }
    #Height
    
    #Active
    if(Said:find(Perefix+Name:lower()+" active"))
    {
        Active=Arr3:toNumber()
        if(Active >= 1)
        {
            hint(Name+": I'm activated!",5)
        }
        elseif(Active <= 0)
        {
            hint(Name+": I'm deactivated!",5)
        }
    }
    #Active
    
    #Kill
    if(Said:find(Perefix+Name:lower()+" kill"))
    {
        hint(Name+": Why you are so rude with me?",5)
        selfDestructAll()
    }
    #Kill
    
    #Colour
    if (Said:find(Perefix+Name:lower()+" color"))
    {
        if( Arr6:toNumber() < 0 | Arr6:toNumber() > 255)
        {
            Arr6 = "255"
        }
        if( Arr5:toNumber() < 0 | Arr5:toNumber() > 255)
        {
            Arr5 = "255"
        }
        if( Arr4:toNumber() < 0 | Arr4:toNumber() > 255)
        {
            Arr4 = "255"
        }
        if( Arr3:toNumber() < 0 | Arr3:toNumber() > 255)
        {
            Arr3 = "255"
        }
        E:setColor(Arr3:toNumber(),Arr4:toNumber(),Arr5:toNumber(),Arr6:toNumber())
        hint(Name+": My color is "+Arr3:toNumber()+" red, "+Arr4:toNumber()+" green, "+Arr5:toNumber()+" blue and "+Arr6:toNumber()+" alpha now!",5)
    }
    #Colour
    
    #Name
    if(Said:find(Perefix+Name:lower()+" name"))
    {
        hint(Name+": My name is now "+Arr3+"!",5)
        Name = Arr3
    }
    #Name
    
    #Material
    if(Said:find(Perefix+Name:lower()+" material"))
    {
        if(Arr3)
        {
            E:setMaterial(Arr3)
            hint(Name+": My material is now "+Arr3+"!",5)
        }
        elseif(!Arr3)
        {
            E:setMaterial(Arr3)
            hint(Name+": My material is now default!",5)
        }
    }
    #Material
    
    #Say
    if(Said:find(Perefix+Name:lower()+" say"))
    {
        if(Arr3)
        {
            hint(Name+": "+Everything,5)
        }
        elseif(!Arr3)
        {
            hint(Name+": I can't say that!",5)
        }
    }
    #Say
    
    #Help
    if(Said:find(Perefix+Name:lower()+" help"))
    {
        hint(Name+": My commands are: weight, height, active, kill, colour, name, materail, say, rotation, orbit!",7)
    }
    #Help
    
    #Rotation
    if(Said:find(Perefix+Name:lower()+" rotation"))
    {
        Rot = Arr3:toNumber()
        hint(Name+": My rotation speed is now "+Arr3:toNumber(),5)
    }
    #Rotation
    
    #Orbit
    if(Said:find(Perefix+Name:lower()+" orbit"))
    {
        OrbitPos = vec(Arr3:toNumber(),Arr4:toNumber(),Arr5:toNumber())
        hint(Name+": My orbit is now ["+Arr3:toNumber()+", "+Arr4:toNumber()+", "+Arr5:toNumber()+"]",5)
    }
    #Orbit
}
#Commands
