LewL Posted March 1, 2021 Group: Members Topic Count: 34 Topics Per Day: 0.02 Content Count: 84 Reputation: 1 Joined: 01/08/20 Last Seen: April 5 Share Posted March 1, 2021 Hello everyone, i'm using @Mabuhay item trader script as my server's Potion Converter the script is working fine. Can someone help me make it Bulk trading/converting? Because as of now it only trade 1 at a time. Would like to make it players can input how many potions they can convert on a single trade. here's the script home you can help me. thanks in advance Potion_Converter.txt Quote Link to comment Share on other sites More sharing options...
0 crazyarashi Posted March 1, 2021 Group: Developer Topic Count: 50 Topics Per Day: 0.02 Content Count: 776 Reputation: 239 Joined: 02/11/17 Last Seen: 5 hours ago Share Posted March 1, 2021 (edited) payon,139,226,5 script Potion Converter 749,{ for(.@i = 0; .@i < .size; .@i += 5) .@menu$ += .trade[.@i+1] + " x " + getitemname(.trade[.@i]) + " for " + .trade[.@i+3] + " x " + getitemname(.trade[.@i+2]) + ":"; .@s = (select(.@menu$) - 1) * 5; .@max = countitem(.trade[.@s]) / .trade[.@s+1]; mes "Max Amount available for trade : " + .@max; next; input .@amount; .@amount = min(.@amount,.@max); if(.@amount > .@max || .@amount == 0){ mes "Amount cannot be 0 or greater than the max tradeable amount."; end; } mes "You have selected " + .trade[.@s+1] + " x " + getitemname(.trade[.@s]) + " for " + .trade[.@s+3] + " x " + getitemname(.trade[.@s+2]) + "?"; mes "This has " + .trade[.@s+4] + "% success rate."; mes "Amount : " + .@amount; mes "Note: everything you trade will be character bound potion."; next; if(select("Cancel:Trade") == 1) end; .@total = countitem(.trade[.@s+1]) * .@amount; if(countitem(.trade[.@s]) < .@total){ mes "You don't have enough item for trade."; end; } delitem .trade[.@s],.trade[.@s+1] * .@amount; for(.@i = 0; .@i < .@amount; .@i++){ if(.trade[.@s+4] < rand(1,100)) continue; .@success++; } mes "Successfully converted amount : " + .@success; getitem .trade[.@s+2],.@success * .trade[.@s+3]; end; OnInit: // < ITEM FOR TRADE >, < AMOUNT >, < ITEM TRADED >, < AMOUNT >, < SUCCESS RATE >.. setarray .trade, 11503,2,32018,1,100; .size = getarraysize(.trade); end; } Edited March 1, 2021 by crazyarashi 1 Quote Link to comment Share on other sites More sharing options...
0 LewL Posted March 1, 2021 Group: Members Topic Count: 34 Topics Per Day: 0.02 Content Count: 84 Reputation: 1 Joined: 01/08/20 Last Seen: April 5 Author Share Posted March 1, 2021 1 hour ago, crazyarashi said: payon,139,226,5 script Potion Converter 749,{ for(.@i = 0; .@i < .@size; .@i += 5) .@menu$ += .trade[.@i+1] + " x " + getitemname(.trade[.@i]) + " for " + .trade[.@i+3] + " x " + getitemname(.trade[.@i+2]) + ":"; .@s = (select(.@menu$) - 1) * 5; .@max = countitem(.trade[.@s]) / .trade[.@s+1]; mes "Max Amount available for trade : " + .@max; next; input .@amount; .@amount = min(.@amount,.@max); if(.@amount > .@max || .@amount == 0){ mes "Amount cannot be 0 or greater than the max tradeable amount."; end; } mes "You have selected " + .trade[.@s+1] + " x " + getitemname(.trade[.@s]) + " for " + .trade[.@s+3] + " x " + getitemname(.trade[.@s+2]) + "?"; mes "This has " + .trade[.@s+4] + "% success rate."; mes "Amount : " + .@amount; mes "Note: everything you trade will be character bound potion."; next; if(select("Cancel:Trade") == 1) end; .@total = countitem(.trade[.@s+1]) * .@amount; if(countitem(.trade[.@s]) < .@total){ mes "You don't have enough item for trade."; end; } delitem .trade[.@s],.trade[.@s+1] * .@amount; for(.@i = 0; .@i < .@amount; .@i++){ if(.trade[.@s+4] < rand(1,100)) continue; .@success++; } mes "Successfully converted amount : " + .@success; getitem .trade[.@s+2],.@success * .trade[.@s+3]; end; OnInit: // < ITEM FOR TRADE >, < AMOUNT >, < ITEM TRADED >, < AMOUNT >, < SUCCESS RATE >.. setarray .trade, 11503,2,32018,1,100; .size = getarraysize(.trade); end; } No errors with the script but it doesn't show anything in game. Quote Link to comment Share on other sites More sharing options...
0 LewL Posted March 1, 2021 Group: Members Topic Count: 34 Topics Per Day: 0.02 Content Count: 84 Reputation: 1 Joined: 01/08/20 Last Seen: April 5 Author Share Posted March 1, 2021 4 hours ago, Azhul said: No errors with the script but it doesn't show anything in game. fixed thanks Quote Link to comment Share on other sites More sharing options...
0 LewL Posted March 4, 2021 Group: Members Topic Count: 34 Topics Per Day: 0.02 Content Count: 84 Reputation: 1 Joined: 01/08/20 Last Seen: April 5 Author Share Posted March 4, 2021 On 3/1/2021 at 4:26 PM, crazyarashi said: payon,139,226,5 script Potion Converter 749,{ for(.@i = 0; .@i < .size; .@i += 5) .@menu$ += .trade[.@i+1] + " x " + getitemname(.trade[.@i]) + " for " + .trade[.@i+3] + " x " + getitemname(.trade[.@i+2]) + ":"; .@s = (select(.@menu$) - 1) * 5; .@max = countitem(.trade[.@s]) / .trade[.@s+1]; mes "Max Amount available for trade : " + .@max; next; input .@amount; .@amount = min(.@amount,.@max); if(.@amount > .@max || .@amount == 0){ mes "Amount cannot be 0 or greater than the max tradeable amount."; end; } mes "You have selected " + .trade[.@s+1] + " x " + getitemname(.trade[.@s]) + " for " + .trade[.@s+3] + " x " + getitemname(.trade[.@s+2]) + "?"; mes "This has " + .trade[.@s+4] + "% success rate."; mes "Amount : " + .@amount; mes "Note: everything you trade will be character bound potion."; next; if(select("Cancel:Trade") == 1) end; .@total = countitem(.trade[.@s+1]) * .@amount; if(countitem(.trade[.@s]) < .@total){ mes "You don't have enough item for trade."; end; } delitem .trade[.@s],.trade[.@s+1] * .@amount; for(.@i = 0; .@i < .@amount; .@i++){ if(.trade[.@s+4] < rand(1,100)) continue; .@success++; } mes "Successfully converted amount : " + .@success; getitem .trade[.@s+2],.@success * .trade[.@s+3]; end; OnInit: // < ITEM FOR TRADE >, < AMOUNT >, < ITEM TRADED >, < AMOUNT >, < SUCCESS RATE >.. setarray .trade, 11503,2,32018,1,100; .size = getarraysize(.trade); end; } Hello @crazyarashi i found a bug with the script, whenever player tries to convert more than 500 then item to be converted will be gone but it wouldn't give the converted item. example: 1000 Siege White Potion to 500 Siege Blue Potion = No Error/Bug (Works fine) 500 Siege Blue Potion to 1000 Siege White Potion = No Error/Bug (Works fine) But when they tried to convert more than 500: 1002 Siege White Potion to 501 Siege Blue Potion = NPC will take Siege White Potion but won't give Siege Blue Potion 501 Siege Blue Potion to 1002 Siege White Potion = NPC will take Siege Blue Potion but won't give Siege White Potion i was thinking if can we put a limit with the conversion upto exactly 500? or maybe fix the bug above? Quote Link to comment Share on other sites More sharing options...
0 botka4aet Posted March 4, 2021 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 211 Reputation: 17 Joined: 12/23/11 Last Seen: June 11, 2024 Share Posted March 4, 2021 you can limit hete if(.@amount > .@max || .@amount == 0 || .@amount > 500){ Quote Link to comment Share on other sites More sharing options...
0 LewL Posted March 5, 2021 Group: Members Topic Count: 34 Topics Per Day: 0.02 Content Count: 84 Reputation: 1 Joined: 01/08/20 Last Seen: April 5 Author Share Posted March 5, 2021 On 3/4/2021 at 3:43 PM, botka4aet said: you can limit hete if(.@amount > .@max || .@amount == 0 || .@amount > 500){ Thanks Quote Link to comment Share on other sites More sharing options...
Question
LewL
Hello everyone, i'm using @Mabuhay item trader script as my server's Potion Converter the script is working fine.
Can someone help me make it Bulk trading/converting? Because as of now it only trade 1 at a time.
Would like to make it players can input how many potions they can convert on a single trade.
here's the script home you can help me. thanks in advance
Potion_Converter.txt
Link to comment
Share on other sites
6 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.