[Mod] Laptop (WIP) (V. 0.41)

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Laptop (WIP) (V. 0.39)

by bell07 » Post

The Laptop OS does use Nodemeta for data storage and for formspecs. So the OS requires a node to work (=Hardware). To open Nodemeta's formspec without right-click is not possible.
But I think you do not need the full framework for your game or concept. What do you need? Just a framework: you can use smartfs. My smart_inventory does use smartfs for example.

The Theming: themes.lua could be used in other projects slightly modified.

The "Window Manager" Stack? Ok, this needs to be written new, optimized to your needs.

I am the author of Laptop-OS and may can help you to port some functionalities to your project. Just mention me in a github issue and I look if I can help you.

vtwindsurfer
Member
Posts: 13
Joined: Sun Oct 01, 2017 14:57
Location: Vermont, USA

Re: [Mod] Laptop (WIP) (V. 0.39)

by vtwindsurfer » Post

A strange bug popped up for me recently. I've been using this mod for a while and I have not made any changes or updates recently. When I try to print a document, my server crashes with the following:

Code: Select all

2018-10-28 12:19:13: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'laptop' in callback node_on_receive_fields(): /usr/share/minetest/builtin/common/misc_helpers.lua:597: attempt to concatenate local 'color' (a nil value)
2018-10-28 12:19:13: ERROR[Main]: stack traceback:
2018-10-28 12:19:13: ERROR[Main]: 	/usr/share/minetest/builtin/common/misc_helpers.lua:597: in function 'get_color_escape_sequence'
2018-10-28 12:19:13: ERROR[Main]: 	/usr/share/minetest/builtin/common/misc_helpers.lua:606: in function 'colorize'
2018-10-28 12:19:13: ERROR[Main]: 	...netest/mods/minetest-laptop-master/apps/os_print_app.lua:220: in function 'formspec_func'
2018-10-28 12:19:13: ERROR[Main]: 	..._server/.minetest/mods/minetest-laptop-master/app_fw.lua:11: in function 'get_formspec'
2018-10-28 12:19:13: ERROR[Main]: 	...st_server/.minetest/mods/minetest-laptop-master/mtos.lua:349: in function 'set_app'
2018-10-28 12:19:13: ERROR[Main]: 	...st_server/.minetest/mods/minetest-laptop-master/mtos.lua:406: in function 'print_file_dialog'
2018-10-28 12:19:13: ERROR[Main]: 	...test/mods/minetest-laptop-master/apps/stickynote_app.lua:76: in function <...test/mods/minetest-laptop-master/apps/stickynote_app.lua:33>
2018-10-28 12:19:13: ERROR[Main]: 	..._server/.minetest/mods/minetest-laptop-master/app_fw.lua:36: in function 'receive_data'
2018-10-28 12:19:13: ERROR[Main]: 	...st_server/.minetest/mods/minetest-laptop-master/mtos.lua:370: in function 'pass_to_app'
2018-10-28 12:19:13: ERROR[Main]: 	...er/.minetest/mods/minetest-laptop-master/hardware_fw.lua:61: in function <...er/.minetest/mods/minetest-laptop-master/hardware_fw.lua:59>
Strange because it only happens to certain computers in certain locations (not all of them, at least, not yet). I've rebooted the server, reinstalled the mod but the problem persists. I don't really know lua but I'm slowly learning but I don't even know where to start with this so I figured I'd ask the experts. Does anyone know what the problem is? Is there anything I can do to fix it?

User avatar
StarNinjas
Member
Posts: 411
Joined: Wed Mar 14, 2018 00:32
GitHub: starninjas
IRC: StarNinjas
In-game: J1
Location: Terrarca
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by StarNinjas » Post

GA is not here right now he is at USA Army boot camp he will be back soon but maybe bell07 could help.

-J1
Don't go to bed tonight, without knowing what would happen if you died. https://thegospelfilm.org/

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Laptop (WIP) (V. 0.39)

by bell07 » Post

Thank you for the bug report. Found the issue with printer app and "Printer removed" Status. Fixed in GA and my fork github repo

