Jump to content
  • 0

Help with fact event


Newbie Scripter

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  11/25/13
  • Last Seen:  

Prontera,124,168,5	script	Facts Event	917,{
end;
function DefineQuestion; function GetQuestion; function GetAnswer;

OnMinute20:
OnMinute42:
OnMinute00:
    announce "The Fact Event will begin in 3 minutes.",bc_all | bc_blue;
    announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue;
	sleep 0
    announce "The Fact Event will begin in 2 minutes.",bc_all | bc_blue;
    announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue;
	sleep 0000;
    announce "The Fact Event will begin 1 minute.",bc_all | bc_blue;
    announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue;
	sleep 0000;
    announce "The Fact Event has begun!",bc_all | bc_blue;
    announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue;
L_loop:
	do
		set .@i, rand( .numQuestions ); // Randomly picks a fact.
	while( .Q_session & 1 << .@i && .Q_session && .count < .numQuestions );
	set .Q_session, .Q_session | 1 << .@i;// max 32 questions
	if( !.count ) {
		npctalk "Please answer all my question about fact:";
		sleep 5;
		npctalk "If your answer is true, you will obtain some YggBerry!";
	}
	.count++;
	sleep 4000;
	npctalk "Fact: " + GetQuestion(.@i);
	defpattern 1, "([^:]+):.*\\s"+ GetAnswer( .@i ) +"(.*)", "Right";
	activatepset 1;
	initnpctimer;
	end;
OnTimer30000:
	npctalk "Sorry, You take so long time. GOOGLE IT LOL to find the answer.";
	goto L_continue;
Right:
	npctalk "The answer is true. Good job man !!";
	getitem .rewarditem, rand( 1,10 ); // Randomly picks from 1 to 10.
L_continue:
	deletepset 1;
	stopnpctimer;
	if( .count < .max_questions ) goto L_loop; // loop 10 questions
	.count = 0; // end of event
	.Q_session = 0;
	npctalk "End of the event. Thanks for participating in this event ^^";
	end;

function DefineQuestion {
	set .@a, .numQuestions % 128;
	set .@b, .numQuestions / 128;

	setd(".question_" + .@a + "$[" + .@b + "]", getarg(0));
	setd(".answer_" + .@a + "$[" + .@b + "]", getarg(1));
	set .numQuestions, .numQuestions + 1;
	return;
}
function GetQuestion {
	return getd(".question_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]");
}
function GetAnswer {
	return getd(".answer_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]");
}
OnInit:
	set .EventON, 0;
	set .rewarditem, 7915;	//Ygg berry~
	.max_questions = 10;	// 10 questions if more than 10 questions are defined
	DefineQuestion("Do you know that The _____ bear is not really a bear, but is really related to the kangaroo and the wombat.","Koala");
	DefineQuestion("Do you know that The word -_____- comes from the Greek word -kometes- meaning long hair and referring to the tail ","comet");
	DefineQuestion("Do you know that Before air conditioning was invented, white cotton __________ were put on furniture to keep the air cool. ","slipcovers");
	DefineQuestion("Do you know that Instead of a Birthday Cake, many Russian children are given a Birthday ___ ","Pie");
	DefineQuestion("Do you know that Colgate faced a big obstacle marketing toothpaste in Spanish speaking countries. _______ translates into the command -go hang yourself.- ","Colgate");
	DefineQuestion("Do you know that The ________ cartoon was the first thirty-minute cartoon to be aired during prime time ","Flintstones");
	DefineQuestion("Do you know that The abbreviation ____ for the word Christmas is of Greek origin. ","Xmas");
	DefineQuestion("Do you know that ____ has more English speakers than the United States ","China");
	DefineQuestion("Do you know that When _____ Elizabeth I of England died she owned over 3,000 gowns ","Queen");
	DefineQuestion("Do you know that In one day 34,000 ______ die from causes that are related to poverty and hunger ","children");
	DefineQuestion("Do you know that The only 15 letter word that can be spelled without repeating a letter is [__________.] ","uncopyrightable");
	DefineQuestion("Do you know that Some _____ worms will eat themselves if they cannot find food. This type of worm can still survive after eating up to 95% of its body weight ","Ribbon");
	DefineQuestion("Do you know that There is an area located off the south-eastern Atlantic coast of the United States called the -Bermuda _______.","Triangle");
	DefineQuestion("Do you know that in ____, a wrestling match in Stockholm between Finn Alfred Asikainen and Russian Martin Klein lasted more than 11 hours. Klein eventually won.","1912");
	DefineQuestion("Do you know that ______ are considered apes, not monkeys. The way to distinguish between an ape and a monkey is that apes do not have tails ","Gorillas");
	DefineQuestion("Do you know that _____ Lee was so fast, that they actually had to slow a film down so you could see his moves. That is the opposite of the normal","Bruce");
	DefineQuestion("Do you know that A 27 year old heir to a _____ empire was handed a ticket for 116,000 pounds for driving at 80 km/hr in a 40 km/hr zone.","sausage");
	DefineQuestion("Do you know that The first known American novelist to hand in a manuscript that was typed was ___ ___. ","Mark Twain");
	DefineQuestion("Do you know that In Belgium, there is a museum that is just for _________ ","strawberries");
	DefineQuestion("Do you know that A ______ with two mouths, two sets of teeth and two tongues was caught by Bob Bateman of Canada.","salmon");
	DefineQuestion("Do you know that ___________ x 111,111,111 = 12,345,678,987,654,321 ","111,111,111");
	DefineQuestion("Do you know that Pepsi originally contained ______, (the same stuff in pepcid AC) thus the name ","pepsin");
	DefineQuestion("Do you know that Annually, ____ that occur at home kill more Americans than all natural disasters combined ","fires");
	DefineQuestion("Do you know that The song -_____ ________- brings in about $2 million in licensing revenue to Warner Communications who hold the copyright to the song  ","Happy Birthday");
	DefineQuestion("Do you know that You can send a postcard from ____. There is a small town located in the Cayman Islands called -_____.-","Hell");
	DefineQuestion("Do you know that In the movie -_____- , 300,000 extras appeared in the funeral scene. Of the 300,000, approximately 100,000 received a small fee.","Gandhi");
	DefineQuestion("Do you know that In ____, a Japanese artist, Tadahiko Ogawa, made a copy of the Mona Lisa completely out of ordinary toast ","1983");
	DefineQuestion("Do you know that Over one million ___ ____ were sold in 1975, makine Gary Dahl, of Los Gatos, California, a millionaire. ","Pet Rocks");
	DefineQuestion("Do you know that The name ____ was made up for the book -Peter Pan.- ","Wendy");
	DefineQuestion("Do you know that The first ________ call from the White House was from Rutherford Hayes to Alexander Graham Bell ","telephone");
	DefineQuestion("Do you know that The reason _________ have circular stairways is from the days when the engines were pulled by horses.","firehouses");
	DefineQuestion("Do you know that By recycling just one glass ______, the amount of energy that is being saved is enough to light a 100 watt bulb for four hours","bottle");
	DefineQuestion("Do you know that One _____ vine can produce about 20 to 30 glasses of wine ","grape");
	DefineQuestion("Do you know that Some _____ have been known to put ants into their feathers because the ants squirt formic acid, which kills parasites ","birds");
	DefineQuestion("Do you know that The popular chocolate bar -____ Musketeers- got its name because when it was first introduced in 1932 there were three individual bars.","Three");
	DefineQuestion("Do you know that John Van Wormer invented paper milk _____ after dropping a bottle of milk one morning.","cartons");
	DefineQuestion("Do you know that ____ beef got its name because it's beef was preserved with pellets of salt that were the size of corn kernels.","Corned");
	DefineQuestion("Do you know that A ____ year old boy was the first person to survive the Horeshoe Falls (Niagara Falls) in just a life jacke","seven");
	DefineQuestion("Do you know that The reason why ____ gum is pink is because the inventor only had pink colouring left.","bubble");
	DefineQuestion("Do you know that Ninety-nine percent of ______ sold in the United States are for the sole purpose of decoration ","pumpkins");
	DefineQuestion("David McConnell started the California Perfume Company in 1886. Today the company is known as _____, ","Avon");
	DefineQuestion("Do you know that The most expensive perfume in the world is _____ VI, which was made by Arthur Burnham.","Parfum");
	DefineQuestion("The female ____ cannot lay eggs if she is alone. she must be able to see another _____.","pigeon");
	DefineQuestion("In ______, you can be fined for not using a shopping basket at a grocery store!","Holland");
	DefineQuestion("In West ______ if you run over an animal, you can legally take it home and cook it for dinner!","Virginia");
	DefineQuestion("It is _____ to purchase or consume Jack Daniel's Whiskey in the town in which it is produced!","illegal");
	DefineQuestion("The scientific term for the common _____ is lycopersicon lycopersicum, which means wolf peach.","tomato");
	DefineQuestion("The oldest almost-complete manuscript of the Bible still existing is the Codex Vaticanus, now held in the Vatican ______.","library");
	DefineQuestion("The word ____ appears 1855 times in the Bible.","Lord");
	DefineQuestion("The ____ is the first bird mention in the Bible. It appears in Genesis 8:7, when it is sent out from the ark by Noah to see if the flood waters have abated.","raven");
	DefineQuestion("Summer on ___ lasts for 21 years , but so does winter. ","Uranus");
	DefineQuestion("Hurricanes, tornadoes and bigger bodies of water always go _____ in the Southern Hemisphere and counter______ in the Northern Hemisphere.","clockwise");
	if( .numQuestions < .max_questions ) .max_questions = .numQuestions;
	end;
}

