Jump to content
  • 0

Script Error


pojiejapan

Question


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  126
  • Reputation:   6
  • Joined:  11/18/11
  • Last Seen:  

Hello this is my try on script.

It was originally made by Rikimaru and I edit it abit.

There is error at line 64 and 69. Can someone help me? the 'c'ase 2??


prontera,150,168,2 script Mr.Monday 911,{
//=========================== Settings ====================================
set .@changername$,"[ Mr.Monday ]";// YOU MAY CHANGE THE NAME OF THE NPC
set .tcgid,7227;
set @tcgamount,1;
//======================= Settings End ====================================
//*************************************************************************
mes .@changername$;
mes "Hello "+strcharinfo(0)+" ,";
mes "What a wonderful day is today";
mes "Do you know that today is Monday?";
mes "Monday means Moon day, that's a fact.";
next;
mes "Hmm, Hey I got this unsual item ";
mes "when I was wandering around the ";
mes "wood It looks blackish in colour and it scared me";
next;
switch(select("Do you still have it?:I got to go dude")) {
case 1:
mes .@changername$;
mes "Sure but I don't have it right now";
mes "My brother have it";
mes "I can tell you where my brother is but";
next;
switch(select("But what?:Cancel")) {
case 1:
mes .@changername$;
mes "You have to help me find something";
mes "I really love a hat ^FF0000 Earmuff ^000000";
mes "can you find the material for me?";
next;
switch(select("I have it right now:Cancel")) {
mes .@changername$;
mes "Okay let me check if";
mes "you have the material";
next;
mes .@changername$;
mes "Rustle... Rustle...";
if((countitem(724) > 0) && (countitem(949) > 499) && (countitem(5001) > 0)) {
delitem 724,1;
delitem 949,500;
delitem 5001,1;
next;
mes .@changername$;
getitem .tcgid,@tcgamount; //Change to next Item!
mes "Here take this and see my big brother";
mes "Mr. Tuesday. Take this and he will talk to you";
close;
}
else {
mes .@changername$;
mes "Sorry you have to get the items first!";
close;
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}
}
}

Edited by Arcenciel
Codeboxed
Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

else {
mes .@changername$;
mes "Sorry you have to get the items first!";
close;
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}

You lack of the closing curly bracket for the else tree.

->

else {
mes .@changername$;
mes "Sorry you have to get the items first!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}

EDIT:

After reading the script again and again I think there are some other bracket issues.

For example there is an switch without cases which is closing after the case of another switch...

switch(select("I have it right now:Cancel")) {

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  126
  • Reputation:   6
  • Joined:  11/18/11
  • Last Seen:  

I need to change it to what Kenpachi?

switch(select("I have it right now:Cancel")) {

Edited by pojiejapan
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

Try this:


prontera,150,168,2 script Mr.Monday 911,{
//=========================== Settings ====================================
set .@changername$,"[ Mr.Monday ]";// YOU MAY CHANGE THE NAME OF THE NPC
set .tcgid,7227;
set @tcgamount,1;
//======================= Settings End ====================================
//*************************************************************************
mes .@changername$;
mes "Hello "+strcharinfo(0)+" ,";
mes "What a wonderful day is today";
mes "Do you know that today is Monday?";
mes "Monday means Moon day, that's a fact.";
next;
mes "Hmm, Hey I got this unsual item ";
mes "when I was wandering around the ";
mes "wood It looks blackish in colour and it scared me";
next;
switch(select("Do you still have it?:I got to go dude"))
{
case 1:
mes .@changername$;
mes "Sure but I don't have it right now";
mes "My brother have it";
mes "I can tell you where my brother is but";
next;
switch(select("But what?:Cancel"))
{
case 1:
mes .@changername$;
mes "You have to help me find something";
mes "I really love a hat ^FF0000 Earmuff ^000000";
mes "can you find the material for me?";
next;
switch(select("I have it right now:Cancel"))
{
case 1:
mes .@changername$;
mes "Okay let me check if";
mes "you have the material";
next;
mes .@changername$;
mes "Rustle... Rustle...";
if((countitem(724) > 0) && (countitem(949) > 499) && (countitem(5001) > 0))
{
delitem 724,1;
delitem 949,500;
delitem 5001,1;
next;
mes .@changername$;
getitem .tcgid,@tcgamount; //Change to next Item!
mes "Here take this and see my big brother";
mes "Mr. Tuesday. Take this and he will talk to you";
close;
}
else
{
mes .@changername$;
mes "Sorry you have to get the items first!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}
}
[/codeBOX]

(untested)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  126
  • Reputation:   6
  • Joined:  11/18/11
  • Last Seen:  

works perfectly Kenpachi. Thanks a lot. Though I need to tab the location of NPC. Thanks script master!

But can I request something more, the reason I put his name Mr. Monday is because I want this NPC to appear only at monday and maybe only for half day. Can you add the script for me? Please

Edited by pojiejapan
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

You can use the GetTime() function combined with the OnClockXXXX labels.

This would look like this:

prontera,150,168,2  script  Mr.Monday 911,{
//=========================== Settings ====================================
set .@changername$,"[ Mr.Monday ]";// YOU MAY CHANGE THE NAME OF THE NPC
set .tcgid,7227;
set @tcgamount,1;
//======================= Settings End ====================================
//*************************************************************************
mes .@changername$;
mes "Hello "+strcharinfo(0)+" ,";
mes "What a wonderful day is today";
mes "Do you know that today is Monday?";
mes "Monday means Moon day, that's a fact.";
next;
mes "Hmm, Hey I got this unsual item ";
mes "when I was wandering around the ";
mes "wood It looks blackish in colour and it scared me";
next;
switch(select("Do you still have it?:I got to go dude"))
{
case 1:
mes .@changername$;
mes "Sure but I don't have it right now";
mes "My brother have it";
mes "I can tell you where my brother is but";
next;
switch(select("But what?:Cancel"))
{
case 1:
mes .@changername$;
mes "You have to help me find something";
mes "I really love a hat ^FF0000 Earmuff ^000000";
mes "can you find the material for me?";
next;
switch(select("I have it right now:Cancel"))
{
case 1:
mes .@changername$;
mes "Okay let me check if";
mes "you have the material";
next;
mes .@changername$;
mes "Rustle... Rustle...";
if((countitem(724) > 0) && (countitem(949) > 499) && (countitem(5001) > 0))
{
delitem 724,1;
delitem 949,500;
delitem 5001,1;
next;
mes .@changername$;
getitem .tcgid,@tcgamount; //Change to next Item!
mes "Here take this and see my big brother";
mes "Mr. Tuesday. Take this and he will talk to you";
close;
}
else
{
mes .@changername$;
mes "Sorry you have to get the items first!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}
case 2:
mes .@changername$;
mes "Okay goodbye!";
close;
}

// Enabling
OnClock0655: // 06:55 AM
if(GetTime(4) == 1) // Monday
EnableNPC("Mr.Monday");
End();

// Enabling
OnClock1805: // 06:05 PM
if(GetTime(4) == 1) // Monday
DisableNPC("Mr.Monday");
End();
}[/codeBOX]

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  126
  • Reputation:   6
  • Joined:  11/18/11
  • Last Seen:  

sir 1 is equal to monday? if tuesday?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

0 - Sunday

1 - Monday

2 - Tuesday

... and so on.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  11/22/11
  • Last Seen:  

0 - 6 /no1

0 - sunday

6 - saturday

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  126
  • Reputation:   6
  • Joined:  11/18/11
  • Last Seen:  

Thanks for all the helper. I'll try the script /no1 Thanks Kenpachi and Gengen

Solved. thanks guys

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