User avatar
MCL
Member
Posts: 654
Joined: Mon Aug 20, 2018 00:44
GitHub: MCLx86
IRC: migdyn
In-game: singleplayer
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by MCL » Post

Nice mod
2014-02-14 - 2024-02-14 TEN YEARS OF MCL

User avatar
GamingAssociation39
Member
Posts: 858
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: [Mod] Laptop (WIP) (V. 0.39)

by GamingAssociation39 » Post

migdyn wrote:Nice mod
Thanks but all credit goes to Bell07
Jesus Is Lord and Savior!!!

Isja Krass
Member
Posts: 46
Joined: Sat Aug 18, 2018 19:30
In-game: init.lua
Location: {X=25.25, y=-400, z=478,8} Bavaria, Germany

Re: [Mod] Laptop (WIP) (V. 0.39)

by Isja Krass » Post

maybe you can add Servers, that can do different thigs.

for example:
[*] mailserver: players can write E-Mails
[*] mediaserver: players can listen to some music
[*] gameserver: players can play minigames together
[*] bank-account server: a onlinebanking server for the currency mod
[*] cloud server: data storage

serves should be placeable and amenable like digiline-cannels.

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by FreeGamers » Post

I've run into an error when using the "item_drop" mod.

I had players report to me that they could infinitely duplicate computers ("laptops") by placing a computer and punching it to pick it back up. It instantly adds the computer to inventory but also drops another computer in the world. I haven't looked at the source for this mod yet, but I'd suspect that it is manually adding it to inventory somehow but the item_drop mod is likely overriding default behavior in MT.

I was able to reproduce the issue myself with a test user account with basic privs. It doesn't occur with an admin account in creative. I haven't experienced this with any other nodes/items in my server yet. I've used a large number of mods with item_drop too.

I gave three players one cp core laptop each only to find that they had tiled the floor of their patio with about two dozen laptops.

EDIT: I eventually fixed this by disabling item_drop_on_dig or whatever its called fro the item_drop mod.
Last edited by FreeGamers on Sun Jul 28, 2019 17:58, edited 1 time in total.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

FaceDeer
Member
Posts: 506
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod] Laptop (WIP) (V. 0.39)

by FaceDeer » Post

Hi, I just posted an initial alpha version of a new mod called commoditiesmarket and I'm told it might serve as a useful component for this mod to incorporate or call upon so I figured I should comment here. Currently there's just a simple "show_market" API to pop open a formspec for a given market, I can add more hooks if desired to make it easier to use by this mod or other similar frameworks. I haven't tried out this mod myself before so I don't know what it's interface is like.

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by FreeGamers » Post

I am trying to integrate the commoditymarket mod as an app into Laptop but I am having trouble passing a simple name of the current player to the function. Can someone help?

Code: Select all

laptop.register_app("ecommerce", {
	app_name = "eCommerce",
	app_icon = "commoditymarket_gold_coins.png",
	app_info = "Online Commodity Market",
	formspec_func = function()
	local name = (mtos.sysram.current_player)
		commoditymarket.show_market("kings", name)
	end,
})
2020-05-20 02:00:29: WARNING[Server]: Undeclared global variable "mtos" accessed at ..._simple_survival_game/mods/laptop/apps/ecommerce_app.lua:6
2020-05-20 02:00:29: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'laptop' in callback node_on_receive_fields(): ..._simple_survival_game/mods/laptop/apps/ecommerce_app.lua:6: attempt to index global 'mtos' (a nil value)
2020-05-20 02:00:29: ERROR[Main]: stack traceback:
2020-05-20 02:00:29: ERROR[Main]: ..._simple_survival_game/mods/laptop/apps/ecommerce_app.lua:6: in function 'formspec_func'
2020-05-20 02:00:29: ERROR[Main]: .../games/saras_simple_survival_game/mods/laptop/app_fw.lua:11: in function 'get_formspec'
2020-05-20 02:00:29: ERROR[Main]: ...st/games/saras_simple_survival_game/mods/laptop/mtos.lua:373: in function 'pass_to_app'
2020-05-20 02:00:29: ERROR[Main]: ...s/saras_simple_survival_game/mods/laptop/hardware_fw.lua:61: in function <...s/saras_simple_survival_game/mods/laptop/hardware_fw.lua:59>
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Laptop (WIP) (V. 0.39)

