PapaZola Posted September 29, 2013 Posted September 29, 2013 hello this my coin exchanger but my problem can i make exchange with input amount if player put 60 heroic token player will receive 4 Sacred Quote
Lil Troll Posted October 2, 2013 Posted October 2, 2013 (edited) for Sacred: input .@heroictoken; if(countitem(HeroicTokenID)<.@heroictoken*15){ mes "Insufficient "+HeroicTokenID+"`s; close; } getitem SacredTokenID,(.@heroictoken/15) delitem HeroicTokenID,.@heroictoken for Heroic: input .@sacredtoken; if(countitem(SacredTokenID)<.@sacredtoken/15){ mes "Insufficient "+SacredTokenID+"`s; close; } getitem HeroicTokenID,(.@sacredtoken*15) delitem SacredTokenID,.@sacredtoken This is the base script. Little modification will do. If you like me to customize it give me the whole script you are using. Edited October 2, 2013 by Lil Troll Quote
PapaZola Posted October 11, 2013 Author Posted October 11, 2013 here my script please help sir its urgent //================Token Exchanger==== maintown,78,121,6 script Token Exchanger 713,{ mes "I can change your [^0000FFScared Token^000000] to [^0000FFHeroic Quest Token^000000]."; mes "1 Scared Token can be change for 15 Heroic Quest Token and Vise Versa"; next; switch(select("Sacred to Heroic Exchange:Heroic to Sacred Exchange")) { case 1: mes "1 Sacret Token(20001) = 15 Heroic Quest Token"; if (countitem(20001) < 1) { mes "Sorry but you don't have enough tokens"; close; } else { delitem 20001,1; getitem 20000,15; close; } end; case 2: mes "15 Heroic Quest Token = 1 Sacret Token(20001)"; if (countitem(20000) < 15) { mes "Sorry but you don't have enough tokens"; close; } else { delitem 20000,15; getitem 20001,1; close; } end; } } Quote
Ajjwidjdneidjenw Posted October 11, 2013 Posted October 11, 2013 //================Token Exchanger==== maintown,78,121,6 script Token Exchanger 713,{ mes "I can change your [^0000FFScared Token^000000] to [^0000FFHeroic Quest Token^000000]."; mes "1 Scared Token can be change for 15 Heroic Quest Token and Vise Versa"; next; switch(select("Sacred to Heroic Exchange:Heroic to Sacred Exchange")) { case 1: mes "1 Sacred Token(20001) = 15 Heroic Quest Token"; mes "How many Sacred tokens do you wish to exchange?"; input .@tokens; .@a = (.@tokens*15); if (countitem(20001) < .@tokens) { mes "Sorry but you don't have enough tokens"; close; } else { delitem 20001,.@tokens; getitem 20000,.@a; close; } end; break; case 2: mes "15 Heroic Quest Token = 1 Sacred Token(20001)";\ next; mes "How many sacred tokens do you want?"; input .@tokens; .@a = (15*.@tokens); if (countitem(20000) < .@a) { mes "Sorry but you don't have enough tokens"; close; } else { delitem 20000,.@a; getitem 20001,.@tokens; close; } end; } } Been a while since I last did scripting for RO, mainly been coding in PHP and Java. This should do the trick, though you could clean up the code essentially you have to write this all down just once, as both script parts do the same thing. Cheers! Quote
PapaZola Posted October 12, 2013 Author Posted October 12, 2013 (edited) got some error sir,im used eAthena script error on npc/exchanger/spam.txt line 12 parse_line: expect command, missing function name or calling undeclared function 7 : { 8 : case 1: 9 : mes "1 Sacred Token(20001) = 15 Heroic Quest Token"; 10 : mes "How many Sacred tokens do you wish to exchange?"; 11 : input .@tokens; * 12 : '.'@a = (.@tokens*15); 13 : if (countitem(20001) < .@tokens) 14 : { 15 : mes "Sorry but you don't have enough tokens"; 16 : close; 17 : } Edited October 12, 2013 by PapaZola Quote
Patskie Posted October 12, 2013 Posted October 12, 2013 Change that line to : set .@a, (.@tokens*15); eAthena doesn't support direct variable declaration Quote
Ajjwidjdneidjenw Posted October 16, 2013 Posted October 16, 2013 (edited) Same error? Make sure you change the other one as well. //================Token Exchanger==== maintown,78,121,6 script Token Exchanger 713,{ mes "I can change your [^0000FFScared Token^000000] to [^0000FFHeroic Quest Token^000000]."; mes "1 Scared Token can be change for 15 Heroic Quest Token and Vise Versa"; next; switch(select("Sacred to Heroic Exchange:Heroic to Sacred Exchange")) { case 1: mes "1 Sacred Token(20001) = 15 Heroic Quest Token"; mes "How many Sacred tokens do you wish to exchange?"; input .@tokens; set .@a, (.@tokens*15); if (countitem(20001) < .@tokens) { mes "Sorry but you don't have enough tokens"; close; } else { delitem 20001,.@tokens; getitem 20000,.@a; close; } end; break; case 2: mes "15 Heroic Quest Token = 1 Sacred Token(20001)";\ next; mes "How many sacred tokens do you want?"; input .@tokens; set .@a, (15*.@tokens); if (countitem(20000) < .@a) { mes "Sorry but you don't have enough tokens"; close; } else { delitem 20000,.@a; getitem 20001,.@tokens; close; } end; } } Edited October 16, 2013 by Jeroen Quote
Ryokem Posted October 17, 2013 Posted October 17, 2013 mes "15 Heroic Quest Token = 1 Sacred Token(20001)";\ There is an unknown \ at the end of this line Quote
Question
PapaZola
hello this my coin exchanger but my problem
can i make exchange with input amount
if player put 60 heroic token player will receive 4 Sacred
8 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.