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?
0
open modular turret
Started by Luanny, Jan 18 2017 12:20 AM
3 replies to this topic
#1
Posted 18 January 2017 - 12:20 AM
#4
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 endDo note, this isn't actually tested. If you need more help with peripherals, I recommend you check out the tutorial KingOfGamesYami posted.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users