by bell07 » Post

@FreeGamers. You forgotten the formspec_func parameters

Code: Select all

formspec_func = function(app, mtos)
In case no current agent assigned you need to handle the mtos.sysram.current_player is empty.
You can look into the mail_app how I did it

Code: Select all

		if not mtos.sysram.current_player then
			mtos:set_app() -- no player. Back to launcher
			return false
		end

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by FreeGamers » Post

All this app really needs to do is pass a playername to commoditymarket and call the function from that mod. I've tried copying some of those functions from the mail app before and it ended with more errors. I spent a few hours last night working on this (before I posted here initially) and was getting pretty confused. I'm still learning... this is what I've ended up with now.

I've addede the receive_fields_func because I was getting some errors mentioning it. This is what I currently have now. Still crashes when the app is called.

Code: Select all

laptop.register_app("ecommerce", {
	app_name = "eCommerce",
	app_icon = "commoditymarket_gold_coins.png",
	app_info = "Online Commodity Market",
	formspec_func = function(app, mtos)		
	
	-- No player, so go back to the app launcher
		if not mtos.sysram.current_player then
			mtos:set_app()
			return false
		end	

	-- Declare variable used to hold the player name for commoditymarket function.
		local name = (mtos.sysram.current_player)
		commoditymarket.show_market("kings", name)

	-- End the formspec_func function.	
	end,
	
	receive_fields_func = function (app, mtos)

	-- if the player changed, return to app launcher.		
		if mtos.sysram.current_player ~= mtos.sysram.last_player then
			mtos:set_app() -- wrong player. Back to launcher
			return
		end

	-- End the receive_fields_func.	
	end,
})
2020-05-20 09:51:36: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'laptop' in callback node_on_receive_fields(): .../games/saras_simple_survival_game/mods/laptop/app_fw.lua:28: attempt to concatenate local 'app_result' (a nil value)
2020-05-20 09:51:36: ERROR[Main]: stack traceback:
2020-05-20 09:51:36: ERROR[Main]: .../games/saras_simple_survival_game/mods/laptop/app_fw.lua:28: in function 'get_formspec'
2020-05-20 09:51:36: ERROR[Main]: ...st/games/saras_simple_survival_game/mods/laptop/mtos.lua:373: in function 'pass_to_app'
2020-05-20 09:51:36: ERROR[Main]: ...s/saras_simple_survival_game/mods/laptop/hardware_fw.lua:61: in function <...s/saras_simple_survival_game/mods/laptop/hardware_fw.lua:59>
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Laptop (WIP) (V. 0.39)

by bell07 » Post

@FreeGamers, the formspec_func needs to return any formspec string (or false).

Try something like

Code: Select all

	local market = commoditymarket.registered_markets["kings"]
	if market == nil then return end
	local formspec = market:get_formspec(market:get_account(player_name))
	return formspec or false
Code taken from commoditymarket.show_market() function

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: [Mod] Laptop (WIP) (V. 0.39)

by FreeGamers » Post

I'm going to stop working on this. I no longer think integrating commoditymarket into the laptop apps works for my game (balance breaking in terms of inventory accessibility in survival) and I don't want to invest additional time into this when I have many other bugs to try to fix and features to implement.

I think getting these two mods to work together would really provide a powerful way to access markets. I think this greatly increase the value of the laptop as well as the ease of access for a market to many players.

I use commoditymarket on my survival game and players don't seem to use it as much as I thought they would. Smartshops (a vending machine) still are much more common. I'm not exactly sure why that is (probably complexity and availability), but I initially wanted to implement these two mods as an eCommerce app to make both of these mods more used.

However for survival purposes, I think the exploitation of holding items in the market as additional inventory storage could backfire. This could probably de-incentized easily with storage limits or listing fees.

bell07, I'm going to pause on this for right now. I could not figure out how to make it work. I am extremely grateful for your assistance on this.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

