ƸӜƷ 0 Posted October 15, 2019 Share Posted October 15, 2019 Hello world ! I need you for the first time because i'm in a project : research ice by drone like the series "Mars" on mars from the Galacticraft mod but i have problems for programing : for the client (drone) it's done but for the server no i'm stuck i'm using the folowing line for registering the module : modem : local m=require("modem") but it's not working... the error : module modem not found thanks a lot Quote Link to post Share on other sites
0 Nexarius 18 Posted October 18, 2019 Share Posted October 18, 2019 Try: local c = require("component") local m if c.isAvailable("modem") then m = c.getPrimary("modem") end or local c = require("component") local m = c.modem or local m = require("component").modem or local m = require("component").getPrimary("modem") Quote Link to post Share on other sites
0 J_E_Mc 0 Posted October 22, 2019 Share Posted October 22, 2019 (edited) The reason that your code isn't working is that require is a function avaliable in open-os on an eeprom you have to interface directly with the components. try: function getComponent(name) component.proxy(component.list(name, true)()) end local m = getComponent("modem") component.list lists all components with the given name's addresses and type (calling the return value returns the first index's address) component.proxy gives you a "proxy" of the component using an address with out a proxy you would have to use component.invoke to call a method on a component realised that you needed help with the server not the drone sorry, ignore this post. Edited October 22, 2019 by J_E_Mc misread the post Quote Link to post Share on other sites
Hello world !
I need you for the first time because i'm in a project : research ice by drone like the series "Mars" on mars from the Galacticraft mod
but i have problems for programing : for the client (drone) it's done but for the server no i'm stuck
i'm using the folowing line for registering the module : modem :
but it's not working...
the error :
module modem not found
thanks a lot
Link to post
Share on other sites