Thank you everyone and Happy New Year!

The Thanks scores for 2019 are in, make sure to read all about last year's highlights -> here <- !

[Submission] /for console slash-command  [SUBMITTED]

Moderator: SecondMan

User avatar
Posts: 632
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 1

Re: [Submission] /for console slash-command


Post by Kristof » Wed Jan 15, 2020 7:49 am

Ah, thank you so much, @Movalex!

User avatar
Site Admin
Posts: 3937
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 12
Location: Vancouver, Canada
Been thanked: 12 times

Re: [Submission] /for console slash-command


Post by SecondMan » Wed Jan 15, 2020 10:58 am

@Movalex - very nice idea, thanks!

But it can be a touch simpler, and this works across platforms:
Code: [Select all] [Expand/Collapse] [Download] (Get Tool ID.lua)
  1. --[[
  2. tool script to get tool's ID. Useful if you do expressions
  3. or use a Reactor 'Slash For' script a lot
  4. and you don't want to keep in memory, that Resize tool is actually a 'BetterResize',
  5. and MaskPaint is actually a 'PaintMask'.
  6. Tool ID will be copied to the clipboard, and printed in the console
  7. ]]--
  8. tool_name = tool.ID
  9. bmd.setclipboard(tool_name)
  10. print(tool_name)