Jump to content




open modular turret


3 replies to this topic

#1 Luanny

  • New Members
  • 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?

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (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...?

#3 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited 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.

#4 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes 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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users