flashgnashYON

YCMDS V3

Sep 17th, 2016
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.22 KB | None | 0 0
  1. @name YCMDS V3
  2. @persist ShieldOn CloakOn Destination:string [Beamtovec,Beamtopads,NotFound]:normal Collector:entity [Collector2,Water,Warpcore,Transporter,Energy,Cloak,Shield]:wirelink
  3. @model models/medicdevicedestiny.mdl
  4.  
  5. #@outputs ShieldOn CloakOn Destination:string Beamtopads NotFound
  6.  
  7. Shield["Activate",normal] = ShieldOn
  8. Cloak["Activate",normal] = CloakOn
  9.  
  10.  
  11.  
  12. if(Beamtovec){
  13. Transporter["Beam to vector", normal] = 1
  14. Beamtovec = 0
  15. }
  16. else{Transporter["Beam to vector", normal] = 0}
  17.  
  18. if(Beamtopads){
  19. Transporter["Beam to pads", normal] = 1
  20. Beamtopads = 0
  21. }
  22. else{Transporter["Beam to pads", normal] = 0}
  23.  
  24.  
  25. if(dupefinished()){reset()}
  26.  
  27.  
  28. #Wiring Setup#
  29.  
  30. if(first()){
  31. findIncludePlayerProps(owner())
  32. if(findByClass("quantum_slipstream_drive")){
  33. Warpcore = find():wirelink()
  34. print("Found Quantum Slipstream")}
  35.  
  36. if(findByClass("ship_drive")){
  37. Warpcore = find():wirelink()
  38. print("Found ship drive")}
  39.  
  40. if(findByClass("transporter_pad")){
  41. Transporter = find():wirelink()
  42. print("Found TSCM transporter")}
  43.  
  44. if(findByClass("stargazer_energy_core")){
  45. Energy = find():wirelink()
  46. }
  47.  
  48. if(findByClass("st_shield_emitter")){
  49. Shield = find():wirelink()
  50. print("Found TSCM shield")}
  51.  
  52. if(findByClass("st_cloaking_device")){
  53. Cloak = find():wirelink()
  54. print("Found TSCM cloak")}
  55.  
  56. if(findByClass("stargazer_water_core")){
  57. Water = find():wirelink()
  58. }
  59.  
  60.  
  61.  
  62. Energy["Activate",normal] = 1
  63. Energy["Mute",normal] = 1
  64.  
  65.  
  66. }
  67.  
  68.  
  69. if(first()){print("Welcome to YCMDS V3, how may I help you?")
  70. print("(Type /help for commands)")
  71. }
  72.  
  73.  
  74.  
  75. interval(100)
  76. runOnChat(1)
  77. if(chatClk(owner())){
  78. Command = owner():lastSaid():lower():explode(" ")
  79. FirstWord = Command:shiftString()
  80. SecondWord = Command:shiftString()
  81. ThirdWord = Command:shiftString()
  82. FourthWord = Command:shiftString()
  83.  
  84.  
  85.  
  86.  
  87. function vector getPos(Destination:string){
  88. if(Destination == "shak"){
  89. print(" Shakuras")
  90. return vec(-5123.916504, -5737.004395, 7781.928223)
  91. }
  92. else{
  93. if(Destination == "hii"){
  94. print(" Hiigara")
  95. return vec(8910.822266, 8233.191406, -4888.260742)
  96. }
  97. else{
  98. if(Destination == "earth"){
  99. print(" Earth")
  100. return vec(731.850891, 10365.407227, 8714.040039)
  101. }
  102. else{
  103. if(Destination == "desert"){
  104. print(" Desert")
  105. return vec(12717.458984, -10323.308594, -8486.469727)
  106. }
  107. else{
  108. if(Destination == "moon"){
  109. print(" Moon")
  110. return vec(-4550.467285, 13761.375000, 10484.055664)
  111. }
  112. else{
  113. if(Destination == "shakuras"){
  114. print(" Shakuras")
  115. return vec(-5123.916504, -5737.004395, 7781.928223)
  116. }
  117. else{
  118. if(Destination == "hiigara"){
  119. print(" Hiigara")
  120. return vec(8910.822266, 8233.191406, -4888.260742)
  121. }
  122. else{
  123. if(Destination == "station"){
  124. print(" Station")
  125. return vec(4950.279297, -6809.163086, 8897.023438)
  126. }
  127. else{
  128. if(Destination == "pegasus"){
  129. print(" the Pegasus System")
  130. return vec(766.279297, -9589.005859, 8849.352539)
  131. }
  132. else{
  133. if(Destination == "universe"){
  134. print(" the Universe System")
  135. return vec(7418.365723, -2342.522461, -10817.677734)
  136. }
  137. else{
  138. if(Destination == "milkyway"){
  139. print(" the Milkyway System")
  140. return vec(-11642.699219, 5558.858887, 8551.136719)
  141. }
  142. else{
  143. if(Destination == "build"){
  144. print(" Build")
  145. return vec(13353.520508, 13611.589844, -15462.566406)
  146. }
  147. else{
  148. if(Destination == "secret"){
  149. print(" Seeeeeeecret")
  150. return vec(-655.479736 -150.708206 -15430.270508)
  151. }
  152. else{
  153. if(Destination == "water"){
  154. print(" Water")
  155. return vec(-2.854739, 8135.880859, 8314.55273)
  156. }
  157.  
  158. else{print("Not found")}
  159. NotFound = 1
  160.  
  161. return entity():pos()
  162. }}}}}}}}}}}}}
  163.  
  164.  
  165. }
  166.  
  167.  
  168. if(FirstWord == "/w"){
  169. print("Warping to")
  170. Warpcore["Destination", vector] = getPos(SecondWord)
  171. Warpcore["Activate", normal] = 1
  172. timer("Delay",1000)
  173. if(clk("Delay")){Warpcore["Activate", normal] = 0}
  174. }
  175. #Warp#
  176.  
  177.  
  178.  
  179. #Beam#
  180. if(FirstWord == "/beam"){
  181. if(SecondWord == "me"){Transporter["Target1", entity] = owner()}
  182. elseif(SecondWord == "that"){Transporter["Target1", entity] = owner():aimEntity()}
  183. else{Transporter["Target1", entity] = findPlayerByName(SecondWord)}
  184.  
  185. if(ThirdWord == "up"){Beamtopads = 1
  186. print("Beaming to the pad")}}
  187.  
  188.  
  189. if(ThirdWord == "to"){
  190. print("Beaming to")
  191. if(findPlayerByName(FourthWord)){
  192. Transporter["TargetLocation", vector] = findPlayerByName(FourthWord):pos()
  193. print(findPlayerByName(FourthWord):name())
  194. Beamtovec = 1
  195. }
  196. else{
  197. Transporter["TargetLocation", vector] = getPos(FourthWord)
  198. Beamtovec = 1
  199. }
  200. }
  201.  
  202.  
  203.  
  204. #Beam#
  205.  
  206. #Shields and cloaking#
  207. if(FirstWord == "/shield"){
  208. if(ShieldOn == 1){
  209. ShieldOn = 0
  210. print("Lowering Shields")
  211. }
  212. else{
  213. CloakOn = 0
  214. ShieldOn = 1
  215. print("Raising Shields")
  216. }
  217. }
  218.  
  219. if(FirstWord == "/cloak"){
  220.  
  221. if(CloakOn == 1){
  222. CloakOn = 0
  223. print("Cloaking...")
  224. }
  225. else{
  226. ShieldOn = 0
  227. CloakOn = 1
  228. print("Decloaking...")
  229. }
  230.  
  231.  
  232. }
  233. #Shields and Cloaking#
  234.  
  235. if(FirstWord == "/reset"){
  236. reset()
  237. }
  238.  
  239. if(FirstWord == "/water"){
  240. Water["Spawn Collector",normal] = 1
  241. timer("Spawn Collector",100)
  242. }
  243.  
  244. if(FirstWord == "/help"){
  245. print("Commands are:")
  246. print("Warp : /w")
  247. print("Beaming /beam (me/username) (up/to) (location)")
  248. print("Shields: /shield")
  249. print("Cloak: /cloak")
  250. print("Deploy water collector: /water")
  251.  
  252. }
  253.  
  254.  
  255. #Ze final bracket#
  256. }
  257. #Ze final bracket#
  258.  
  259. if(clk("Spawn Collector")){
  260. Water["Spawn Collector",normal] = 0
  261. if(findByClass("stargazer_water_core_collector")){
  262. Collector = find()
  263. Collector2 = Collector:wirelink()
  264. print("Found collector")
  265. Collector:setPos(getPos("water") - vec(0,0,350))
  266. timer("Activate Collector",100)
  267. }}
  268. if(clk("Activate Collector")){Collector2["Activate",normal] = 1}
Advertisement
Add Comment
Please, Sign In to add comment