Jump to content
  • 0

Scripting Assistance


crazyarashi

Question


  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

Hi  I'm making a rough elunium/oridecon exchanger with an amount input on it and im quite confuse right now anyone can check if this is correct. :))

prontera,255,55,5	script	Rough Stones Exchanger	756,{

mes "[Leon]";
mes "Hi adventurer, I'm Leon and im trading";
mes "a whole ^0055FFOridecon^000000 or ^0055FFElunium^000000";
mes "For 5 ^0055FFRough Oridecon^000000 or ^0055FFRough Elunium^000000";
mes "What would you like to exchange today?";
	switch(select("Rough Elu to Elunium:Rough Ori to Oridecon")) {
		case 1:
			set .@i, countitem(757);
			if (.@i < 5) goto notelu;
			mes "[Leon]";
			mes "[How many rough elunium would you like to exchange?]";
			next;
			input .@e;
			if (.@e < 5 || .@e > countitem(757)) {
				mes "[Leon]";
				mes "That's an invalid amount of Elunium";
				mes "The Exchange rate is 5 rough elu to 1 Elunium";
				close;
				}
			mes "Are you sure you want to exchange ^0055FF"+(.@e*5)+" Rough Elunium?^000000?";
			if(select("Yes:No")==2) close;
			mes "[Leon]";
			mes "Okay come to me again if you want to exchange";
			delitem .@i,.@e*5;
			getitem 985,.@e/5;
			end;
			}

 

Edited by crazyarashi
Fix
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   53
  • Joined:  02/12/17
  • Last Seen:  

Hello, kindly post your error.

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

21 minutes ago, Freya said:

Hello, kindly post your error.

Hi Im not getting any errors but i think this part is wrong because it's not exchanging anything at all :))

			mes "Are you sure you want to exchange ^0055FF"+(.@e*5)+" Rough Elunium?^000000?";
			if(select("Yes:No")==2) close;
			mes "[Leon]";
			mes "Okay come to me again if you want to exchange";
			delitem .@i,.@e*5;
			getitem 985,.@e/5;
			end;
			}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   53
  • Joined:  02/12/17
  • Last Seen:  

6 minutes ago, crazyarashi said:

Hi Im not getting any errors but i think this part is wrong because it's not exchanging anything at all :))


			mes "Are you sure you want to exchange ^0055FF"+(.@e*5)+" Rough Elunium?^000000?";
			if(select("Yes:No")==2) close;
			mes "[Leon]";
			mes "Okay come to me again if you want to exchange";
			delitem .@i,.@e*5;
			getitem 985,.@e/5;
			end;
			}

 

 I would like to ask as to where is your case 2? You also don't have the "notelu".

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  666
  • Reputation:   674
  • Joined:  11/12/12
  • Last Seen:  

Well, the input is wrong:

	input .@e;
	
	if (.@e < 5 || .@e > countitem(757)) {
		mes "[Leon]";
		mes "That's an invalid amount of Elunium";
		mes "The Exchange rate is 5 rough elu to 1 Elunium";
		close;
	}
	
	.@e = .@e / 5 * 5;
	
	mes "Are you sure you want to exchange ^0055FF" + .@e + " Rough Eluniums?^000000?";
	
	if (select("Yes:No") == 2) close;
	
	mes "[Leon]";
	mes "Okay come to me again if you want to exchange";
	delitem 757, .@e;
	getitem 985, .@e/5;
	end;

And so was the delitem line.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

3 hours ago, Tokei said:

Well, the input is wrong:


	input .@e;
	
	if (.@e < 5 || .@e > countitem(757)) {
		mes "[Leon]";
		mes "That's an invalid amount of Elunium";
		mes "The Exchange rate is 5 rough elu to 1 Elunium";
		close;
	}
	
	.@e = .@e / 5 * 5;
	
	mes "Are you sure you want to exchange ^0055FF" + .@e + " Rough Eluniums?^000000?";
	
	if (select("Yes:No") == 2) close;
	
	mes "[Leon]";
	mes "Okay come to me again if you want to exchange";
	delitem 757, .@e;
	getitem 985, .@e/5;
	end;

And so was the delitem line.

Sending the full script

Edited by crazyarashi
Not Working
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

