PapaZola Posted September 29, 2013 Group: Members Topic Count: 318 Topics Per Day: 0.07 Content Count: 925 Reputation: 33 Joined: 12/05/11 Last Seen: September 20, 2023 Share 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 Link to comment Share on other sites More sharing options...
Lil Troll Posted October 2, 2013 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 276 Reputation: 24 Joined: 07/06/13 Last Seen: April 19, 2014 Share 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 Link to comment Share on other sites More sharing options...
PapaZola Posted October 11, 2013 Group: Members Topic Count: 318 Topics Per Day: 0.07 Content Count: 925 Reputation: 33 Joined: 12/05/11 Last Seen: September 20, 2023 Author Share 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 Link to comment Share on other sites More sharing options...
Ajjwidjdneidjenw Posted October 11, 2013 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 161 Reputation: 31 Joined: 12/06/11 Last Seen: December 25, 2022 Share 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 Link to comment Share on other sites More sharing options...
PapaZola Posted October 12, 2013 Group: Members Topic Count: 318 Topics Per Day: 0.07 Content Count: 925 Reputation: 33 Joined: 12/05/11 Last Seen: September 20, 2023 Author Share 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 Link to comment Share on other sites More sharing options...
Patskie Posted October 12, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share Posted October 12, 2013 Change that line to : set .@a, (.@tokens*15); eAthena doesn't support direct variable declaration Quote Link to comment Share on other sites More sharing options...
PapaZola Posted October 12, 2013 Group: Members Topic Count: 318 Topics Per Day: 0.07 Content Count: 925 Reputation: 33 Joined: 12/05/11 Last Seen: September 20, 2023 Author Share Posted October 12, 2013 still not working Quote Link to comment Share on other sites More sharing options...
Ajjwidjdneidjenw Posted October 16, 2013 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 161 Reputation: 31 Joined: 12/06/11 Last Seen: December 25, 2022 Share 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 Link to comment Share on other sites More sharing options...
Ryokem Posted October 17, 2013 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted October 17, 2013 mes "15 Heroic Quest Token = 1 Sacred Token(20001)";\ There is an unknown \ at the end of this line Quote Link to comment Share on other sites More sharing options...
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
Link to comment
Share on other sites
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.