Page 1 of 1

Store nodes with no inventory [Autostore]

PostPosted: Thu May 05, 2016 14:48
by Nathan.S
Image
I created this mod specifically for use on servers, for something of an admin shop, a place where people can buy stuff, but unlike other mods it doesn't require any inventory of the item being sold, or keep any of the payment, basically it's an unlimited supply that simple removed the items it takes in as payment.

The store exists in two states, an unconfigured and configured state. Simply place a store, put in what item you want to sell and what the payment should be, enter the quantities you will charge and give out, and give the store a name. When you click the save button the store changes into a configured store and is ready to use to buy from.

This mod adds an autostore privilege which is required to dig or place the nodes, anybody can click the save button once an unconfigured store is placed, so be careful with placing them if you aren't setting them up right away.

Download: https://github.com/NathanSalapat/autost ... master.zip
Browse Code: https://github.com/NathanSalapat/autostore
License: CC by SA 4.0

Re: Store nodes with no inventory [Autostore]

PostPosted: Thu May 05, 2016 15:45
by azekill_DIABLO
looks nice!

+1 for inovation and pixely textures

Re: Store nodes with no inventory [Autostore]

PostPosted: Thu May 05, 2016 20:18
by Don
+1

Re: Store nodes with no inventory [Autostore]

PostPosted: Thu May 05, 2016 21:38
by maikerumine
This is clever and very clean. I bet this would help reduce server lad on heavily populated shop areas. I know the ESM server is a bit laggy around the shops.;

Thank you for this mod, I will use it for all the weapon and armor shops so I don't have to refill all the time!!

Re: Store nodes with no inventory [Autostore]

PostPosted: Thu May 05, 2016 22:56
by Nathan.S
Nice, let me know if you have any issues or think of some improvements.

Re: Store nodes with no inventory [Autostore]

PostPosted: Fri May 06, 2016 04:18
by TG-MyinaWD
Ideas
You can setup a ATM like one that you can withdraw/transfer your Minegold (OR whatever the money was).
Limit of time shop open/close.
Limit each time a item can by bought by same player.

All got for now ;) btw Followed you on Twitter. (Mine is @MinetestWidDos)

Re: Store nodes with no inventory [Autostore]

PostPosted: Fri May 06, 2016 13:24
by rubenwardy
The name confused me a little, I thought it meant

Store [nodes with no inventory]

Nice mod though. I find economies quite interesting in games. Cool video: http://youtube.com/watch?v=W39TtF14i8I

Re: Store nodes with no inventory [Autostore]

PostPosted: Thu Sep 15, 2016 17:31
by ParaklataChotou
Thank you natan. I'll try this mod. I removed smartshop - that mod was really glitchy, and I installed simple shop - but I need to replace items. this could be an excellent option for me. Thank you. I'll try on my debug world. and then, try on my server.

Re: Store nodes with no inventory [Autostore]

PostPosted: Thu Sep 15, 2016 23:30
by Nathan.S
I actually created this mod to be used on a server, as we wanted to have admin shops, but didn't want to have to fill them with items to sell.

Re: Store nodes with no inventory [Autostore]

PostPosted: Sat Sep 17, 2016 08:37
by ParaklataChotou
Nathan.S wrote:I actually created this mod to be used on a server, as we wanted to have admin shops, but didn't want to have to fill them with items to sell.


Natan, the mod needs to be patched:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
win64\bin\..\mods\autostore\init.lua:81: attempt to concatenate local 'cost_amount' (a nil value)
2016-09-17 01:02:19: ERROR[Main]: stack traceback:
2016-09-17 01:02:19: ERROR[Main]:    ...test-0.4.14-b11720a-win64\bin\..\mods\autostore\init.lua:81: in function <...test-0.4.14-b11720a-win64\bin\..\mods\autostore\init.lua:52>


It causes a server crash too. If you can fix it would be great.

Re: Store nodes with no inventory [Autostore]

PostPosted: Sat Sep 17, 2016 13:11
by Nathan.S
Odd, I just tried it on a local game and don't get any error.
I wonder if maybe the input boxes for the quantities for some reason were a non-number.

Looking at your error codes it looks like you might not have the latest version? Line 81 in the current code doesn't have cost_amount at all. I'd try updating https://github.com/NathanSalapat/autostore

Re: Store nodes with no inventory [Autostore]

PostPosted: Sun Sep 18, 2016 02:48
by ParaklataChotou
Nathan.S wrote:Odd, I just tried it on a local game and don't get any error.
I wonder if maybe the input boxes for the quantities for some reason were a non-number.

