Jump to content
  • 0

How will this script work?


WhatFT

Question


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

Sir Emistry, and others... Can anyoen help me work this script?

I requested this script and Emistry made this... The script is working when I loaded but when the event started, it only says when you click the npc... "Type the Correct Answer"... Nothing is showing... only that.. What's wrong with the script? Is this working properly?

belagio,84,95,5 script Fast-Type Event 421,{
if( .String$ == "A" ){
	mes "There is no Event right now.";
}else{
	mes "Type the Correct Sentences.";
	mes "^FF0000"+.Strings$+"^000000";
	input .@Type$;
	if( .String$ == .@Type$ ){
		mes ""+strcharinfo(0)+" typed the correct string.";
		getitem 673,5;
		set .String$,"A";
	}else{
		mes "Sorry there is a winner already";
	}
}
close;
OnClock0130:
OnClock0230:
OnClock0330:
OnClock0430:
OnClock0530:
OnClock0630:
OnClock0730:
OnClock0830:
OnClock0930:
OnClock1030:
OnClock1130:
OnClock1230:
OnClock1330:
OnClock1430:
OnClock1530:
OnClock1630:
OnClock1730:
OnClock1830:
OnClock1930:
OnClock2030:
OnClock2130:
OnClock2230:
OnClock2330:
OnClock0030:
//etc..
set .String$,"A";
while( getstrlen( .String$ ) < .Length ){
	set .String$,.String$ + .List$[ rand( getarraysize( .List$ ) ) ];
}
announce "Fast-Type Event has started !",0;
end;
OnInit:
set .Length,6;
setarray .List$,"A","B","C","D","E","F","G";
end;
}

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   4
  • Joined:  12/05/11
  • Last Seen:  

Just a small variable typo.

Change

mes "^FF0000"+.Strings$+"^000000";

into

mes "^FF0000"+.String$+"^000000";

Edited by Neblim
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

Thanks Neblim, It works now...

I wanted to make this script work every hour with rounds just like the Disguise Event NPC...

Can anyone edit tihs one and add ROUNDS on it?

and GM Panel also for Starting and Ending the event... THANKS !

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

for round hours :

instead :

OnClock0130:
OnClock0230:
OnClock0330:
OnClock0430:
OnClock0530:
OnClock0630:
OnClock0730:
OnClock0830:
OnClock0930:
OnClock1030:
OnClock1130:
OnClock1230:
OnClock1330:
OnClock1430:
OnClock1530:
OnClock1630:
OnClock1730:
OnClock1830:
OnClock1930:
OnClock2030:
OnClock2130:
OnClock2230:
OnClock2330:
OnClock0030:

to this

OnMinute00:

Wich mean every time we pass the 00 minutes will trigger this, so in other each rounded hours.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

Thanks Lighta !

Okay, Only problem is the ROUNDS... =/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   4
  • Joined:  12/05/11
  • Last Seen:  

Try this out.

Edit: Fixed a small loophole.

fastest_typist.txt

Edited by Neblim
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

Thansk for adding the rounds Neblim ! I don't know how to make global announcement before the Fast-Type Event starts...

Here is the script, I fixed some of text you forgot to remove... It's working fine together with the rounds, but I don't know how to add Announcement before the event starts and how to make codings like Round 1 start, Round 2 Start until the Last Round..It keeps on saying "Round Started"

belagio,84,95,5 script Fast-Type Event 421,{
if(getgmlevel() >= 90) callsub L_GM;
if( !.Event ) {
	mes "There is no Event right now.";
} else if ( .String$ == "" ) {
	announce "Round already ended, wait for the next round..",0;
} else {
	mes "Type the Correct Sentences.";
	mes "^FF0000" + .String$ + "^000000";
	input .@Type$;
	if( .String$ == "" ) {
		announce "Sorry, " + strcharinfo(0) + " is a bit slow..",0;
		close;
	}
	if ( .String$ == .@Type$ && .Event ) {
		getitem 673, 5;
		announce "Fast-Type Event: " + strcharinfo(0) + " typed the correct string!",0;
		set .String$, "";
		set .Round, .Round + 1;
		donpcevent "Fast-Type Event::OnStart2";
	} else {
		announce "" + strcharinfo(0) + " mispelled some strings XD",0;
	}
}
close;
OnMinute00:
if(.Event) end;
donpcevent "Fast-Type Event::OnStart";
end;
OnStart:
L_Begin:
set .Event, 1;
set .String$, "";
while( getstrlen( .String$ ) < .Length ){
	set .String$,.String$ + .List$[ rand( getarraysize( .List$ ) ) ];
}
announce "Round Started !",0;
end;
OnStart2:
sleep2 5000;
if(.Round == .Rounds) {
	if(!.Event) end;
	announce "Fast-Type Event: Event is over!",0;
	set .Event, 0;
	set .Round, 0;
	end;
}
if(!.Event) end;
announce "Fast-Type Event: Next round starts in 5 seconds...",0;
sleep2 5000;
if(!.Event) end;
goto L_Begin;
L_GM:
mes "Fast-Type event is" + (.Event?"^00FF00 ON^000000":"^FF0000 OFF^000000");
if(select((!.Event?"^00FF00Start":"^FF0000End") + " Event^000000","Normal Player") == 2) return;
switch(.Event) {
case 1:
	set .Event, 0;
	set .Round, 0;
	set .String$, "";
	announce "Fast-Type Event: A GM has ended the event.",0; break;
default:
	donpcevent "Fast-Type Event::OnStart";
}
close;
OnInit:
set .Length,25;
set .Rounds,7;
setarray .List$,"A","B","_","D","E","F","=","H","I","J","/","L","M","N","6","P","Q","R","S","T",",";
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

Should be this for your round annouce :

change :

 announce "Round Started !",0;

to

 announce "Round "+(.Round+1)+" Started !",0;

with .Round wich will change his value to 0,1,2..

and for global annonce.

OnStart:
L_Begin:

to

OnStart:
announce "Fast-Type Event: has started",0;
L_Begin:

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...