+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Need help with Expression 2

  1. #11
    Banned Nicolai1's Avatar
    Join Date
    Nov 2008
    Location
    Denmark.
    Posts
    1,251

    Default Re: Need help with Expression 2

    chatClk() checks if the current execution was caused by runOnChat(1)...




    Quote Originally Posted by malum View Post
    If you dont use chatClk() runOnChat() runs when ANYONE says something.
    What kind of bullshit is that?

  2. #12
    Wire Noob dingodk's Avatar
    Join Date
    May 2009
    Posts
    4

    Default Re: Need help with Expression 2

    Thank you, all.

    But can someone write the script what i should write?

  3. #13
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: Need help with Expression 2

    Quote Originally Posted by Nicolai1 View Post
    What kind of bullshit is that?
    The truth.

    Quote Originally Posted by dingodk View Post
    But can someone write the script
    That is already posted?
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  4. #14
    Wire Noob dingodk's Avatar
    Join Date
    May 2009
    Posts
    4

    Default Re: Need help with Expression 2

    Originally posted by: l3ulletje
    That is already posted?
    Yeah, but where should i place the chatClk() and what does that command?

  5. #15
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: Need help with Expression 2

    Quote Originally Posted by Lyinginbedmon View Post
    [highlight=E2]runOnChat(1)
    if(lastSaid() == "hi"){concmd("say hello")}[/highlight]
    Does what you are asking for:
    Quote Originally Posted by dingodk View Post
    Yeah, but i need it to do when someone say "hi", the E2 says "hello" or something, i have get it to work but it doesnt check it all the time it only check it when i upload it again. Please help me.
    Unless it's part of a bigger code.

    To include chatClk() you need:
    • The above code.
    • chatClk()
    • &
    • Documentation
    • Optional: owner() If you it only needs to react to you.

    Go and try.
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  6. #16
    Wire Amateur Playzr's Avatar
    Join Date
    May 2007
    Location
    UK
    Posts
    93

    Default Re: Need help with Expression 2

    I didnt read all that above but fortunately I've already made something that does exactly what you want. This is a cut down version with just 2 examples, it also has all that runOnChat and clk stuff you need. The full version has like 100 preset sentences and instrumental stuff.

    Code:
    @name Playzr's Talkatron Tutorial
    @inputs
    @outputs 
    @persist Said:string
    @trigger all
    
    interval(1)
    runOnChat(1)
    
    # E:lastSaid()  S  Returns what the given player last said
    # E:lastSaidWhen() N Returns when the given player last said something
    # lastSpoke() E Returns the entity of the last player to speak
    # runOnChat(N) 1 will cause the chip to run on chat events, 0 stops the chip from running on chat events, only needs to be called once (not every execution)
    # chatClk() N Returns 1 if the chip is being executed because of a chat event, 0 otherwise
    # chatClk(E) N Returns 1 if the chip is being executed because of a chat event by the given player, 0 otherwise 
    # soundPlay(N,N,S)   soundPlay(int Index, int Duration, string Path to File) 
    # soundPitch(1, 100)
    
    if(chatClk(owner())){
        Said = owner():lastSaid():lower()
        soundPitch(1, 100)
        
        if(Said:find("where") & Said:find("?")){ owner():soundPlay(1,6,"vo/k_lab/kl_thenwhere.wav") }
        if(Said:find("dunno")){ owner():soundPlay(1,6,"vo/k_lab/kl_wishiknew.wav") }
    
    }

+ Reply to Thread
Page 2 of 2 FirstFirst 12

Tags for this Thread

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