Jump to content
  • 0

Scripting Error


rochenel27

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   1
  • Joined:  01/07/19
  • Last Seen:  

Hi guys! I'm a newbie in scripting. Just started learning today and just need your help on what's wrong with this script that I made?
I would really appreciate if you'll pin point my mistakes so that I will learn. Thank you!

 

// Item Trader

prontera,147,170,4	script Item Trader	622,{
	mes "[Item Trader]";
	mes "Hi! How can I help you?";
	mes "Item Ticket = 100 Yggdrasil Berry";
	mes "Item Ticket = 30 Poison Bottles";
	menu "Item Ticket to Yggdrasil Berry", C_1, "Item Ticket to Poison Bottle", C_2, "Yggdrasil Berry to Item Ticket", C_3, "Poison Bottle to Item Ticket" C_4;
	
C_1:
	if (checkweight(607,100) == 0 ) goto C_OW;
	if(countitem(7284)<1) goto C_NI;
	delitem 7284,1;
	getitem 607,100;
	mes "[Item Trader]";
	mes "[There you go!]";
	close;
	
C_2:
	if (checkweight(678,30) == 0 ) goto L_OW;
	if(countitem(7284)<1) goto C_NI;
	delitem 7284,1;
	getitem 678,300;
	mes "[Item Trader]";
	mes "[There you go!]";
	close;
	
C_3:
	if(countitem(607)<100) goto C_NI;
	delitem 607,100;
	getitem 7284,1;
	mes "[Item Trader]";
	mes "[There you go!]";
	close;
	
C_4:
	if(countitem(678)<30) goto C_NI;
	delitem 678,30;
	getitem 7284,1;
	mes "[Item Trader]";
	mes "[There you go!]";
	close;
	
C_OW
	mes "[Item Trader]";
	mes "Sorry you're overweight";
	close;
	
		
C_NI:
	mes "[Item Trader]";
	mes "[You don't have the items]";
	close;
}

 

  • Love 1
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  154
  • Reputation:   51
  • Joined:  07/15/13
  • Last Seen:  

3 hours ago, rochenel27 said:

Hi guys! I'm a newbie in scripting. Just started learning today and just need your help on what's wrong with this script that I made?
I would really appreciate if you'll pin point my mistakes so that I will learn. Thank you!

 


// Item Trader

prontera,147,170,4	script Item Trader	622,{
	mes "[Item Trader]";
	mes "Hi! How can I help you?";
	mes "Item Ticket = 100 Yggdrasil Berry";
	mes "Item Ticket = 30 Poison Bottles";
	menu "Item Ticket to Yggdrasil Berry", C_1, "Item Ticket to Poison Bottle", C_2, "Yggdrasil Berry to Item Ticket", C_3, "Poison Bottle to Item Ticket" C_4;
	
C_1:
	if (checkweight(607,100) == 0 ) goto C_OW;
	if(countitem(7284)<1) goto C_NI;
	delitem 7284,1;
	getitem 607,100;
	mes "[Item Trader]";
	mes "[There you go!]";
	close;
	
C_2:
	if (checkweight(678,30) == 0 ) goto L_OW;
	if(countitem(7284)<1) goto C_NI;
	delitem 7284,1;
	getitem 678,300;
	mes "[Item Trader]";
	mes "[There you go!]";
	close;
	
C_3:
	if(countitem(607)<100) goto C_NI;
	delitem 607,100;
	getitem 7284,1;
	mes "[Item Trader]";
	mes "[There you go!]";
	close;
	
C_4:
	if(countitem(678)<30) goto C_NI;
	delitem 678,30;
	getitem 7284,1;
	mes "[Item Trader]";
	mes "[There you go!]";
	close;
	
C_OW
	mes "[Item Trader]";
	mes "Sorry you're overweight";
	close;
	
		
C_NI:
	mes "[Item Trader]";
	mes "[You don't have the items]";
	close;
}

 

You had an extra TAB in prontera,147,170,4 and you miss in "Poison Bottle to Item Ticket" C_4; and should be "Poison Bottle to item Ticket",C_4; C_OW you miss put 

