r/ComputerCraft • u/Sorabros411 • Mar 26 '26
Need help writing a code for a Cobblemon server
Tldr im playing AllTheMons and I added a gacha machine mod to it to let my players on a server use Relic Coins to buy prizes from the machines.
Issue, theres another currency in the game that we have a massive abundance of that can only be used for some villager trading and nothing else.
Can someone write up a simple code that lets my players take the coins you get from battles and put em in an exchange chest or something that runs a command that turns em into a Relic Coin at a rate of 64 coins for 1 relic?
6
Upvotes
1
u/Sorabros411 Mar 26 '26
Bonus points if you can display the item conversions on a monitor or something like so they just right click the screen and it converts the coins
1
u/Bright-Historian-216 Mar 26 '26
I wrote a script years ago that basically acts as a trading menu. https://pastebin.com/AjFu19cd
add a command computer (available in creative menu) and place an advanced monitor on top (make it three blocks wide for best results, you can also make it higher optionally), open the computer and run "pastebin get AjFu19cd startup"
then run "edit startup", go to line 40 and edit the trades available. you can add new trades, or just leave it at two.
yes the code is horrible, i made it a long time ago. but for your purposes it should work.