Advertisement
VasVadum

Bot text processing solar constant physics

Jul 1st, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.84 KB | None | 0 0
  1. //----------------------------------------------------------------------------------------------------------------------
  2. // THE TEXT PROCESSING PHYSICS CALCULATION PORTION
  3. // This tag will process text in a specific way, and was made using the Laxus bot.
  4. // It goes from start to end processing the information it reads, then at the end,
  5. // I have the math split up so that it can process the physics calculations in logical order.
  6. // Once its done the physics calculations, it can then tell the user the results.
  7. // CreateGlobal, means that the tag will exist on the bot for all servers, storing who made it as well.
  8. //----------------------------------------------------------------------------------------------------------------------
  9.  
  10. ?tag createglobal getsolar {oneline:
  11. {set:Pi|3.14159265358979323846264338}
  12. {set:Sol|383000000000000000000000000}
  13. {set:Proxima|651100000000000000000000}
  14. {set:Barnard|1340500000000000000000000}
  15. {set:VYCanis|103410000000000000000000000000000}
  16. {set:UYScuti|130220000000000000000000000000000}
  17. {set:2MASS|48258000000000000000000}
  18. {set:AU|149597870700}
  19.  
  20. {set:Star|
  21. {if:{arg:0}|~|Sol|then:{get:Sol}|else:
  22. {if:{arg:0}|~|Proxima|then:{get:Proxima}|else:
  23. {if:{arg:0}|~|Barnard|then:{get:Barnard}|else:
  24. {if:{arg:0}|~|Canis|then:{get:VYCanis}|else:
  25. {if:{arg:0}|~|Scuti|then:{get:UYScuti}|else:
  26. {if:{arg:0}|~|2MASS|then:{get:2MASS}|else:
  27. {arg:0}}}}}}}}
  28.  
  29. {set:Dist|
  30. {if:{arg:1}|~|Mercury|then:0.4|else:
  31. {if:{arg:1}|~|Venus|then:0.72|else:
  32. {if:{arg:1}|~|Earth|then:1|else:
  33. {if:{arg:1}|~|Mars|then:1.53|else:
  34. {if:{arg:1}|~|Belt|then:2.96|else:
  35. {if:{arg:1}|~|Jupiter|then:5.21|else:
  36. {if:{arg:1}|~|Saturn|then:9.55|else:
  37. {if:{arg:1}|~|Uranus|then:19.21|else:
  38. {if:{arg:1}|~|Neptune|then:30.07|else:
  39. {if:{arg:1}|~|Pluto|then:40.7|else:
  40. {if:{arg:1}|~|Voyager|then:129|else:
  41. {if:{arg:1}|~|Sedna|then:900|else:
  42. {if:{arg:2}|~|m|then:{math:{arg:1}|/|{get:AU}}|else:
  43. {if:{arg:2}|~|meters|then:{math:{arg:1}|/|{get:AU}}|else:
  44. {if:{arg:2}|~|km|then:{math:{arg:1}|*|1000|/|{get:AU}}|else:
  45. {arg:1}}}}}}}}}}}}}}}}}
  46.  
  47. {set:Dist|{math:{get:Dist}|*|{get:AU}}}
  48.  
  49. {set:math2|{math:4|*|{get:Pi}|*|{get:Dist}|^|2}}
  50. {set:Result|{math:{get:Star}|/|{get:math2}}}
  51.  
  52. {set:Result|{round:{math:{get:Result}|*|100}}}
  53. {set:Result|{math:{get:Result}|/|100}}
  54.  
  55. {set:Result2|{round:{math:{get:Dist}|/|{get:AU}|*|1000}}}
  56. {set:Result2|{math:{get:Result2}|/|1000}}
  57.  
  58. {if:{argslen}|=|0|then:Need help? Type `!solarinfo`|else:
  59. The solar constant for {arg:0} is {get:Result} W/m² at {get:Result2} AU. (error? type `?tag solarinfo`)}}
  60.  
  61. //----------------------------------------------------------------------------------------------------------------------
  62. // THE HELP AND INFORMATION PORTION
  63. // This tag would show you information you can use with the above tag,
  64. // to assist you in making decisions since the above tag is already near maximum text limit.
  65. //----------------------------------------------------------------------------------------------------------------------
  66.  
  67. ?tag createglobal solarinfo Thank you for investigating this wonderful command made by **Vas**!
  68. The proper usage of this command is `?tag getsolar STAR DISTANCE Measurement`
  69. Measurement is optional, currently there is `m`, `meters`, and `km`. m = meters.
  70. If you don't specify a measurement, the default will be used (au).
  71.  
  72. Available arguments for STAR:
  73. `Sol`: This is our star.
  74. `Proxima`: This is a nearby star system.
  75. `Barnard`: This is a random star system I chose that is cooler than our star.
  76. `Canis`: This is a rather hot star, brighter than ours.
  77. `Scuti`: This is the brightest star I could find.
  78. `2MASS`: This is the dimmest star I could find, a very cold barely alive star.
  79.  
  80. Available arguments for DISTANCE:
  81. `Mercury`: Average Distance from our star.
  82. `Venus`: Average Distance from our star.
  83. `Earth`: Average Distance from our star.
  84. `Mars`: Average Distance from our star.
  85. `Belt`: The middle average of th asteroid belt's distance from our star
  86. `Jupiter`: Average Distance from our star.
  87. `Saturn`: Average Distance from our star.
  88. `Uranus`: Average Distance from our star.
  89. `Neptune`: Average Distance from our star.
  90. `Pluto`: Average Distance from our star.
  91. `Voyager`: Voyager 1's location as of 2017.
  92. `Sedna`: The furthest object in our system from our star.
  93.  
  94. You may also enter a manual distance, either in meters `m` or `meters` as the 3rd argument, kilometers `km` as the third argument, or even as AU, without a third argument.
  95.  
  96. Here's a few examples:
  97. `!getsolar Sol Earth` Returns the solar constant of earth's average distance from our star.
  98. `!getsolar Sol 149598023 km` Same as above, but with an exact value of distance specified in km.
  99. `!getsolar 2MASS 0.2` Returns the solar constant of 2MASS at a distance of 0.2 AU from it.
  100.  
  101. If you have any questions, feel free to ask. I am unable to make the command any more advanced, as it is already near the maximum discord text limit.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement