+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: E2 Killer / Drone

  1. #1
    Wire Amateur Bmth-Sage's Avatar
    Join Date
    Sep 2009
    Posts
    58

    Default E2 Killer / Drone Help Please

    Sup guys found this one e2 off a friend a while back but felt like editing it a little
    i added print and Chip setcolor but i wanted some help making the chat hidden, a way to transfer ownership like balls of steel and to set the material to a defined mat when you slap the chip on a prop.I didn't code this e2 but did some modification just looking for some help adding these few features.




    BmthBot
    Code:
    @name BmthBot
    @outputs On Mode:string Spin SpinDrag Drag Stabilize Orbit Height Mass Flash
    
    @persist TE:entity TV:vector SV:vector OrbitRadius OrbitSpeed Material:string Color:vector4
    
    if (first()) {
        
    #Hide the chip
    
        entity():setColor(0,0,0,160)
    
        runOnTick(1)
    
        runOnChat(1)
            print("You are using BmthBot, Modded by Bmthrules and the guys at wiremod.com")
    
            print("Command's Are /spin /me /flash /on /off /orbit !playername")
            
        }
    
    runOnTick(1)
    
    runOnChat(1)
    
    ######################
    
    ####Variable Setup####
    
    ######################
    
    E1 = entity()
    
    EE = (E1:isWeldedTo() ? E1:isWeldedTo() : E1)
    
    EV = EE:massCenter(),ER=EE:right(),EF=EE:forward(),EU=EE:up(),O = owner()
    
    Lev = EE:inertia():length()
    
    
    
    ###########################
    
    ####Command Recognition####
    
    ###########################
    
    if (chatClk(O)) {
    
    LSA = O:lastSaid()
    
    LS = LSA:sub(2,LSA:length()):explode(" ")
    
    LS0 = LSA:index(1)
    
    LS1 = LS:string(1)
    
    LS2 = LS:string(2)
    
    LS3 = LS:string(3)
    
    LS4 = LS:string(4)
    
    LS5 = LS:string(5)
    
    
    
    if (LS0=="/") {
    
    if ((LS1 == "on")|(Mode == "throw")) {On = 1}
    
    elseif (LS1 == "off") {On = 0}
    
    
    
    if (LS1 == "kill") {selfDestructAll()}
    
    if (LS1 == "stay") {Mode="",SV=EV}
    
    if (LS1 == "me") {Mode="me"}
    
    if (LS1 == "cross") {Mode = "cursor"}
    
    if (LS1 == "throw" & Mode == "me") {
    
    Mode = "throw"
    
    On = 0
    
    EE:applyForce((O:eye()*3000-EE:vel())*EE:mass())
    
    }
    
    if (LS1 == "flash") {Flash = !Flash}
    
    if (LS1 == "spin") {Spin = !Spin}
    
    if (LS1 == "stab") {Stabilize = !Stabilize}
    
    if (LS1 == "orbit") {Orbit=!Orbit}
    
    if (LS1 == "orbitradius") {
    
    OrbitRadius = min(abs(LS2:toNumber()),1000)
    
    print("Orbiting at a radius of: " + toString(OrbitRadius))
    
    }
    
    if (LS1 == "orbitspeed") {
    
    OrbitSpeed = clamp(LS2:toNumber(),-360*4,360*4)
    
    print("Orbiting at a speed of: " + toString(OrbitRadius))
    
    }
    
    if (LS1 == "h") { #Height
    
    Height = clamp(LS2:toNumber(),-1000,1000)
    
    print("Height changed to: " + toString(Height))
    
    }
    
    i
    
    print("Spin drag set to: " + toString(SpinDrag))
    
    }
    
    if (LS1 == "setmat") {Material = LS2, EE:setMaterial(Material)}
    
    if (LS1 == "setcolor") {
    
    Color = vec4(LS2:toNumber(),LS3:toNumber(),LS4:toNumber(),(LS5!="" ? LS5:toNumber() : Color:w()))
    
    E1:setColor(Color)
    
    EE:setColor(Color)
    
    Flash=0
    
    }
    
    if (LS1 == "setmass") {Mass = LS2:toNumber()}
    
    if (LS1 == "soundplay") {soundPlay(0,0,LS2)}
    
    if (LS1 == "soundstop") {soundStop(0)}
    
    }
    
    if (LS0 == "!") {
    
    if (LS1 == "") {
    
    findIncludeClass("npc_*")
    
    findIncludeClass("player")
    
    findExcludePlayer(O)
    
    Fsphere = findInSphere(O:aimPos(), 10000)
    
    if (Fsphere > 0) {
    
    TE = findClosest(O:aimPos())
    
    Mode="attack"
    
    if (TE:isPlayer()) {
    
    print("Attacking " + TE:name())
    
    } elseif (TE:isNPC()) {
    
    print("Attacking " + TE:type())
    
    }
    
    } else {
    
    Mode="me"
    
    }
    
    } else {
    
    Name = LS1
    
    TE = findPlayerByName(Name)
    
    Mode="attack"
    
    }
    
    }
    
    if (LS0 == "*") {
    
    if (LS1 == "") {
    
    findIncludeClass("npc_*")
    
    findIncludeClass("player")
    
    findExcludePlayer(O)
    
    Fsphere = findInSphere(O:aimPos(), 50000)
    
    if (Fsphere > 0) {
    
    TE = findClosest(O:aimPos())
    
    Mode="follow"
    
    if (TE:isPlayer()) {
    
    print("Following " + TE:name())
    
    } elseif (TE:isNPC()) {
    
    print("Following " + TE:type())
    
    }
    
    } else {
    
    Mode="me"
    
    }
    
    } else {
    
    Name = LS1
    
    TE = findPlayerByName(Name)
    
    Mode="follow"
    
    }
    
    }
    
    }
    
    if ((Mode=="throw")&(EE:vel():length() < 50)) {
    
    Mode = "me"
    
    On = 1
    
    }
    
    if (clk("B")) { #for exiting attack mode
    
    Mode="me"
    
    if ((EE:type() == "prop_physics") | (EE == entity())) {Stabilize = 1}
    
    }
    
    
    
    #############################
    
    ####First execution setup####
    
    #############################
    
    if (first()) {
    
    On = 1
    
    Mode = ""
    
    Height = round(EE:boxSize():length()/2 + 50)
    
    SV = EV + vec(0,0,Height)
    
    Drag = 10
    
    SpinDrag = 10
    
    Mass = max(100,EE:mass())
    
    Color = vec4(255,255,255,255)
    
    OrbitRadius = 50
    
    OrbitSpeed = 90
    
    Stabilize = (EE:type() == "prop_physics") | (EE == entity())
    
    print("Height set to: " + toString(Height))
    
    print("Drag set to: " + toString(Drag))
    
    print("Spin Drag set to: " + toString(SpinDrag))
    
    if (1) {
    
    concmd("echo -----------------------------------------------------------------")
    
    concmd("echo Instructions:")
    
    concmd("echo Step 1: Slap it on any random prop you want")
    
    concmd("echo Step 2: Use the following commands to manipulate that prop at your will. (type in chat)")
    
    concmd("echo === COMMANDS ===")
    
    concmd("echo /on OR /off > > > > | Obvious!")
    
    concmd("echo ! OR ![name]> > > > | Attack the closest player or specified name.")
    
    concmd("echo * OR *[name]> > > > | Follow the closest player or specified name.")
    
    concmd("echo /stay > > > > > > > | Causes the prop to stay in place.")
    
    concmd("echo /me > > > > > > > > | Causes the prop to float above your head.")
    
    concmd("echo /cross> > > > > > > | Causes the prop to follow your crosshair.")
    
    concmd("echo /orbit> > > > > > > | Causes the prop to move in a circle.")
    
    concmd("echo /orbitradius> > > > | Set the radius used for /orbit.")
    
    concmd("echo /orbitspeed > > > > | Set the speed used for /orbit. (degrees per second)")
    
    concmd("echo /h Number > > > > > | Change the height.")
    
    concmd("echo /spin > > > > > > > | Causes the prop to spin.")
    
    concmd("echo /sd Number> > > > > | Change the spin drag.")
    
    concmd("echo /d Number > > > > > | Change the air drag. (higher = slower)")
    
    concmd("echo /stab > > > > > > > | Toggles automatic stabilization.")
    
    concmd("echo /setmass Number > > | Set the mass of the object.")
    
    concmd("echo /setcolor # # # # > | Set the color using RGBA format, use values between 0 and 255. A/Alpha is optional.")
    
    concmd("echo /setmat Material> > | Set the material of the prop to the specified material.")
    
    concmd("echo /flash> > > > > > > | Make the prop flash colors (toggles).")
    
    concmd("echo /soundplay [file] > | Plays specified sound.")
    
    concmd("echo /soundstop> > > > > | Stops sound if one is playing.")
    
    concmd("echo ===========")
    
    concmd("echo |")
    
    concmd("echo -----------------------------------------------------------------")
    
    print("Instructions printed to console.")
    
    } else {
    
    print("Paste \"wire_expresion2_concmd 1\" into console to get instructions printed to console")
    
    }
    
    print("Prop control starting.")
    
    }
    
    #########################
    
    ####Command Execution####
    
    #########################
    
    if (On&tickClk()) {
    
    EE:setMass(Mass)
    
    Circle = (Orbit ? vec(1,0,0):rotate(0,curtime()*-OrbitSpeed,0) * OrbitRadius : vec())
    
    if (Mode=="") {TV = SV + Circle}
    
    if (Mode=="cursor") {
    
    rangerFilter(EE)
    
    rangerFilter(entity())
    
    rangerFilter(O)
    
    Aimpos=rangerOffset(10^4,O:shootPos(),O:eye()):position()
    
    TV = Aimpos + vec(0, 0, Height) + Circle
    
    }
    
    if (Flash) {EE:setColor(randint(0,255),randint(0,255),randint(0,255))}
    
    if (Mode=="me") {TV = O:shootPos() + vec(0, 0, Height) + Circle}
    
    if (Mode=="attack") {
    
    if (TE:health()>0) {
    
    TV=TE:pos()+vec(0,0,TE:height()/2)
    
    } else {
    
    if (EE:health() > 0) {
    
    #Slam into ground
    
    timer("B", 250)
    
    TV = vec(0, 0, -10^10)
    
    } else {
    
    #Bring back to you
    
    timer("B", 10)
    
    TV = EV
    
    }
    
    }
    
    }
    
    if (Mode == "follow") {
    
    if (TE:health()>0) {
    
    TV = TE:shootPos() + vec(0, 0, Height) + Circle
    
    } else {
    
    Mode = "me"
    
    }
    
    }
    
    EE:applyForce(((TV - EV)*(Mode!="attack" ? 10 : 10000) - EE:vel()*Drag/10)*EE:mass())
    
    if(EE:type() != "prop_ragdoll") {
    
    if (Stabilize) {EE:applyAngForce((-EE:angles()*25 - EE:angVel()*5):setYaw(0)*Lev)}
    
    EE:applyAngForce(ang(0, -360*Spin - EE:angVel():yaw()*5*(Spin ? SpinDrag / 10 : Stabilize), 0)*Lev)
    
    }
    
    }
    Last edited by Bmth-Sage; 12-23-2009 at 07:23 PM. Reason: Threw in a few errors so minges well you know.

  2. #2
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default Re: E2 Killer / Drone Help Please

    Quote Originally Posted by bmthrules View Post
    i added print and Chip setcolor but i wanted some help making the chat hidden, a way to transfer ownership like balls of steel and to set the material to a defined mat when you slap the chip on a prop.
    Change the O variable entity to that of the new owner.
    Use E:setMaterial(S).

  3. #3
    Wire Sofaking Wizard of Ass's Avatar
    Join Date
    May 2009
    Location
    Germany Bremerhaven
    Posts
    1,044

    Default Re: E2 Killer / Drone Help Please

    Quote Originally Posted by bmthrules View Post
    blabla ...like balls of steel... blabla
    No more steel please I really fed up with that ****.
    seriously getting serious

  4. #4
    Wire Amateur Bmth-Sage's Avatar
    Join Date
    Sep 2009
    Posts
    58

    Default Re: E2 Killer / Drone

    Really -_- it not like im going around saying HEY GUYS MAKE MEH SOME MINGE AMMO! Im just using this as a start for E2 and i need in code examples lyinginbed i tried the E:Setmaterial put it gives me a Weird error of (})

  5. #5
    Wire Sofaking Wizard of Ass's Avatar
    Join Date
    May 2009
    Location
    Germany Bremerhaven
    Posts
    1,044

    Default Re: E2 Killer / Drone

    Quote Originally Posted by bmthrules View Post
    Really -_- it not like im going around saying HEY GUYS MAKE MEH SOME MINGE AMMO! Im just using this as a start for E2 and i need in code examples lyinginbed i tried the E:Setmaterial put it gives me a Weird error of (})
    Line?
    seriously getting serious

  6. #6
    Wire Amateur Bmth-Sage's Avatar
    Join Date
    Sep 2009
    Posts
    58

    Default Re: E2 Killer / Drone

    EDIT: Fixed the Mats and I Hidechat(1) every command adding hints right now still need help with giving ownership code.
    Last edited by Bmth-Sage; 12-13-2009 at 08:04 PM.

  7. #7
    Wire Amateur Bmth-Sage's Avatar
    Join Date
    Sep 2009
    Posts
    58

    Default Re: E2 Killer / Drone

    /needshelpwithownershipcode

  8. #8
    ส็็็็็็็็็็็็็็็็ส็็ ็็็็็ Dav1d's Avatar
    Join Date
    May 2009
    Posts
    1,118

    Default Re: E2 Killer / Drone

    Just make it check if you said !owner or whatever, then do:
    Code:
    if(LS1 = "!owner" & LS2){
         if(findPlayerByName(LS2){O = findPlayerByName(LS2)}
    }
    Find player by name returns the entity of the person's name you put in (doesn't have to be exact, for example putting in "uber" would work for trying to find a person called "uber1337"). All this code really does is check to see if you said !owner and a name, then change the ownership to that player if they exist. The console commands and print, however will not be transferred.

  9. #9
    Wire Sofaking Tasuit's Avatar
    Join Date
    Jan 2009
    Location
    Sønderjylland, Denmark
    Posts
    582
    Blog Entries
    9

    Default Re: E2 Killer / Drone

    Please, enough with these drones already.

    Creator of the Unofficial servers

  10. #10
    Wire Sofaking oenmaster's Avatar
    Join Date
    Jan 2008
    Location
    fak where is my satnav (NL)
    Posts
    717
    Blog Entries
    1

    Default Re: E2 Killer / Drone Help Please

    Quote Originally Posted by Wizard of Ass View Post
    No more steel please I really fed up with that ****.
    high five!!!!

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. my fast accurated turret(assist or npc killer)
    By MPAP in forum Finished contraptions
    Replies: 0
    Last Post: 08-22-2009, 08:08 AM
  2. NPC Killer Drone
    By daemoz in forum Finished contraptions
    Replies: 4
    Last Post: 07-30-2009, 02:59 AM
  3. Killer satelite
    By Rasputin in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 11-14-2007, 08:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots