Team Spartan Cookies & Milk Forums
e2 code to display wormhole direction - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Help and Support (https://teamscm.co.uk/forum-8.html)
+--- Thread: e2 code to display wormhole direction (/thread-3243.html)



e2 code to display wormhole direction - Funlax - 09-05-2020

I know the title is confusing.
but i am trying to code a e2 chip so that it will display 'Incoming' or 'Outgoing' on any screen for the wormhole status.

when the wormhole has been made to go out, i would like the screen to say 'Outgoing'
and 'Incoming' when i have an incoming wormhole

im not the best at coding, so some help would be great!

i know i could just use one of y'alls coded stargate dialing computers, but i have made a dhd with wire components. this is the last piece of the puzzle that i need.


RE: e2 code to display wormhole direction - Ethan Vondwarf - 09-05-2020

You could use the "Incoming" output on the stargate to come up with a "if" statement like:

if(Open == 1){
if(Incoming == 1){
Inbound = 1
Outbound = 0
}
else{
Inbound =0
Outbound = 1
}



RE: e2 code to display wormhole direction - The17thDoctor - 09-05-2020

What kind of screen would it be ? An EGP / SF Screen or a Text Screen ?

Here you go :
--@name Stargate Status
--@author Doc for Jesus <3
--@class processor

wire.createInputs({"Active","Inbound"},{"Normal","Normal"})
wire.createOutputs({"Status"},{"String"})

wire.ports.Status = "Not Wired"

hook("input","Stargate Check",function(name,value)
if name == "Active" then
if value == 1 then
wire.ports.Status = "Outbound"
else
wire.ports.Status = "Inactive"
end
elseif name == "Inbound" then
if value == 1 then
wire.ports.Status = "Inbound"
end
end
end)



RE: e2 code to display wormhole direction - Knight - 09-05-2020

(09-05-2020, 12:46 PM)The17thDoctor Wrote: What kind of screen would it be ? An EGP / SF Screen or a Text Screen ?

Here you go :
--@name Stargate Status
--@author Doc for Jesus <3
--@class processor

wire.createInputs({"Active","Inbound"},{"Normal","Normal"})
wire.createOutputs({"Status"},{"String"})

wire.ports.Status = "Not Wired"

hook("input","Stargate Check",function(name,value)
if name == "Active" then
if value == 1 then
wire.ports.Status = "Outbound"
else
wire.ports.Status = "Inactive"
end
elseif name == "Inbound" then
if value == 1 then
wire.ports.Status = "Inbound"
end
end
end)

You know they said E2 right?


RE: e2 code to display wormhole direction - The17thDoctor - 09-05-2020

(09-05-2020, 01:09 PM)Knight Wrote: You know they said E2 right?

I coded things for him before, E2 or SF does not matter to him, what matters is the result.