Btw, i recommend you use switch(select in menu tab, is more easy to use and less tedious. I made an example script to help you:

prontera,150,171,4	script	Item Trader	622,{
	disable_items;
  	disable_command;
	mes "[^711872Trader^000000]";
	mes "Hello hello Hello!";
	switch(select("Item Ticket to Yggdrasil Berry:Item Ticket to Poison Bottle:Yggdrasil Berry to Item Ticket:Poison Bottle to Item Ticket:- Close.")) {
	
	case 1:
		if (checkweight(607,100) == 0 ) goto C_OW;
		if(countitem(7284)<1) goto C_NI;
		delitem 7284,1;
		getitem 607,100;
		mes "[^711872Trader^000000]";
		mes "[There you go!]";
		close;
	
	case 2:
		if (checkweight(678,30) == 0 ) goto L_OW;
		if(countitem(7284)<1) goto C_NI;
		delitem 7284,1;
		getitem 678,300;
		next;
		mes "[^711872Trader^000000]";
		mes "[There you go!]";
		close;
	
	case 3:
		next;
		if(countitem(607)<100) goto C_NI;
		delitem 607,100;
		getitem 7284,1;
		mes "[^711872Trader^000000]";
		mes "[There you go!]";
		close;
	
	case 4:
		next;
		if(countitem(678)<30) goto C_NI;
		delitem 678,30;
		getitem 7284,1;
		mes "[^711872Trader^000000]";
		mes "[There you go!]";
		close;
		
	case 5:
		next;
		mes "[^711872Trader^000000]";
		mes "See ya!";
		close;
	
	C_OW:
		next;
		mes "[^711872Trader^000000]";
		mes "Sorry you're overweight";
		close;
	
		
	C_NI:
		next;
		mes "[^711872Trader^000000]";
		mes "[You don't have the items]";
		close;

	}
}

I recommend you use disable_items; and disable_command; to prevent exploits. hope it helped you. ?

Edited by EIysium
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   1
  • Joined:  01/07/19
  • Last Seen:  

5 minutes ago, EIysium said:

You had an extra TAB in prontera,147,170,4 and you miss in "Poison Bottle to Item Ticket" C_4; and should be "Poison Bottle to item Ticket",C_4; C_OW you miss put 

Btw, i recommend you use switch(select in menu tab, is more easy to use and less tedious. I made an example script to help you:


prontera,150,171,4	script	Item Trader	622,{
	Main:
	disable_items;
  	disable_command;
	mes "[^711872Trader^000000]";
	mes "Hello hello Hello!";
	switch(select("Item Ticket to Yggdrasil Berry:Item Ticket to Poison Bottle:Yggdrasil Berry to Item Ticket:Poison Bottle to Item Ticket:- Close.")) {
	
	case 1:
		next;
		if (checkweight(607,100) == 0 ) goto C_OW;
		if(countitem(7284)<1) goto C_NI;
		delitem 7284,1;
		getitem 607,100;
		mes "[^711872Trader^000000]";
		mes "[There you go!]";
		close;
	
	case 2:
		next;
		if (checkweight(678,30) == 0 ) goto L_OW;
		if(countitem(7284)<1) goto C_NI;
		delitem 7284,1;
		getitem 678,300;
		next;
		mes "[^711872Trader^000000]";
		mes "[There you go!]";
		close;
	
	case 3:
		next;
		if(countitem(607)<100) goto C_NI;
		delitem 607,100;
		getitem 7284,1;
		mes "[^711872Trader^000000]";
		mes "[There you go!]";
		close;
	
	case 4:
		next;
		if(countitem(678)<30) goto C_NI;
		delitem 678,30;
		getitem 7284,1;
		mes "[^711872Trader^000000]";
		mes "[There you go!]";
		close;
		
	case 5:
		next;
		mes "[^711872Trader^000000]";
		mes "See ya!";
		close;
	
	C_OW:
		next;
		mes "[^711872Trader^000000]";
		mes "Sorry you're overweight";
		close;
	
		
	C_NI:
		next;
		mes "[^711872Trader^000000]";
		mes "[You don't have the items]";
		close;

	}
}

I recommend you use disable_items; and disable_command; to prevent exploits. hope it helped you. ?

OMG Thank you very much! Yes you really helped me understand the mistakes.

Thanks again!

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