Kido Posted December 24, 2013 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Share Posted December 24, 2013 (edited) File Name: Coin to Coin Exchanger 1.1File Author: KidoDate Released: 24/12/2013 (merry christmas!)Category: UtilityModified/Original Author: Not modified/Kido Description:Exchanges low value Coins for more valuable Coins, for example, Bronze Coins to Silver Coin. TODO: Add colors Allow viceversa (for example, Silver Coins to Bronze Coins) Suggestions (?) How to change amounts:Example, you want to make 1000 Bronze Coins = to 1 Silver Coin. Change the 100 of the maxium amount to 1000 if(countitem(673)<100)goto no_item; //that 100, change it to 1000 Change the 100 of the deleting coin delitem 673,1*@amount*100; //that 100, change it to 1000 It should look like this: case 1: mes "Input the amount of desired Silver Coins."; mes "Remember: 1000 Bronze Coin = 1 Silver Coin"; mes "I can exchange you a Maxium of: 100 of your desired coin."; next; if(countitem(673)<1000) { mes "You don't have enought Coin to get the desired amount of coins that you specified."; close; } else { input @amount,0,100; delitem 673,1*@amount*1000; getitem 675,1*@amount; close; } Remember to change Table of Values too mes "1000 Bronze = 1 Silver"; //lol the first 100 now is a 1000 mes "100 Silver = 1 Gold"; mes "100 Gold = 1 Mithril"; mes "100 Mithril = 1 Platinum"; mes "100 Platinum = 1 Proof of Donation"; Well, i hope this script helps to anyone one day.Any bug or question you may ask by just repplying to this topic, you can PM me too but i don't guarantee that i will answer fast, also if someone know how to fix/change something, that some can repply to this as an answer to you (i know i'm not a good scripter but i just wanted to give this as a little gif to anyone who likes it or anyone who can give an use to it) Merry xmas to all! Changelog: Coin to Coin Exchanger 1.1 Replaced Labels with Switch Coin to Coin Exchanger 1.0 First release Coin To Coin Exchanger 1.1 .txt Edited February 12, 2014 by Kido Quote Link to comment Share on other sites More sharing options...
Shio Devs Posted December 24, 2013 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 135 Reputation: 20 Joined: 02/05/13 Last Seen: August 24, 2014 Share Posted December 24, 2013 Nice release Quote Link to comment Share on other sites More sharing options...
Kido Posted December 24, 2013 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Author Share Posted December 24, 2013 Nice release You are welcome, i hope you find it useful Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted December 25, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted December 25, 2013 your blog catches my attention, so I like to comment on your 1st script xD 1st thing that comes to mind is that you need to learn proper indent for example, prontera,159,177,4 script Exchange House 935,{ mes "Table of values"; mes "100 Bronze = 1 Silver"; mes "100 Silver = 1 Gold"; mes "100 Gold = 1 Mithril"; mes "100 Mithril = 1 Platinum"; mes "100 Platinum = 1 Proof of Donation"; next; menu "Bronze to Silver",L_BS,"Silver to Gold",L_SG,"Gold to Mithril",L_GM,"Mithril to Platinum",L_MP,"Platinum to Proof of Don.",L_PP,"nothing, thank you anyway",L_ND; next; L_ND: mes "Allright, if you need to get some coins come to me."; close; no_item: mes "You don't have enought Coin to get the desired amount of coins that you specified."; close; L_BS: if(countitem(673)<100)goto no_item; mes "Input the amount of desired Silver Coins."; mes "Remember: 100 Bronze Coin = 1 Silver Coin"; mes "I can exchange you a Maxium of: 100 of your desired coin."; mes "I DO NOT DO REFUNDS, input the amount that correctly matches with your affordable desired coins that you want."; input @amount,0,100; delitem 673,1*@amount*100; getitem 675,1*@amount; close;it may have not much affect in a simple script like this, but when you are trying to write a more advance scriptswithout proper indent the script will look very horrible and harder to read 2nd thing comes to mind, try not to use so many labels I can only rewrite your script to prove ya //===== rAthena Script ======================================= //= Kido's First Scrip Release: Coin to Coin Exchanger //===== By: ================================================== //= 100% Kido //===== YOU CAN NOT ========================================== //= Remove the credits //===== YOU CAN ============================================== //= Improve it //============================================================ prontera,159,177,4 script Exchange House 935,{ mes "choose ..."; setarray .@coin, 673,675,671,674,677,7179; for ( .@i = 0; .@i < 5; .@i++ ) .@menu$ = .@menu$ + getitemname( .@coin[.@i] ) +" -> "+ getitemname( .@coin[.@i +1] ) +":"; next; .@s = select( .@menu$ ) -1; if ( countitem( .@coin[.@s] ) < 100 ) { mes "you don't have enough coin to get .... blah blah"; close; } mes "input the amount of desired "+ getitemname( .@coin[.@s +1] ); if ( input( .@amount, 1, 100 ) ) { mes "invalid range"; close; } else if ( .@amount * 100 > countitem( .@coin[.@s] ) ) { mes "you don't have enough coins for it"; close; } delitem .@coin[.@s], .@amount * 100; getitem .@coin[.@s +1], .@amount; close; }I'm not sure how many months until you are able to understand this kind of advance scripting techniquebut as you can see, I didn't use a single label for it so if you wanna become a great scripter, you should try to script without using *menu or *goto and 3rd, your script has an exploit 1. @item 673 100 ... you get 100 bronze coin 2. asked to change bronze coin to silver coin 3. it ask for input how many you want to change, input 5 bam, error message [Error]: script:delitem: failed to delete 500 items (AID=2000000 item_id=673). [Debug]: Source (NPC): Exchange House at prontera (159,177)you need to do a check for that, which you can check at mine Quote Link to comment Share on other sites More sharing options...
Kido Posted December 25, 2013 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Author Share Posted December 25, 2013 your blog catches my attention, so I like to comment on your 1st script xD 1st thing that comes to mind is that you need to learn proper indent for example, prontera,159,177,4 script Exchange House 935,{ mes "Table of values"; mes "100 Bronze = 1 Silver"; mes "100 Silver = 1 Gold"; mes "100 Gold = 1 Mithril"; mes "100 Mithril = 1 Platinum"; mes "100 Platinum = 1 Proof of Donation"; next; menu "Bronze to Silver",L_BS,"Silver to Gold",L_SG,"Gold to Mithril",L_GM,"Mithril to Platinum",L_MP,"Platinum to Proof of Don.",L_PP,"nothing, thank you anyway",L_ND; next; L_ND: mes "Allright, if you need to get some coins come to me."; close; no_item: mes "You don't have enought Coin to get the desired amount of coins that you specified."; close; L_BS: if(countitem(673)<100)goto no_item; mes "Input the amount of desired Silver Coins."; mes "Remember: 100 Bronze Coin = 1 Silver Coin"; mes "I can exchange you a Maxium of: 100 of your desired coin."; mes "I DO NOT DO REFUNDS, input the amount that correctly matches with your affordable desired coins that you want."; input @amount,0,100; delitem 673,1*@amount*100; getitem 675,1*@amount; close;it may have not much affect in a simple script like this, but when you are trying to write a more advance scriptswithout proper indent the script will look very horrible and harder to read 2nd thing comes to mind, try not to use so many labels I can only rewrite your script to prove ya //===== rAthena Script ======================================= //= Kido's First Scrip Release: Coin to Coin Exchanger //===== By: ================================================== //= 100% Kido //===== YOU CAN NOT ========================================== //= Remove the credits //===== YOU CAN ============================================== //= Improve it //============================================================ prontera,159,177,4 script Exchange House 935,{ mes "choose ..."; setarray .@coin, 673,675,671,674,677,7179; for ( .@i = 0; .@i < 5; .@i++ ) .@menu$ = .@menu$ + getitemname( .@coin[.@i] ) +" -> "+ getitemname( .@coin[.@i +1] ) +":"; next; .@s = select( .@menu$ ) -1; if ( countitem( .@coin[.@s] ) < 100 ) { mes "you don't have enough coin to get .... blah blah"; close; } mes "input the amount of desired "+ getitemname( .@coin[.@s +1] ); if ( input( .@amount, 1, 100 ) ) { mes "invalid range"; close; } else if ( .@amount * 100 > countitem( .@coin[.@s] ) ) { mes "you don't have enough coins for it"; close; } delitem .@coin[.@s], .@amount * 100; getitem .@coin[.@s +1], .@amount; close; }I'm not sure how many months until you are able to understand this kind of advance scripting techniquebut as you can see, I didn't use a single label for it so if you wanna become a great scripter, you should try to script without using *menu or *goto and 3rd, your script has an exploit 1. @item 673 100 ... you get 100 bronze coin 2. asked to change bronze coin to silver coin 3. it ask for input how many you want to change, input 5 bam, error message [Error]: script:delitem: failed to delete 500 items (AID=2000000 item_id=673). [Debug]: Source (NPC): Exchange House at prontera (159,177)you need to do a check for that, which you can check at mine haha thank your replying me, since i readed that you like to criticize other scripts i was hoping you to repply so i can improve xD may it will take me years to understand the whole scripting thing x_x but i find it funny and interesting to read o: i only know that kind of menu, also know the " "switch( select("Cat1:Cat2:Cat3:Cat4") ){" " and the common labels D:! huh how to fix that exploit ? because it's supposed not to happen DDDD:! thanks i will try to improve it and update the post, will credit you :3 Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted December 26, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted December 26, 2013 L_BS: if(countitem(673)<100)goto no_item; mes "Input the amount of desired Silver Coins."; mes "Remember: 100 Bronze Coin = 1 Silver Coin"; mes "I can exchange you a Maxium of: 100 of your desired coin."; mes "I DO NOT DO REFUNDS, input the amount that correctly matches with your affordable desired coins that you want."; input @amount,0,100; if ( @amount * 100 > countitem(673) ) goto input_too_high; delitem 673,1*@amount*100; getitem 675,1*@amount; close; no_item: mes "You don't have enought Coin to get the desired amount of coins that you specified."; close; input_too_high: mes "You can't input higher number than the coins you currently have !"; close;something like this I guess Quote Link to comment Share on other sites More sharing options...
Kido Posted January 9, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Author Share Posted January 9, 2014 isn't there something like: if input amount > 100 countitem(673) goto input_too_high; ? i tryied but the npc stopped working D:! Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted January 9, 2014 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 9, 2014 i tryied but the npc stopped working D:!where is your edited script ? and the server error if you are getting any though, if you want a support, should open a new topic in script support though Quote Link to comment Share on other sites More sharing options...
Kido Posted February 12, 2014 Group: Members Topic Count: 127 Topics Per Day: 0.03 Content Count: 1445 Reputation: 164 Joined: 08/17/13 Last Seen: July 11, 2019 Author Share Posted February 12, 2014 Updated 12/02/2014 i tryied but the npc stopped working D:!where is your edited script ? and the server error if you are getting anythough, if you want a support, should open a new topic in script support though yeah i will, also i will first add some colors and then try to add that part x_x because it stills show that thing of the exploit D: Quote Link to comment Share on other sites More sharing options...
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.