Quicks - A Smart Snippet Coding Tool

I made a custom quick that makes a killpart.
How to use
1: Run >show in the terminal if you haven’t done this yet.
2: Paste the code (seen below) into the Custom Quicks module script. Place it above the last comma(highlighted in the screenshot)
image
3: Use it like any other quick. (>KILLPART(Part))
Notes
-You can also use multiple instances but I don’t recommend it. (Use CollectionService instead it is a lot less messy with 2+ parts)

-This is just something quick to learn the api.
Code

		func = function (doc, arguments, Utils, Settings, Defaults)
			if arguments[1] == "" then
				Utils.Warn("Please provide a part.")
				return
			end
			
			if arguments[2] then
				Utils.Warn("Consider using CollectionService(https://create.roblox.com/docs/reference/engine/classes/CollectionService) for multiple kill parts. (This quick will still run)")
			end
			
			local result = ""
			
			for _, argument in arguments do
				if result then
					result = result.."\n"..argument..[[.Touched:Connect(function(hit)
	local Humanoid = hit.Parent.Parent:FindFirstChildWhichIsA("Humanoid", true)
	if not Humanoid then
		return
	end
	Humanoid.Health = 0
end)]]
				else
					-- Removes new line from first part.
					result = result..argument..[[.Touched:Connect(function(hit)
	local Humanoid = hit.Parent.Parent:FindFirstChildWhichIsA("Humanoid", true)
	if not Humanoid then
		return
	end
	Humanoid.Health = 0
end)]]
				end
			end
			
			return result
		end,```
1 Like

Hello. I am planning to add more. Also ill have to investigate the space bug.
What was the exact “command”/quicks that you ran?
Was it >MS(Module Script)?
After some testing its probably that, I will add this to my list of bugs to fix.

Also it does use
Plugin:SetSetting()
Plugin:GetSetting()
They save when they are modified.

Yes, it was exactly that.

Oh, I didn’t know that.

1 Like

Alright well that should be fixed now!
>MS(Module Script) now gives you
local Module_Script = require(StarterPlayer["Module Script"])

Thanks for the report!

1 Like

Update 0.1.1

Fixed bug where spamming >show would create multiple of the same config file. This would confuse the plugin.

New Beta Feature:

Ability to install plugins other people have made just from a command line command

How do I install modules through it?

In the command line you can type >install (module name)
To execute it add a space to the end of the command(this is a limitation of custom terminal commands, ill probably be moving most commands to UI soon.)
image
If this is your first time installing you will see something like this
image
Allow it so it can download the module

What are modules?

Modules are things you can install to gain a bunch of new quicks. A module can contain 1 or more quick.

Warnings on this feature

No there shouldn’t be any viruses since when commits are made to the repo it will go though a verification process. The issue is if there is already a quick with the same name it may conflict. In the future I want to make it check for this, but for now open the file and make sure there are no issues. Rename any commands that are conflicting.
Another issue is that if your last curly brace in the return doesn’t end in a comma it will just append the module without adding one. You will need to add one manually.

How can I make a module that can just be installed?

  1. Go here to the github repo
  2. read the README on how to format the file.
  3. Add your stuff and make a pull request. You need to wait till it gets past this verification step till it gets put in the main repo.
  4. If all goes well you should be able to type >install (module name)

So whats my module name?
Your module name is whatever you named your folder. (It cant be named the same thing as another folder, all module names have to be unique)

If you cant figure this out, or don’t have a GitHub account feel free to reply to this or contact me, ill put it up for you if you send the code. :slight_smile:

Thanks for reading!

Is the module broken? I’ve enabled beta, enabled the script editing beta feature and installed + restarted studio.The plugin is there, but it doesn’t work and prints these errors to the console:


  19:25:47.763  DataModel Loading https://assetdelivery.roblox.com/v1/asset/?id=11082814635  -  Studio
  19:25:50.421  [Quicks] Error Saving  -  Edit
  19:25:50.421  [Quicks] A config saving error occured. File not hidden  -  Edit

Any idea what’s going on?

Hello, this sometimes is a false error message, try to see if it all works fine. If its not working then feel free to reply again. I will look into the false errors though.

Update 0.2.1

This update 1 major thing has changed, custom Quicks can now declare configs.
image
These configs can be edited in the Custom Quicks file.
You can then use them in your code like this
image

Note:

  • If you name your setting the same thing as a built in setting it will be overwritten. To make sure that this wont happen ever you can use lowercase since all official names will be all caps.
  • It has been implemented in a way so that other quicks cannot access the same settings. Right now this is both good and bad. Its good because for security reasons no quicks can access eachothers settings. Its bad because if a quicks pack has many commands they cannot access their commands. For now this is going to stay that way.

Minor changes:
Since on install there is an error due to a missing config file(since it has not been made yet) I added a disclaimer saying it may not actually be an issue. This is probably a temporary fix.

New command

>TSPAWN - No arguments, and expands to task.spawn

Special Mentions

3 Modules were made since the last update

ezprint - To install type >install ezprint (remember the space at the end) This one lets you type >P(Put whatever here), this expands to a regular print statement (By KevinWho)

lorum - To install type >install lorum This is not only a demo for the new settings, but also lets you generate placeholder text as a string (By KevinWho)

killbrick - To install type >install killbrick This lets you pass in a part(or many) and turn them all into kill bricks! (By Maxi130TV)

(Ill add anyone else that makes a module here)
or if you cant post it there just feel free to share the code and ask me to do it along with the name of the module

Do custom quicks save between games?

1 Like

i found a bug where it removes the close parenthesis for some reason

["Var"] = {
	func = function(from, arguments) -- arguments: variableName, value
		local function lowerCaseFirstText(String)
			local newString = String

			if #String == 1 then
				newString = string.lower(String)
			else
				for index=1, #String do
					local letter = string.sub(String, index, index)

					if String ~= " " and string.match(letter, "%w+") == letter and not tonumber(letter) then
						if index == 1 then
							newString = string.lower(letter) .. string.sub(String, index + 1, -1)
						else
							newString = string.sub(String, 1, index - 1) .. string.lower(letter) .. string.sub(String, index + 1, -1)
						end

						break
					end
				end
			end

			return newString
		end

		print(arguments[2])
		return "local " ..  lowerCaseFirstText(string.gsub(arguments[1], "\"", "")) .. " =" .. arguments[2]
	end,
},
>Var(ReplicatedStorage, game:GetService("ReplicatedStorage"))
-> local replicatedStorage = game:GetService("ReplicatedStorage"

overall 10/10 I love the plugin

1 Like

Really good idea, but the lack of autocomplete make plugin almost useless in the sense of time saving

1 Like

Interesting, ill have to take a look at that. Its probably searching for the first closing parenthesis, gotta change it to the last closing parenthesis. It may be a while until I can fix this though, but ill reply to this when I do! Also thanks for the rating :slight_smile:

I would love to add autocomplete to my plugin however I dont think the Roblox API supports this. If im wrong send me the link to the API and ill add it ASAP! Also I do think it still saves time as >GS(Players) is quicker than local players = game:GetService("Players")

Thanks for your feedback!

Edit: I think I may have found the API: ScriptEditorService | Roblox Creator Documentation

1 Like

I think they should, but I have not tested it, and its been a while since I checked that bit of the code. It may get a little weird with Teams though since if anyone edits the config file it may or may not sync. Otherwise it should all work.

Update 0.3.2

Autocomplete

This has recently been suggested, and I thought it was a good idea. Not only do the built in Quicks have autocomplete, but also any Quicks you make can too!



To add this feature to your own Quicks you must add docs, and if you have any code/examples you must add example.
Here is how its done in the default built in example quick:

Oh and your custom Quicks also have live updating autocomplete!
Next up is:

Undo states

Made a mistake? cntrl + Z will now work to undo a Quick or a Quick autocomplete.

Bug Fix

(Apologies for light theme, I had to update this plugin away from home and forgot to set my theme lol)

2 Likes

Alright autocomplete has been added.

2 Likes

Update 0.4.4

More Autocomplete Power!!

image
Arguments themselves can now have autocomplete, and you too can add this to your own quicks!

How? Add autocompleteArgs to your quick, and return an array of Response’s (Scroll down a bit to see the type) OR if you just want to return the basic autocomplete use the function that you can pass in as many strings as you want and it will convert it into the correct format. Simply return Utils.createBasicAutocompletes(…) just as seen below.

This also allows for more powerful completions with access to the whole document object, and the index of the argument that is currently being edited(Starting at 1) This lets you have different suggestions for the first and second argument and so on.

Also dont worry about narrowing the autocompletes down, this will automatically be done internally.

editingArgIndex - The index of the arg that is being currently edited
arguments - an array of all arguments given so far. arguments[editingArgIndex] returns the current argument thats being edited
Being edited means the text cursor is there.
An example would be >TEST(aa,bb|);
If | is where the cursor is at then editingArgIndex is 2, and arguments[editingArgIndex] is bb

A fancier autocomplete


Lots more is going on here

More info below where each new util is explained. Feel free to comment if something doesn’t make sense.

I may show some more complex examples of this in this thread some time.
Not every built in command has or needs argument autocomplete.

What else changed?

  • Some Bug Fixes

  • A big internal code rework since this project is getting big, and needs to stay maintainable.

  • Fixed some issues where autocompletes would have \n in them

  • Added some Utils

    • FindCharInString(str, charPattern) - returns a table containing { index, line, lineIndex }
    • GetCharacterAtPosition(str, lineNum, charNum) - Returns a character in a string. Think of charNum as X, and lineNum as Y. Gets the character at a certain line number with charNum characters in
    • CombineKeyTables(table1, table2) - Combines any 2 key-based tables
    • CombineKeyTables(…) - pass any amount of strings in and it will return an array of Responses
    • createBasicAutocompletesWithDefaultValues({}, …) - Just like createBasicAutocompletes, but instead but the first argument is a “Response template” that will be applied to every other Response on the list. See example above
  • A few other minor tweaks

The autocomplete can also be used as a live preview of what its going to turn into as demoed in the new >GS()

Please give me feedback, suggestions, and even share with me what you use this for as it helps me figure out what people like, what people need, as well as motivation.

1 Like

I quite enjoy this plugin, I know this is quite old however I still thought I’d point out 2 bugs.

  1. MessagingService missing from autocomplete
  2. TeleportService is mispelled as “Teleport Service” in the autocomplete

nothing big, but its nice to bump this plugin anyways because i do use it frequently.

2 Likes

Thanks for telling me! I will take a look when I can, also I thought nobody used this plugin so its nice to hear that someone uses it. Maybe ill make additions to it again someday, but ill fix those since it shouldn’t be too hard to do. Also nice to see bug reports instead of people saying nothing. Ill reply again when that gets done, also thanks for the bump!

Also if you have any more feedback id love to hear it!

1 Like

Both of these should be fixed now, thanks for using the plugin! Feel free to share any work or custom quicks :slight_smile:

Thanks for reporting the bugs!

1 Like