Code (super simple)

Résolu
Lolobrain Messages postés 7 Statut Membre -  
yg_be Messages postés 23437 Date d'inscription   Statut Contributeur Dernière intervention   -
Il y as une erreur ligne 49 l'erreur est 'end' expected near '<aof>' et je n'arrive pas a comprendre d'ou elle vient. Cordialement, et merci d'avance pour vos réponse ^^

2 réponses

  1. yg_be Messages postés 23437 Date d'inscription   Statut Contributeur Dernière intervention   Ambassadeur 1 588
     
    bonjour,
    aof ou eof?
    de quel langage s'agit-il?
    peux-tu partager du texte et pas une image? en utilisant les balises:https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code
    0
    1. yg_be Messages postés 23437 Date d'inscription   Statut Contributeur Dernière intervention   1 588
       
      ajoute peut-être une ligne à la fin.
      0
    2. Lolobrain Messages postés 7 Statut Membre > yg_be Messages postés 23437 Date d'inscription   Statut Contributeur Dernière intervention  
       
      Le langage est du lua et voila le code. L'erreur c'est eof et pas aof désoler

      -- A basic monster script skeleton you can copy and modify for your own creations.
      comments = {"L'ombre s'acharnent sur toi.", "L'ombre se sent superieur.", "L'ombre fait une choses\rincomprensible."}
      commands = {"Rire", "Parler", "[color:ff0000]????"}
      randomdialogue = {"Random\nDialogue\n1.", "Random\nDialogue\n2.", "Random\nDialogue\n3."}

      sprite = "poseur" --Always PNG. Extension is added automatically.
      name = "une ombre"
      hp = 1000
      atk = 1
      def = -1
      check = "C'est une ombre..."
      dialogbubble = "right" -- See documentation for what bubbles you have available.
      canspare = false
      cancheck = true
      talkcount = 0
      hitcount = 0

      -- Happens after the slash animation but before
      function HandleAttack(attackstatus)
      if attackstatus == -1 then
      -- player pressed fight but didn't press Z afterwards
      else
      end
      if hp == 1000 then -- player did actually attack
      hitcount = 1
      end

      -- This handles the commands; all-caps versions of the commands list you have above.
      function HandleCustomCommand(command)
      SetGlobal("wavetype", command)
      if command == "RIRE" then
      BattleDialog({"L'ombre te trouve bizare."})
      elseif command == "PARLER" then
      BattleDialog({"L'ombre ne comprend pas."})
      elseif command == "[COLOR:FF0000]????" then
      if hitcount == 1 then
      BattleDialog({"[color:ff0000]Tu tente de faire un truc"})
      CurentDialog = {"[color:ff0000]Tu n'y arrive pas"}
      elseif talkcount == 0 then
      talkcount = talkcount + 1
      BattleDialog({"[color:ff0000]Tu fais un truc."})
      CurentDialog = {"[color:ff0000]Pourquoi tu as fait ca ?!?"}
      elseif talkcount == 1 then
      talkcount = talkcount + 1
      BattleDialog({"[color:ff0000]Tu refais quelque chosse"})
      CurentDialog = {"[color:ff0000]ARRETE !?!"}
      end
      end
      end
      0
    3. yg_be Messages postés 23437 Date d'inscription   Statut Contributeur Dernière intervention   1 588 > Lolobrain Messages postés 7 Statut Membre
       
      l'indentation n'est pas correcte, mais ne manque-t-il pas un
      end
      pour terminer la déclaration de la fonction HandleAttack?
      0
    4. yg_be Messages postés 23437 Date d'inscription   Statut Contributeur Dernière intervention   1 588 > Lolobrain Messages postés 7 Statut Membre
       
      "eof" = "end of file", = "fin de fichier"

      le message d'erreur indique qu'il attend un "end" et qu'il arrive à la fin du fichier.
      autrement dit, il manque un "end"
      0
    5. Lolobrain Messages postés 7 Statut Membre > yg_be Messages postés 23437 Date d'inscription   Statut Contributeur Dernière intervention  
       
      justement je ne vois pas ou le mettre le end x) (je suis nul j'ai commencer a coder il y as 2 h)
      0