Jump to content
  • 0

question and answer npc


Question

6 answers to this question

Recommended Posts

Posted
setarray .@Questions$[1],
"First question!",
"Second question!",
// etc.
"Last question";
setarray .@Answers$[1],
"First answer!",
"Second answer!",
// etc.
"Last answer";

set .@correct,0;
for(set .@i,1; .@i<=10; set .@i,.@i+1) {
mes "[Question "+.@i+"]";
mes .@Questions$[.@i];
input .@input$;
if (.@input$ == .@Answers$[.@i]) set .@correct, .@correct+1;
// Use the line below instead if case (capitals/non-capitals) does not matter
// if (compare(.@input$,.@Answers$[.@i])) set .@correct, .@correct+1;
next; }
mes "[score]";
mes "^FF0000"+.@correct+"^000000 correct of 10 total.";
if (.@correct > YOUR_NUMBER) {
// your script
}
close;

Posted

Either switch(select()) or input+conditional - you'll need to be more specific than that.

ex. same on the hunter quest exam. you need to answer all questions correctly. if im not mistaken it is a 10 questions? then you need to answer it correctly for you to able to make an change job right? but i just want to make an simple question and answer scripts.

Posted

thanks for this.

how about you need to imput the correct answer? example you input the correct answer but if you put a wrong answer. he will continue the question until it finish the 10 questions. but in the end the summary will appear. your score will show. if you get 8 out of 10 you'll pass. but if you got 7 below you failed.

Posted (edited)

setarray .@Questions$[1],
"First question!",
"Second question!",
// etc.
"Last question";
setarray .@Answers$[1],
"First answer!",
"Second answer!",
// etc.
"Last answer";

set .@correct,0;
for(set .@i,1; .@i<=10; set .@i,.@i+1) {
mes "[Question "+.@i+"]";
mes .@Questions$[.@i];
input .@input$;
if (.@input$ == .@Answers$[.@i]) set .@correct, .@correct+1;
// Use the line below instead if case (capitals/non-capitals) does not matter
// if (compare(.@input$,.@Answers$[.@i])) set .@correct, .@correct+1;
next; }
mes "[score]";
mes "^FF0000"+.@correct+"^000000 correct of 10 total.";
if (.@correct > YOUR_NUMBER) {
// your script
}
close;

can you make sa sample script and post it to http://upaste.me

Edited by Brynner

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...