This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
CMaster's profile picture

[LanteaCraft]Stargate Control

Started by CMaster, 08 February 2014 - 07:52 AM
CMaster #1
Posted 08 February 2014 - 08:52 AM
Stargate Control by CMaster
Available from pastebin at wcg4kYVw

This program interfaces with the Stargates provided by LanteaCraft to provide a cheaper and easier to use alternative to the stargate control device.
Simply install to a computer with a stargate control base ring as an available peripheral.
For extra features, connect a monitor as well.

Feature list:
  • One click/select to dial saved gates
  • Disconnect the gate
  • Stargate status displayed on a monitor of your choice
  • Upload and download saved lists of gate addresses from pastebin
  • Interface compatible with both advanced and normal computers
Known issues:
  • Advanced computer interface doesn't scroll - use a basic computer if your gate list is too long for now.
  • Downloading an invalid gate list causes problems until it's delteted.
Important: This program will download two dependencies from pastebin on first run. If you don't have pastebin access, you will also need to install them.
They are:
commonFunctions http://pastebin.com/x5Ve1KSK (A set of functions used across several of my MC groups programs, dating back to MC1.2, so some out of date bumf)
gooey http://pastebin.com/KpJ8K6xm (A set of crude GUI creation tools)

Edited on 08 February 2014 - 07:58 AM
coolmark1995 #2
Posted 29 March 2014 - 08:25 AM
how do you attach the stargate?
Dog #3
Posted 31 March 2014 - 10:55 PM
I've made it work by attaching the gate to the computer via modem/network cable, or by placing the computer under the stargate base block. Hope that helps :)/>

@CMaster - you should call the disconnect using pcall, that way the program won't error out if there is no connection or the call originated from the other gate and one-way-calling is enabled in the config.


function Disconnect()
  ok, err = pcall(gate.disconnect)
  if ok then
	term.clear()
	term.setCursorPos(3,6)
	term.write("Disconnecting")
	updateStatus()
  end
  sleep(1)
end

You could also move the call to updateStatus() out of the if statement so it's called whether a disconnect is successful or not.
Edited on 31 March 2014 - 09:19 PM
SpencerBeige #4
Posted 23 June 2015 - 05:22 AM
i press enter, but errors on line 24
TyRao #5
Posted 19 September 2015 - 03:57 AM
I got the program working but I cannot connect any Gates! it keeps saying Invalid gate
dobbylego #6
Posted 18 October 2015 - 11:32 PM
@Dragonslayerlk If you still need this program, go into startup and find "function AddGate()". In there you will find if "gate.isValidAddress". I couldn't find any documentation on this command at all so I changed it to "if true". This will make anything you enter into an address, anything at all, so be carful with it. After that it should run fine.

(Now if figure how why the monitor isnt working! :D/> )