Looking at your error codes it looks like you might not have the latest version? Line 81 in the current code doesn't have cost_amount at all. I'd try updating https://github.com/NathanSalapat/autostore


I've got 4.14 downloaded on official page. I'll download this new patch. Thanks

Re: Store nodes with no inventory [Autostore]

PostPosted: Mon Sep 19, 2016 02:05
by Nathan.S
no problem, be sure to let me know if you continue to have any problems.

Re: Store nodes with no inventory [Autostore]

PostPosted: Mon Sep 19, 2016 03:04
by ParaklataChotou
Nathan.S wrote:no problem, be sure to let me know if you continue to have any problems.


Ok. It's working fine at the moment. Thank you. This mod it's really amazing: lite, practical and efficient. I'm testing this mod on my server.
IP:minepastry.zapto.org
Port: 30000
viewtopic.php?f=10&t=15384

Re: Store nodes with no inventory [Autostore]

PostPosted: Mon Sep 19, 2016 21:58
by ParaklataChotou
:\\\\\\\\\\\ :( T.T

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
2016-09-19 17:24:18: ERROR[Main]: stack traceback:
2016-09-19 17:24:18: ERROR[Main]:    ...test-0.4.14-b11720a-win64\bin\..\mods\autostore\init.lua:118: in function <...test-0.4.14-b11720a-win64\bin\..\mods\autostore\init.lua:110>

Re: Store nodes with no inventory [Autostore]

PostPosted: Tue Sep 20, 2016 01:54
by Nathan.S
ParaklataChotou wrote::\\\\\\\\\\\ :( T.T

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
2016-09-19 17:24:18: ERROR[Main]: stack traceback:
2016-09-19 17:24:18: ERROR[Main]:    ...test-0.4.14-b11720a-win64\bin\..\mods\autostore\init.lua:118: in function <...test-0.4.14-b11720a-win64\bin\..\mods\autostore\init.lua:110>


Is that all the error gives? Nothing else in the debug file? Right now I'm really not sure what could be going on. Just tried making something crash, and got nothing. When I entered values of zero to be selling the store just showed empty boxes.

Do you know who was setting up the store when it crashed, and if so could you ask them what they were trying to sell, possibly there is some odd situation that I hadn't thought of.

Re: Store nodes with no inventory [Autostore]

PostPosted: Tue Sep 20, 2016 07:59
by ParaklataChotou
Do you mean about give command? Well, I'm using to add items. Oh, you mean if I add more than one item inside these autostores machines could produce an error? Well, maybe.

Re: Store nodes with no inventory [Autostore]

PostPosted: Tue Sep 20, 2016 11:48
by Nathan.S
To get the stores you need to use give, there is no crafting, so that wouldn't create an error.

The store should have two items added to it when being set up, the item being sold, and whatever you are asking for payment. The amounts default to 1, but you can change that to any numerical value.

I never tested the code to see how it handles people selling/buying mobs or anything that isn't an node, craftitem, or tool, possibly something could be happening if you are trying to sell animals or something.

Re: Store nodes with no inventory [Autostore]

PostPosted: Tue Sep 20, 2016 16:00
by ParaklataChotou
Nathan.S wrote:To get the stores you need to use give, there is no crafting, so that wouldn't create an error.

The store should have two items added to it when being set up, the item being sold, and whatever you are asking for payment. The amounts default to 1, but you can change that to any numerical value.

I never tested the code to see how it handles people selling/buying mobs or anything that isn't an node, craftitem, or tool, possibly something could be happening if you are trying to sell animals or something.


Wait, I was talking about the /giveme command.
Of course, I added the item on give section. And I tested the transaction and it works fine. But sometimes the autostore crashes the server - such as the smartshop did - , and on debug info says that 'there's an error of int.lua in the 110 line'. Or maybe it's the world I've created who caused this issue. Or it's caused becaused I added so many autostores for each kind of item/block in the server - maybe. I was testing so many kinds of mobs mods when I created this server. I used /clearobjects to delete all unknown files floating in my world; but maybe these mods damaged the world configuration - maybe. I used v5 to create my world.

BUT MAYBE YOU'RE RIGHT. THE MOBS ITEMS CAUSES THIS PROBLEM. I'LL ADD THE MOBS TO SIMPLE SHOP, AND OTHER ITEMS ON AUTOSTORE. THANKS AGAIN.

Re: Store nodes with no inventory [Autostore]

PostPosted: Tue Sep 20, 2016 16:21
by Nathan.S
I wish the error code was more specific, it could help me debug this, as there is no reason this should be crashing the server.