User avatar
jolotico
New member
Posts: 7
Joined: Thu Jul 11, 2019 17:36
GitHub: jolotico
In-game: julito

Re: [Mod] Laptop (WIP) (V. 0.39)

by jolotico » Post

How can I install the minebrowser-sites to make it work?

User avatar
GamingAssociation39
Member
Posts: 858
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: [Mod] Laptop (WIP) (V. 0.40)

by GamingAssociation39 » Post

UPDATE:
Thanks to SFENCE we now have power_generators & technic support for power. If these aren't enabled then the laptops are the same as before.
Jesus Is Lord and Savior!!!

User avatar
GamingAssociation39
Member
Posts: 858
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: [Mod] Laptop (WIP) (V. 0.40)

by GamingAssociation39 » Post

jolotico wrote:
Fri Jun 19, 2020 00:25
How can I install the minebrowser-sites to make it work?
By using this link you can add them to the apps folder of the laptop mod.
https://github.com/Gerold55/MineBrowse-Sites
Jesus Is Lord and Savior!!!

User avatar
apercy
Member
Posts: 638
Joined: Wed Mar 25, 2020 16:31
GitHub: APercy
In-game: APercy
Location: Pinheiral - RJ - Brazil

Re: [Mod] Laptop (WIP) (V. 0.40)

by apercy » Post

I made a privs check app, for browser, I use it at my private server
and I use "os_max_version" on the output page to limit the page listing

Code: Select all

privs_page_selected_name = ''

laptop.register_view("privs.minetest", {
	app_info = "Show Privs",
	browser_page = true,
    --os_max_version = "1",
    browser_main_page = true,
	formspec_func = function(app, mtos)
		local formspec = laptop.browser_api.header_formspec_func(app, mtos) ..
        --Begin Navigation
        mtos.theme:get_label('2, 2.2', 'Privs') ..
        mtos.theme:get_label('2, 3', 'Type the name bellow. Or leave it empty to show your own privs.') ..
        "field[2,5;5,0.8;name;Name;]"..
        "button[8,4.7;3,0.8;send;Send]"
		return formspec
	end,
	receive_fields_func = function(app, mtos, sender, fields)
        if fields.send then
            local name = fields.name
            if name == nil or name == '' then name = sender:get_player_name() end
            privs_page_selected_name = name
            laptop.browser_api.navigate(app, mtos, 'list_privs.minetest')
        end
		laptop.browser_api.header_receive_fields_func(app, mtos, sender, fields)
	end
})

laptop.register_view("list_privs.minetest", {
	app_info = "List Privs",
	browser_page = true,
    os_max_version = "1",
	formspec_func = function(app, mtos)
        local name = privs_page_selected_name
		local formspec = laptop.browser_api.header_formspec_func(app, mtos) ..
        --Begin Navigation
        mtos.theme:get_label('1, 1.5', 'Privs of ' .. name)
        if name then
            --formspec = formspec .. "container[4,0;]"
            formspec = formspec .. "scrollbar[0.4,2.2;0.2,7;vertical;privs;0]" ..
            "scroll_container[1,3;10,8;privs;vertical]"
            local player_privs = minetest.get_player_privs(name)
            local y = 0
            if player_privs then
                for i,v in pairs( player_privs ) do
                    --minetest.chat_send_all(dump(i))
                    --minetest.chat_send_all(dump(v))
                    local coordinate = '0, '..y
                    formspec = formspec .. mtos.theme:get_label(coordinate, i .. " = " .. string.format("%s\n", tostring(v)))
                    y = y + 0.3
                end
            end
            --formspec = formspec .. "container_end[]"
            formspec = formspec .. "scroll_container_end[]"
        end

		return formspec
	end,
	receive_fields_func = function(app, mtos, sender, fields)
		laptop.browser_api.header_receive_fields_func(app, mtos, sender, fields)
	end
})

User avatar
GamingAssociation39
Member
Posts: 858
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: [Mod] Laptop (WIP) (V. 0.41)

by GamingAssociation39 » Post

UPDATE:

Thanks to SFENCE, we introduce to you the painting app.
Jesus Is Lord and Savior!!!