It doesn't work and that i want it to be answered near the npc like the disguise event.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  55
  • Reputation:   2
  • Joined:  08/18/13
  • Last Seen:  

Prontera,124,168,5	script	Facts Event	917,{
end;
function DefineQuestion; function GetQuestion; function GetAnswer;

OnMinute20:
OnMinute42:
OnMinute00:
    announce "The Fact Event will begin in 3 minutes.",bc_all | bc_blue;
    announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue;
	sleep 0
    announce "The Fact Event will begin in 2 minutes.",bc_all | bc_blue;
    announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue;
	sleep 0000;
    announce "The Fact Event will begin 1 minute.",bc_all | bc_blue;
    announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue;
	sleep 0000;
    announce "The Fact Event has begun!",bc_all | bc_blue;
    announce "The Event is being held in Event Room. Please use custom warper to go there.",bc_all | bc_blue;
L_loop:
	do
		set .@i, rand( .numQuestions ); // Randomly picks a fact.
	while( .Q_session & 1 << .@i && .Q_session && .count < .numQuestions );
	set .Q_session, .Q_session | 1 << .@i;// max 32 questions
	if( !.count ) {
		npctalk "Please answer all my question about fact:";
		sleep 5;
		npctalk "If your answer is true, you will obtain some YggBerry!";
	}
	.count++;
	sleep 4000;
	npctalk "Fact: " + GetQuestion(.@i);
	defpattern 1, "([^:]+):.*\\s"+ GetAnswer( .@i ) +"(.*)", "Right";
	activatepset 1;
	initnpctimer;
	end;
OnTimer30000:
	npctalk "Sorry, You take so long time. GOOGLE IT LOL to find the answer.";
	goto L_continue;
Right:
	npctalk "The answer is true. Good job man !!";
	getitem .rewarditem, rand( 1,10 ); // Randomly picks from 1 to 10.
L_continue:
	deletepset 1;
	stopnpctimer;
	if( .count < .max_questions ) goto L_loop; // loop 10 questions
	.count = 0; // end of event
	.Q_session = 0;
	npctalk "End of the event. Thanks for participating in this event ^^";
	end;

function DefineQuestion {
	set .@a, .numQuestions % 128;
	set .@b, .numQuestions / 128;

	setd(".question_" + .@a + "$[" + .@b + "]", getarg(0));
	setd(".answer_" + .@a + "$[" + .@b + "]", getarg(1));
	set .numQuestions, .numQuestions + 1;
	return;
}
function GetQuestion {
	return getd(".question_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]");
}
function GetAnswer {
	return getd(".answer_" + (getarg(0) % 128) + "$[" + (getarg(0) / 128) + "]");
}
OnInit:
	set .EventON, 0;
	set .rewarditem, 7915;	//Ygg berry~
	.max_questions = 10;	// 10 questions if more than 10 questions are defined
	DefineQuestion("Do you know that The _____ bear is not really a bear, but is really related to the kangaroo and the wombat.","Koala");
	DefineQuestion("Do you know that The word -_____- comes from the Greek word -kometes- meaning long hair and referring to the tail ","comet");
	DefineQuestion("Do you know that Before air conditioning was invented, white cotton __________ were put on furniture to keep the air cool. ","slipcovers");
	DefineQuestion("Do you know that Instead of a Birthday Cake, many Russian children are given a Birthday ___ ","Pie");
	DefineQuestion("Do you know that Colgate faced a big obstacle marketing toothpaste in Spanish speaking countries. _______ translates into the command -go hang yourself.- ","Colgate");
	DefineQuestion("Do you know that The ________ cartoon was the first thirty-minute cartoon to be aired during prime time ","Flintstones");
	DefineQuestion("Do you know that The abbreviation ____ for the word Christmas is of Greek origin. ","Xmas");
	DefineQuestion("Do you know that ____ has more English speakers than the United States ","China");
	DefineQuestion("Do you know that When _____ Elizabeth I of England died she owned over 3,000 gowns ","Queen");
	DefineQuestion("Do you know that In one day 34,000 ______ die from causes that are related to poverty and hunger ","children");
	DefineQuestion("Do you know that The only 15 letter word that can be spelled without repeating a letter is [__________.] ","uncopyrightable");
	DefineQuestion("Do you know that Some _____ worms will eat themselves if they cannot find food. This type of worm can still survive after eating up to 95% of its body weight ","Ribbon");
	DefineQuestion("Do you know that There is an area located off the south-eastern Atlantic coast of the United States called the -Bermuda _______.","Triangle");
	DefineQuestion("Do you know that in ____, a wrestling match in Stockholm between Finn Alfred Asikainen and Russian Martin Klein lasted more than 11 hours. Klein eventually won.","1912");
	DefineQuestion("Do you know that ______ are considered apes, not monkeys. The way to distinguish between an ape and a monkey is that apes do not have tails ","Gorillas");
	DefineQuestion("Do you know that _____ Lee was so fast, that they actually had to slow a film down so you could see his moves. That is the opposite of the normal","Bruce");
	DefineQuestion("Do you know that A 27 year old heir to a _____ empire was handed a ticket for 116,000 pounds for driving at 80 km/hr in a 40 km/hr zone.","sausage");
	DefineQuestion("Do you know that The first known American novelist to hand in a manuscript that was typed was ___ ___. ","Mark Twain");
	DefineQuestion("Do you know that In Belgium, there is a museum that is just for _________ ","strawberries");
	DefineQuestion("Do you know that A ______ with two mouths, two sets of teeth and two tongues was caught by Bob Bateman of Canada.","salmon");
	DefineQuestion("Do you know that ___________ x 111,111,111 = 12,345,678,987,654,321 ","111,111,111");
	DefineQuestion("Do you know that Pepsi originally contained ______, (the same stuff in pepcid AC) thus the name ","pepsin");
	DefineQuestion("Do you know that Annually, ____ that occur at home kill more Americans than all natural disasters combined ","fires");
	DefineQuestion("Do you know that The song -_____ ________- brings in about $2 million in licensing revenue to Warner Communications who hold the copyright to the song  ","Happy Birthday");
	DefineQuestion("Do you know that You can send a postcard from ____. There is a small town located in the Cayman Islands called -_____.-","Hell");
	DefineQuestion("Do you know that In the movie -_____- , 300,000 extras appeared in the funeral scene. Of the 300,000, approximately 100,000 received a small fee.","Gandhi");
	DefineQuestion("Do you know that In ____, a Japanese artist, Tadahiko Ogawa, made a copy of the Mona Lisa completely out of ordinary toast ","1983");
	DefineQuestion("Do you know that Over one million ___ ____ were sold in 1975, makine Gary Dahl, of Los Gatos, California, a millionaire. ","Pet Rocks");
	DefineQuestion("Do you know that The name ____ was made up for the book -Peter Pan.- ","Wendy");
	DefineQuestion("Do you know that The first ________ call from the White House was from Rutherford Hayes to Alexander Graham Bell ","telephone");
	DefineQuestion("Do you know that The reason _________ have circular stairways is from the days when the engines were pulled by horses.","firehouses");
	DefineQuestion("Do you know that By recycling just one glass ______, the amount of energy that is being saved is enough to light a 100 watt bulb for four hours","bottle");
	DefineQuestion("Do you know that One _____ vine can produce about 20 to 30 glasses of wine ","grape");
	DefineQuestion("Do you know that Some _____ have been known to put ants into their feathers because the ants squirt formic acid, which kills parasites ","birds");
	DefineQuestion("Do you know that The popular chocolate bar -____ Musketeers- got its name because when it was first introduced in 1932 there were three individual bars.","Three");
	DefineQuestion("Do you know that John Van Wormer invented paper milk _____ after dropping a bottle of milk one morning.","cartons");
	DefineQuestion("Do you know that ____ beef got its name because it's beef was preserved with pellets of salt that were the size of corn kernels.","Corned");
	DefineQuestion("Do you know that A ____ year old boy was the first person to survive the Horeshoe Falls (Niagara Falls) in just a life jacke","seven");
	DefineQuestion("Do you know that The reason why ____ gum is pink is because the inventor only had pink colouring left.","bubble");
	DefineQuestion("Do you know that Ninety-nine percent of ______ sold in the United States are for the sole purpose of decoration ","pumpkins");
	DefineQuestion("David McConnell started the California Perfume Company in 1886. Today the company is known as _____, ","Avon");
	DefineQuestion("Do you know that The most expensive perfume in the world is _____ VI, which was made by Arthur Burnham.","Parfum");
	DefineQuestion("The female ____ cannot lay eggs if she is alone. she must be able to see another _____.","pigeon");
	DefineQuestion("In ______, you can be fined for not using a shopping basket at a grocery store!","Holland");
	DefineQuestion("In West ______ if you run over an animal, you can legally take it home and cook it for dinner!","Virginia");
	DefineQuestion("It is _____ to purchase or consume Jack Daniel's Whiskey in the town in which it is produced!","illegal");
	DefineQuestion("The scientific term for the common _____ is lycopersicon lycopersicum, which means wolf peach.","tomato");
	DefineQuestion("The oldest almost-complete manuscript of the Bible still existing is the Codex Vaticanus, now held in the Vatican ______.","library");
	DefineQuestion("The word ____ appears 1855 times in the Bible.","Lord");
	DefineQuestion("The ____ is the first bird mention in the Bible. It appears in Genesis 8:7, when it is sent out from the ark by Noah to see if the flood waters have abated.","raven");
	DefineQuestion("Summer on ___ lasts for 21 years , but so does winter. ","Uranus");
	DefineQuestion("Hurricanes, tornadoes and bigger bodies of water always go _____ in the Southern Hemisphere and counter______ in the Northern Hemisphere.","clockwise");
	if( .numQuestions < .max_questions ) .max_questions = .numQuestions;
	end;
}

It doesn't work and that i want it to be answered near the npc like the disguise event.

 

 

 

you should put the destination of your fact.txt in here

scripts_custom.txt found in npc folder.

 

// ----------------------- Custom Scripts -----------------------

//npc: npc/location/to/script.txt

 

npc: npc/custom/fact.txt

 

note:

your fact.txt script should be saved on npc/custom

 

after that you can just type @reloadscript

 

hope this helped.

 

/heh

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

I haven't been keeping up too much with everything that's changed, so I don't know if PCRE is enabled by default but... did you try configure --with-pcre before compiling? This should happen by default if you compiled using something like visual studio iirc.

 

A good way to test if PCRE is enabled would be to setup a wildcard that'll pick up any text, and just see if the NPC responds to it. 

Link to comment
Share on other sites

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.

×
×
  • Create New...