someone ? how i do add a timer on this script ? I want every 20 minute in hour, i will auto triggered. thx
//===== eAthena Script =====================================================================
//= Fact Event
//===== By: ================================================================================
//= Hellflaem
//===== Current Version: ===================================================================
//= 1.0
//===== Compatible With: ===================================================================
//= Eathena SVN and 3ceam
//===== Description: =======================================================================
//= It's a Facts Event based on about 52 Facts from the Facts Announcer Script by xienne15.
//= The Event is started by players, They just have to click the npc.
//= Players are asked to fill in the missing word(s) of the facts.
//= If they get it right they get an item. Player just have to say the answer outloud.
//========Credits===========================================================================
//=ToastOfDoom
//=RxChris
//==========================================================================================
mora,137,171,3 script Facts Event 917,{
if ($@EventON){end;}
function DefineQuestion;
function GetQuestion;
function GetAnswer;
//set .i, (.i + 1) % .numQuestions; //This is for testing.
set .i, rand(.numQuestions); // Randomly picks a fact.
set $rewarditem, 7539; //Poring Coins
set $rand, rand(1,500); // Randomly picks from 1 to 5.
set $@EventON,1;
npctalk "Sila isi dalam tempat kosong:";
sleep2 2000;
npctalk "Jika anda rasa ia betul. Saya akan memberikan anda beberapa syiling poring!";
sleep2 4000;
npctalk "Fact " + .i + ": " + GetQuestion(.i);
set .@answer$,GetAnswer(.i);
defpattern 1, "([^:]+):.*\\s"+.@answer$+"(.*)", "Right";
activatepset 1;
initnpctimer;
end;
OnTimer30000:
npctalk "Maaf, anda mengambil masa yang amat panjang.";
deletepset 1;
set $@EventON,0;
stopnpctimer;
setnpctimer 0;
end;
Right:
npctalk "Itu adalah betul, sila ambil ini.";
getitem $rewarditem,$rand;
deletepset 1;
stopnpctimer;
setnpctimer 0;
set $@EventON,0;
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;
DefineQuestion("What is your mum name ? _____ ","poring");
}
Question
mrlongshen
someone ? how i do add a timer on this script ? I want every 20 minute in hour, i will auto triggered. thx
Link to comment
Share on other sites
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.