Фред Канниг
Member
Posts: 15
Joined: Fri Dec 13, 2019 10:11

Re: [Mod] Laptop (WIP) (V. 0.41)

by Фред Канниг » Post

21-07-2022-01-02.png
21-07-2022-01-02.png (202.99 KiB) Viewed 1625 times
1. How it works?
2. When updating a mod, the files added to it disappear.
P.S. Sorry for my English.

ChristienChapman
Member
Posts: 117
Joined: Sat May 28, 2022 00:04

Re: [Mod] Laptop (WIP) (V. 0.41)

by ChristienChapman » Post

Implement java lol.
God bless you.

List of releases:
Minetest Zombies Minigame - viewtopic.php?f=9&t=28442&p=412633#p412633

- > cdb_1d60e1a03f83

SFENCE
Member
Posts: 274
Joined: Sun Sep 29, 2019 07:13
GitHub: SFENCE
In-game: SFENCE

Re: [Mod] Laptop (WIP) (V. 0.41)

by SFENCE » Post

Фред Канниг wrote:
Wed Jul 20, 2022 22:33
21-07-2022-01-02.png
1. How it works?
2. When updating a mod, the files added to it disappear.
P.S. Sorry for my English.
Did you try the button new 16 or new 32?

When you open or create a new image, you should select a color by clicking the colored square on the right side of the set button and using it by clicking into the painting area.

Maybe, you will need to update your minetest version.
Attachments
screenshot_20220802_110601.png
screenshot_20220802_110601.png (140.49 KiB) Viewed 1551 times
cdb_3P0AYqjEIn68

ChernobylChicken
New member
Posts: 1
Joined: Sat Aug 20, 2022 11:10

Re: [Mod] Laptop (WIP) (V. 0.41)

by ChernobylChicken » Post

2022-08-20 10:40:01: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'laptop_extend_pack_2' in callback node_on_receive_fields(): ...ome/container/bin/../builtin/common/misc_helpers.lua:253: attempt to index local 'text' (a number value)
2022-08-20 10:40:01: ERROR[Main]: stack traceback:
2022-08-20 10:40:01: ERROR[Main]: ...ome/container/bin/../builtin/common/misc_helpers.lua:253: in function 'formspec_escape'
2022-08-20 10:40:01: ERROR[Main]: ...iner/bin/../worlds/world/worldmods/laptop/themes.lua:91: in function 'get_label'
2022-08-20 10:40:01: ERROR[Main]: ...orlds/world/worldmods/laptop/apps/TNTsweeper_app.lua:137: in function 'formspec_func'
2022-08-20 10:40:01: ERROR[Main]: ...iner/bin/../worlds/world/worldmods/laptop/app_fw.lua:11: in function 'get_formspec'
2022-08-20 10:40:01: ERROR[Main]: ...tainer/bin/../worlds/world/worldmods/laptop/mtos.lua:405: in function 'pass_to_app'
2022-08-20 10:40:01: ERROR[Main]: ...bin/../worlds/world/worldmods/laptop/hardware_fw.lua:64: in function <...bin/../worlds/world/worldmods/laptop/hardware_fw.lua:62>

User avatar
j0j0n4th4n
Member
Posts: 249
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Laptop (WIP) (V. 0.41)

by j0j0n4th4n » Post

I'm having trouble with the minibrowser sites, whenever I add them to the apps folder I get an error at start up:

Code: Select all

mods/computer_pack/laptop/apps/browser_page_pk_app.lua:2: attempt to index field 'browser_api' (a nil value)
It only happens with the "browser_page_pk_app.lua", "browser_page_servers_app.lua" and "browser_page_test_app.lua". The "browser_lott_app.lua" and the "browser_minetest_app.lua" works fine
cdb_894a100ddd76

Фред Канниг
Member
Posts: 15
Joined: Fri Dec 13, 2019 10:11

Re: [Mod] Laptop (WIP) (V. 0.41)

by Фред Канниг » Post

How to create a separate module folder where you can add applications for this laptop without affecting the main folder of this module?

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot] and 11 guests