1 posts
Posted 18 January 2017 - 12:20 AM
so this mod has computercraft support but i have no clue how to write scripts but it has a trusted player list and i'd just like to be able to hook up the turret to a computer program and edit the trusted players rather than going from turret to turret to do it manually is there anyone that might be able to help me out with this?
7083 posts
Location
Tasmania (AU)
Posted 18 January 2017 - 12:59 AM
Assuming you mean
this mod, with no online documentation it's difficult to comment on what you can or can't do with it. Perhaps if you copied out whatever the IGW has to say…?
3057 posts
Location
United States of America
Posted 18 January 2017 - 01:00 AM
This sounds like a problem that could be solved reading my
tutorial over using peripherals from other mods.
1426 posts
Location
Does anyone put something serious here?
Posted 18 January 2017 - 12:09 PM
Looking at the
code for the peripheral, you probably want to use addTrustedPlayer. This takes the player name and some additional boolean values (whether they can open the GUI, can change settings and are an admin). There is a similar method to remove players from the list (removeTrustedPlayer). So you could do something like:
-- Loop through all peripherals
local names = peripheral.getNames()
for i = 1, #names do
local name = names[i]
-- If it is a turret then
if peripheral.getType(name) == "OMTBase" then
peripheral.call(name, "addTrustedPlayer", "Kevin") -- You can always use peripheral.wrap instead
end
end
Do note, this isn't actually tested. If you need more help with peripherals, I recommend you check out the tutorial KingOfGamesYami posted.