Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Jepp's Hyperdrive Program
- @inputs Jump Sound [X, Y, Z]:number TargetPos:vector [CaptainSeat, Teleporter, Beacon]:entity
- @outputs [X, Y, Z]:number [TargetPos, OriginPost]:vector TargetAngle:angle Jump Sound
- @persist [PlaceCord, PlaceName]:array OriginPos:vector
- @trigger
- function help()
- {
- #CaptainSeat:printColorDriver(vec(255,0,0), "Jepp's Hyperdrive Program Commands")
- #CaptainSeat:printColorDriver(vec(255,255,255), "Type ", vec(255,0,0), "/help", vec(255,255,255), " to view commands")
- #CaptainSeat:printColorDriver(vec(255,255,255), "Type ", vec(255,0,0), "/jump <location name>", vec(255,255,255), " to jump to the location of choise")
- #CaptainSeat:printColorDriver(vec(255,255,255), "Type ", vec(255,0,0), "/return", vec(255,255,255), " to return to previous position")
- #CaptainSeat:printColorDriver(vec(255,255,255), "Type ", vec(255,0,0), "/locations", vec(255,255,255), " for a list of possible locations")
- #CaptainSeat:printColorDriver(vec(255,255,255), "Type ", vec(255,0,0), "/save <location name>", vec(255,255,255), " to save the beacons current locations")
- CaptainSeat:printDriver("Jepp's Hyperdrive Program Commands")
- CaptainSeat:printDriver("Type /help to view commands")
- CaptainSeat:printDriver("Type /jump <location name> to jump to the location of choise")
- CaptainSeat:printDriver("Type /return to return to previous position")
- CaptainSeat:printDriver("Type /locations for a list of possible locations")
- CaptainSeat:printDriver("Type /save <location name> to save the beacons current locations")
- }
- function jump( Location:string )
- {
- Count = 1
- for(I = Count, PlaceName:count())
- {
- if(PlaceName[Count, string]:lower() == Location:lower())
- {
- botSay("JeppCom", "HyperDrive", vec(255,255,0), "Now jumping to: " + PlaceName[Count, string])
- X = PlaceCord[Count, vector]:x()
- Y = PlaceCord[Count, vector]:y()
- Z = PlaceCord[Count, vector]:z()
- TargetPos = PlaceCord[Count, vector]
- OriginPos = Teleporter:pos()
- TargetAngle = CaptainSeat:angles()
- Jump = 1
- timer("jumpDelay", 1000)
- }
- Count = Count + 1
- }
- }
- function returnBack()
- {
- X = OriginPos:x()
- Y = OriginPos:y()
- Z = OriginPos:z()
- TargetPos = OriginPos
- OriginPos = Teleporter:pos()
- TargetAngle = CaptainSeat:angles()
- botSay("JeppCom", "HyperDrive", vec(255,255,0), "Now returning to previous location")
- Jump = 1
- timer("jumpDelay", 1000)
- }
- function saveLocation( Name:string )
- {
- PlaceCord[PlaceCord:count()+1,vector] = Beacon:pos()
- PlaceName[PlaceName:count()+1,string] = Name
- #CaptainSeat:printColorDriver(vec(255,255,255), "Beacon location has been saved as ", vec(255,0,0), Name)
- CaptainSeat:printDriver("Beacon location has been saved as: " + Name + "With cords: " + Beacon:pos())
- }
- function savedLocations()
- {
- Count = 1
- TeleportNumber = PlaceName:count()
- if(TeleportNumber)
- {
- for (I = Count, TeleportNumber)
- {
- #CaptainSeat:printColorDriver(vec(255,255,255), "Location #" + Count + ": ", vec(255,0,0), PlaceName[Count,string])
- CaptainSeat:printDriver("Location #" + Count + ": " + PlaceName[Count,string])
- Count = Count + 1
- }
- }
- else
- {
- CaptainSeat:printDriver("You don't have any locations")
- }
- }
- if(first() | duped())
- {
- runOnTick(1)
- runOnChat(1)
- # Cordinates
- PlaceCord = array(
- vec(-7219.0834960938,-5839.1557617188,-8259.701171875), #Cordinate 1
- vec(-6329.625, -5113.500, -2549.937), #Cordinate 2
- vec(-11520.750,-12298.781,10273.625), #Cordinate 3
- vec(4183.2036132812,3282.0788574219,-6362.9663085938), #Cordinate 4
- vec(-4637.3525390625,2781.3884277344,3495.0825195312), #Cordinate 5
- vec(4834.4384765625,6153.0639648438,10191.5078125), #Cordinate 6
- vec(-12218.34765625,13355.432617188,-11842.986328125) #Cordinate 7
- )
- # Names
- PlaceName = array(
- "Rhodon", #Name 1
- "RhodonSpace", #Name 2
- "Zarkol", #Name 3
- "Trensalore", #Name 4
- "Aura", #Name 5
- "Cydonia", #Name 6
- "BuildBay" #Name 7
- )
- Sound = 1
- }
- if(changed(CaptainSeat:driver()))
- {
- help()
- }
- if(chatClk(CaptainSeat:driver()) | chatClk(owner()))
- {
- Com = CaptainSeat:driver():lastSaid():explode(" ")
- if(Com[1, string] == "/jump" & Com[2, string])
- {
- jump(Com[2, string])
- }
- elseif(Com[1, string] == "/return")
- {
- returnBack()
- }
- elseif(Com[1, string] == "/help")
- {
- help()
- }
- elseif(Com[1, string] == "/locations")
- {
- savedLocations()
- }
- elseif(Com[1, string] == "/save" & Com[2, string])
- {
- saveLocation(Com[2, string])
- }
- }
- if(clk("jumpDelay"))
- {
- Jump = 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement