{"action":"created","issue":{"url":"https://api.github.com/repos/EDCD/EDDI/issues/1050","repository_url":"https://api.github.com/repos/EDCD/EDDI","labels_url":"https://api.github.com/repos/EDCD/EDDI/issues/1050/labels{/name}","comments_url":"https://api.github.com/repos/EDCD/EDDI/issues/1050/comments","events_url":"https://api.github.com/repos/EDCD/EDDI/issues/1050/events","html_url":"https://github.com/EDCD/EDDI/issues/1050","id":394812544,"node_id":"MDU6SXNzdWUzOTQ4MTI1NDQ=","number":1050,"title":"Body Materials Report problems","user":{"login":"Darkcyde13","id":24360725,"node_id":"MDQ6VXNlcjI0MzYwNzI1","avatar_url":"https://avatars1.githubusercontent.com/u/24360725?v=4","gravatar_id":"","url":"https://api.github.com/users/Darkcyde13","html_url":"https://github.com/Darkcyde13","followers_url":"https://api.github.com/users/Darkcyde13/followers","following_url":"https://api.github.com/users/Darkcyde13/following{/other_user}","gists_url":"https://api.github.com/users/Darkcyde13/gists{/gist_id}","starred_url":"https://api.github.com/users/Darkcyde13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Darkcyde13/subscriptions","organizations_url":"https://api.github.com/users/Darkcyde13/orgs","repos_url":"https://api.github.com/users/Darkcyde13/repos","events_url":"https://api.github.com/users/Darkcyde13/events{/privacy}","received_events_url":"https://api.github.com/users/Darkcyde13/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-29T17:41:20Z","updated_at":"2019-01-03T07:10:42Z","closed_at":null,"author_association":"COLLABORATOR","body":"## EDDI version in which issue found\r\nEDDI v3.3.2\r\n\r\nAs mentioned in my reply to the Body Volcanism issue #1045  , here are a couple of things I've noted with the Body Materials Report script (from my own change log):-\r\n\r\n- Added missing checks and reports for materials percentages.\r\n- Added preference option for 'no percentage reporting'.\r\n- Removed the '&& reportMatConc != 1' from the materials setup, as it wouldn't add 'goodmaterials' even if you wanted to hear about them, when you choose not to hear about good percentages.\r\n - Added missing 'else' section to materials setup, so that all materials can be reported as per the preferences option.\r\n - Added missing 'all materials' report section. There is an option for it, so I've added it.\r\n - Added check for unknown body, to match other Body Report scripts."},"comment":{"url":"https://api.github.com/repos/EDCD/EDDI/issues/comments/451069022","html_url":"https://github.com/EDCD/EDDI/issues/1050#issuecomment-451069022","issue_url":"https://api.github.com/repos/EDCD/EDDI/issues/1050","id":451069022,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTA2OTAyMg==","user":{"login":"Tkael","id":4382539,"node_id":"MDQ6VXNlcjQzODI1Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/4382539?v=4","gravatar_id":"","url":"https://api.github.com/users/Tkael","html_url":"https://github.com/Tkael","followers_url":"https://api.github.com/users/Tkael/followers","following_url":"https://api.github.com/users/Tkael/following{/other_user}","gists_url":"https://api.github.com/users/Tkael/gists{/gist_id}","starred_url":"https://api.github.com/users/Tkael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tkael/subscriptions","organizations_url":"https://api.github.com/users/Tkael/orgs","repos_url":"https://api.github.com/users/Tkael/repos","events_url":"https://api.github.com/users/Tkael/events{/privacy}","received_events_url":"https://api.github.com/users/Tkael/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T07:10:42Z","updated_at":"2019-01-03T07:10:42Z","author_association":"MEMBER","body":"Darkcyde's script (reproduced here for reference):\r\n```\r\n{_ Preferences _}\r\n{set reportMats to 2} {_ Set to 0 if you only want to hear about materials below your minimum inventory level _}\r\n                      {_ Set to 1 if you also want to hear about materials below your desired inventory level _}\r\n                      {_ Set to 2 if you want to hear about all materials on the body _}\r\n\r\n{set reportMatConc to 2} {_ Set to 0 if you do not want to hear about material percent concentrations _}\r\n                         {_ Set to 1 if you only want to hear about great material percent concentrations _}\r\n                         {_ Set to 2 if you want to hear about good and great material percent concentrations _}\r\n                         {_ Set to 3 if you want to hear about all material percent concentrations _}\r\n\r\n\r\n{_ Fetch from context }\r\n{if event:\r\n    {set reportbody to BodyDetails(event.name, system.name)}\r\n}\r\n{if !reportbody.name || reportbody.name = \"\": \r\n    {set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}\r\n}\r\n{if !reportbody.name || reportbody.name = \"\": \r\n    {set reportbody to BodyDetails(state.eddi_context_body_name)}\r\n}\r\n\r\n{if !reportbody.name || reportbody.name = \"\":\r\n    {_ If it's still not possible to get the body name...  _}\r\n    I'm\r\n    {OneOf(\"not sure\",\"unsure\")}\r\n    {Occasionally(2,\"of\")}\r\n    which body\r\n    {OneOf(\"you are\",\"you're\")}\r\n    {OneOf(\"asking about\",\"referring to\")}.\r\n\r\n|else:\r\n    {_ Define a function to obtain a material from inventory}\r\n    {set _inventory(required) to:\r\n        {for material in materials:\r\n            {if material.material = required:\r\n                {return material}\r\n            }\r\n        }\r\n    }\r\n\r\n    {if reportbody.landable:\r\n\r\n        {set goodmaterials to []}\r\n        {set greatmaterials to []}\r\n        {set allmaterials to []}\r\n        {for material in reportbody.materials:\r\n            {set inventoryMat to _inventory(material.material)}\r\n            {if (reportMats >= 0 && inventoryMat.amount < inventoryMat.minimum && inventoryMat.minimum > 0)\r\n              || (reportMats >= 1 && inventoryMat.amount < inventoryMat.desired && inventoryMat.desired > 0)\r\n              || (reportMats >= 2):\r\n                {if material.percentage >= material.definition.greatpctbody:\r\n                    {set greatmaterials to cat(greatmaterials, [material])}\r\n                |elif material.percentage >= material.definition.goodpctbody:\r\n                    {set goodmaterials to cat(goodmaterials, [material])}\r\n                |else:\r\n                    {set allmaterials to cat(allmaterials, [material])}\r\n                }\r\n            }\r\n        }\r\n\r\n        {if len(goodmaterials) > 0 || len(greatmaterials) > 0 || len(allmaterials) > 0:\r\n            {if !body:\r\n                {F(\"Body Name Tidy\")}\r\n                {body}\r\n            |else:\r\n                This body\r\n            }\r\n            contains\r\n\r\n            {if len(greatmaterials) > 0:\r\n                very high levels of\r\n                {set cur to 0}\r\n                {set length to len(greatmaterials) - 1}\r\n                {while cur < len(greatmaterials):\r\n                    {P(greatmaterials[cur].material)}\r\n                    {if reportMatConc > 0: at {round(greatmaterials[cur].percentage, 1)}% }\r\n                    {set cur to cur + 1}\r\n                    {if cur = length: and\r\n                    |elif cur < length:,\r\n                    }\r\n                }\r\n            }\r\n\r\n            {if len(goodmaterials) > 0:\r\n                {if len(greatmaterials) > 0: and }\r\n                high levels of\r\n                {set cur to 0}\r\n                {set length to len(goodmaterials) - 1}\r\n                {while cur < len(goodmaterials):\r\n                    {P(goodmaterials[cur].material)}\r\n                    {if reportMatConc > 1: at {round(goodmaterials[cur].percentage, 1)}% }\r\n                    {set cur to cur + 1}\r\n                    {if cur = length: and\r\n                    |elif cur < length:,\r\n                    }\r\n                }\r\n            }\r\n\r\n            {if len(greatmaterials) > 0 || len(goodmaterials) > 0:. }\r\n\r\n            {if len(allmaterials) > 0 && reportMats >= 2:\r\n                {if len(greatmaterials) > 0 || len(goodmaterials) > 0:\r\n                    It is also {OneOf(\"comprised of\",\"made up from\")}\r\n                |else:\r\n                    moderate amounts of\r\n                }\r\n                {set cur to 0}\r\n                {set length to len(allmaterials) - 1}\r\n                {while cur < len(allmaterials):\r\n                    {P(allmaterials[cur].material)}\r\n                    {if reportMatConc > 2: at {round(allmaterials[cur].percentage, 1)}% }\r\n                    {set cur to cur + 1}\r\n                    {if cur = length: and\r\n                    |elif cur < length:,\r\n                    }\r\n                }.\r\n            }\r\n        }\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"Tkael"}}