Change wording on 'do script' loop?

Is there anyway I can adapt this so that when the player is thrown back into the loop after entering an incorrect keycode, the original message You step up to the keypad. Please enter the seven-digit code becomes Incorrect. Please try again ?

msg ("You step up to the keypad. Please enter the seven-digit code.")
get input {
  if (GetBoolean(player, "gotserum")) {
    msg ("The door slides open")
    MoveObject (player, corridor)
  }
  else if (result="Cancel" or result="cancel") {
    ShowRoomDescription
  }
  else {
    msg ("Incorrect keycode")
    do (keypadCommand, "script")
  }
}

Never mind, got there.

firsttime {
  msg ("Please enter the seven-digit number code.")
}
otherwise {
  if (GetBoolean(player, "gotserum")) {
    msg ("Please enter the seven-digit number code.")
  }
  else {
    msg ("Incorrect.Please try again.")
  }
}
get input {
  if (GetBoolean(player, "gotserum")) {
    msg ("The door slides open")
    MoveObject (player, corridor)
  }
  else if (result="Cancel" or result="cancel") {
    ShowRoomDescription
  }
  else {
    do (keypadCommand, "script")
  }
}

This accounts for them coming away from the keypad, using the serum and going back, but it DOESN'T account for them leaving the keypad, failing to find the serum and then going back to the keypad to try again, so there's a possibility for:

use keypad >> "Please enter the seven-digit number code." >> 2343234 >> "Incorrect. Please try again." >> cancel >> use keypad >> "Incorrect. Please try again."

Which doesn't make sense and moreso is confusing.

I need the loop to give: "Incorrect. Please try again." but if the player comes away from keypad and goes back, to give: "Please enter the seven-digit number code."


Congrats! Keep it up! You're learning quest/coding more and more (your brain is starting to be trained in the logic/thinking/minset that is needed and that's why/how you're able to find solutions on your own more and more), hehe :D


I didn't quite get there, hege, but thanks anyway.


ah... what do you need help with ??? I can try to help with it.


It's okay, hege, thanks.

I changed the wording of the initial message and it kind of works now.