looking for a little help for a script to talk through npc dialogue

Discussion in 'Tutorials & Source Codes' started by andrewkwon, Apr 23, 2019.

Discuss looking for a little help for a script to talk through npc dialogue in the Tutorials & Source Codes area at GameKiller.net

  1. andrewkwon

    andrewkwon United States Premium Premium

    Post Count:
    19
    Likes Received:
    0
    Stats
    import Character
    import Context
    import DataType
    import Field
    import Inventory
    import Key
    import Npc
    import Packet
    import Quest
    import Terminal
    import time
    import Packet
    time.sleep(1)
    Character.TalkToNpc(9201097)
    time.sleep(3)
    Npc.RegisterSelection("Badge Redemption")
    time.sleep(3)
    Npc.RegisterSelection("I'd like to turn in items for a bounty.")
    time.sleep(3)
    Npc.RegisterSelection("Crimson Heart: x2")
    time.sleep(3)


    #so essentially I want to talk to a npc and select the proper dialogue in order to turn in some items.
    The problem with the script here i tried to make (new to scripting) is that once I talk to the npc, it simply repeats over and over the function of talking to the npc instead of selecting "Badge Redemption" option in the dialogue. Was wondering what i did wrong there for the script to get stuck like that
     

    Mr. Ad Advertisement

     
  2. Retard

    Retard Israel Legendary

    Post Count:
    1,023
    Likes Received:
    406
    Stats
    Hey, I would love to help you with this but going back and forth in a forum post will just take too long.
    Add me on discord! Retard#6779
     
  3. Poops

    Poops United States Droplet Farmer Premium

    Post Count:
    362
    Likes Received:
    446
    Stats
    Character.TalkToNpc(npcid)
    Npc.ClearSelection()
    -all the registerselections after another-
    Npc.RegisterSelection(lines)
    time.sleep(few seconds)
     
  4. Retard

    Retard Israel Legendary

    Post Count:
    1,023
    Likes Received:
    406
    Stats
    We can't get it to work, there are 3 diaglogues, the third one is very lengthy, and it gets stuck there.
    Code:
    import Npc, time, Character, GameState
    
    if GameState.IsInGame():
    ----Character.TalkToNpc(9201097)
    ----Npc.ClearSelection()
    ----Npc.RegisterSelection("Badge")
    ----Npc.RegisterSelection("I'd like")
    ----Npc.RegisterSelection("Crimson Heart: x2")
    ----time.sleep(1)
    ----print("done")
    
    We tried many variations of the last dialogue (C, Crimson, Crimson Heart....)
    Any idea to what's failing?
     
  5. Poops

    Poops United States Droplet Farmer Premium

    Post Count:
    362
    Likes Received:
    446
    Stats
    Can you show me a SS of the 3rd chat
     
  6. Retard

    Retard Israel Legendary

    Post Count:
    1,023
    Likes Received:
    406
    Stats

    The thing we want to choose is 2 choices below the lowest one you can see, it's solely "Crimson Heart: x2"
     
  7. Poops

    Poops United States Droplet Farmer Premium

    Post Count:
    362
    Likes Received:
    446
    Stats
    Can I get a SS of that part.
     
  8. Retard

    Retard Israel Legendary

    Post Count:
    1,023
    Likes Received:
    406
    Stats

    That's just a little scrolled down, you can see it at the bottom
     
  9. Poops

    Poops United States Droplet Farmer Premium

    Post Count:
    362
    Likes Received:
    446
    Stats
    Can I get a SS of the 1st and 2nd chat as well.
     
  10. Retard

    Retard Israel Legendary

    Post Count:
    1,023
    Likes Received:
    406
    Stats
    1st chat :
    2nd chat :

    We're going in the script for SECOND THIRD
    (Badge, I'd)
    I think it's because the phrase "Crimson Heart: x2" shows so many times in different variations, for example, at the end of one line "Crimson Heart: x25", and at the end of another "Crimson Heart: x20", I think the function doesn't look for the whole string by itself first, and only then random appearances.
    Another example, in the second dialogue (that starts with "I'd"), I tried to start it with the letter i (upper case), and it didn't work, probably because it appeared more than once randomly somewhere in the dialogue.
     
  11. Poops

    Poops United States Droplet Farmer Premium

    Post Count:
    362
    Likes Received:
    446
    Stats
    Yah. I dont think it's possible to reach the one you want selected.
    You can probably select it by sending packet.
     
  12. Retard

    Retard Israel Legendary

    Post Count:
    1,023
    Likes Received:
    406
    Stats
    Tried that, but it either doesn't do anything, or crashes me KEK
     
  13. Poops

    Poops United States Droplet Farmer Premium

    Post Count:
    362
    Likes Received:
    446
    Stats
    I just tried making selection to legion npc via packet and it works.
    0x0166 is the header
     
  14. Retard

    Retard Israel Legendary

    Post Count:
    1,023
    Likes Received:
    406
    Stats
    I don't get a packet with that header when sniffing and choosing that option, the packet I suspect is the one has the header 0x0332
     
  15. Poops

    Poops United States Droplet Farmer Premium

    Post Count:
    362
    Likes Received:
    446
    Stats
    If packet doesn't work then they will likely have to manual it or use a macro keyboard to send keys.
    Pretty sure terminals key presses dont work on NPC
     
  16. Retard

    Retard Israel Legendary

    Post Count:
    1,023
    Likes Received:
    406
    Stats
    Yea they don't work on NPC, that's a shame...
    Thanks for the awesome help tho!
     
    Poops likes this.

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