How can i make a simple talk to npc script?

Discussion in 'Tutorials & Source Codes' started by LikeANinja, Oct 26, 2018.

  1. LikeANinja

    LikeANinja United States Fanatic Hacker

    Post Count:
    214
    Likes Received:
    13
    Stats
    As title says thank you (:
    Looking to learn how to script as well
     

    Mr. Ad Advertisement

     
  2. Scarlion

    Scarlion United States Fanatic Hacker

    Post Count:
    287
    Likes Received:
    1,933
    Stats
    if you are talking about doing it with terminal scripter its rly easy.

    just create a map of letters to virtual key codes (a dict with keys being letters and values as the virtual key codes).
    Then type out your msg/msgs in a text file or variables in a script.
    assuming your message is a string:
    Code:
    #Import terminal key press module & func, idk what its called anymore lets call the function key.press()
    key_map = {'a':something, 'A': something ...  }
    
    msg = '''hi i'm bob'''
    
    key.press('enter')
    [key.press(key_map[char]) for char in msg]
    key.press('enter')
    
    otherwise similar concept but use auto hot key if this doesn't work.
     
  3. Marik

    Marik Israel Mahorori #1 fan

    Post Count:
    515
    Likes Received:
    1,898
    Stats
    or use the built in terminal command for talking with NPC.

    import Character, GameState

    if GameState.IsInGame():
    Character.TalkToNpc(NPCID)

    you can fetch the NPC id by talking to it and its id will show up in the debug window.
     
    Scarlion likes this.
  4. Scarlion

    Scarlion United States Fanatic Hacker

    Post Count:
    287
    Likes Received:
    1,933
    Stats
    i need to update myself on terminal funcs lmao.
     

Share This Page

  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies.
    Dismiss Notice
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies.
    Dismiss Notice