ra_temsky,146,135,5	script	Rough Stones Exchanger	756,{

mes "[Leon]";
mes "Hi adventurer, I'm Leon and im trading";
mes "a whole ^0055FFOridecon^000000 or ^0055FFElunium^000000";
mes "For 5 ^0055FFRough Oridecon^000000 or ^0055FFRough Elunium^000000";
mes "What would you like to exchange today?";
	switch(select("Rough Elu to Elunium:Rough Ori to Oridecon")) {
		case 1:
			set .@i, countitem(757);
			if (.@i < 5) goto noelu;
			mes "[Leon]";
			mes "[How many rough elunium would you like to exchange?]";
			next;
			input .@e;
			if (.@e < 5 || .@e > countitem(757)) {
				mes "[Leon]";
				mes "That's an invalid amount of Elunium";
				mes "The Exchange rate is 5 rough elu to 1 Elunium";
				close;
				}
        
			mes "Are you sure you want to exchange ^0055FF"+(.@e*5)+" Rough Elunium?^000000?";
			if(select("Yes:No")==2) close;
			mes "[Leon]";
			mes "Okay come to me again if you want to exchange";
			delitem .@i,.@e*5;
			getitem 985,.@e/5;
			end;
		case 2:
			set .@i, countitem(757);
			if (.@i < 5) goto noori;
			mes "[Leon]";
			mes "[How many rough elunium would you like to exchange?]";
			next;
			input .@e;
			if (.@e < 5 || .@e > countitem(757)*5 ) {
				mes "[Leon]";
				mes "That's an invalid amount of Elunium";
				mes "The Exchange rate is 5 rough elu to 1 Elunium";
				mes "Make sure you input the right value";
				close;
				}
			mes "Are you sure you want to exchange ^0055FF"+(.@e*5)+" Rough Elunium?^000000?";
			if(select("Yes:No")==2) close;
			mes "[Leon]";
			mes "Okay come to me again if you want to exchange";
			delitem .@i,.@e*5;
			getitem 985,.@e;
			end;
			}

				
noori:
	mes "[Leon]";
	mes "You Don't have enough rough oridecon to exchange";
	close;
	
noelu:
	mes "[Leon]";
	mes "You Dont have enough rough elunium to exchange";
	close;
}

 

4 hours ago, Freya said:

 I would like to ask as to where is your case 2? You also don't have the "notelu".

Nevermind Fixed it now thank you!

Edited by crazyarashi
Fixed
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

Resolved it by applying what tokei corrected :D and by fixing a few close lines 
Here's the full script :)) 

prt_in,63,69,3	script	Rough Stones Exchanger	756,{

mes "[Leon]";
mes "Hi adventurer, I'm Leon and im trading";
mes "a whole ^0055FFOridecon^000000 or ^0055FFElunium^000000";
mes "For 5 ^0055FFRough Oridecon^000000 or ^0055FFRough Elunium^000000";
next;
mes "[Leon]";
mes "What would you like to exchange today?";
next;
	switch(select("Rough Elu to Elunium:Rough Ori to Oridecon")) {
		case 1:
			set .@i, countitem(757);
			if (.@i < 5) goto noelu;
			next;
			mes "[Leon]";
			mes "How many Rough Elunium would you like to exchange?";
			next;
			input .@e = .@e / 5 * 5;
			next;
			if (.@e < 5 || .@e > countitem(757)) {
			mes "[Leon]";
			mes "That's an invalid amount of ^00FF00Rough Elunium^000000";
			mes "The exchange rate is 5 Rough Elunium to 1 Elunium";
			close;
			}
	
			mes "Are you sure you want to exchange ^0055FF" + .@e + " Rough Eluniums?^000000?";	
			if (select("Yes:No") == 2) close;
			mes "[Leon]";
			mes "Okay come to me again if you want to exchange";
			delitem 757, .@e;
			getitem 985, .@e/5;
			end;

		case 2:
			set .@i2, countitem(756);
			if (.@i2 < 5) goto noori;
			next;
			mes "[Leon]";
			mes "How many Rough Oridecon would you like to exchange?";
			next;
			input .@r = .@r / 5 * 5;
			next;

			if (.@r < 5 || .@r > countitem(756)) {
				mes "[Leon]";
				mes "That's an invalid amount of Oridecon";
				mes "The Exchange rate is 5 Rough Oridecon to 1 Oridecon";
				mes "Make sure you input the right value";
				close;
				}

			mes "Are you sure you want to exchange ^0055FF"+.@r+" Rough Oridecon?^000000?";
			if(select("Yes:No")==2) close;
			mes "[Leon]";
			mes "Okay come to me again if you want to exchange";
			delitem 756,.@r;
			getitem 984,.@r/5;
			end;
			}

				
noori:
	mes "[Leon]";
	mes "You don't have enough ^00FF00Rough Oridecon^000000 to exchange";
	close;
	
noelu:
	mes "[Leon]";
	mes "You dont have enough ^00FF00Rough Elunium^000000 to exchange";
	close;
}

 

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