Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW SCRIPT SUGGESTION: Alias.js #442

Open
matfat55 opened this issue Nov 18, 2024 · 6 comments
Open

NEW SCRIPT SUGGESTION: Alias.js #442

matfat55 opened this issue Nov 18, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@matfat55
Copy link

Simple one-off script to auto create all the aliases listed in the readme. Could be ran in git-pull.js

@Guillermo-Santos
Copy link

it could check if an alias is already taken and warn about it, and could also take a flag as parameter to allow it override the existing aliases.

Should be more or less easy to make

@alainbryden alainbryden added the enhancement New feature or request label Nov 24, 2024
@alainbryden
Copy link
Owner

This is tricky because there's no in-game API for adding aliases, it would require exploits like what casino.js uses, but I'll keep it on my backlog!

@matfat55
Copy link
Author

Or could just output a giant copy paste string.

@alainbryden
Copy link
Owner

Unlike a normal terminal, the in-game terminal doesn't automatically execute a command when a line break is pasted.

Instead, it replaces all line breaks with spaces on input and the command is converted into one long statement, which when entered just gives an error "Incorrect usage of alias command."

So no, without using exploits (e.g. simulating onKeyDown events) aliases aren't easily injected.

@matfat55
Copy link
Author

I meant it could be non automatic (sucks, yeah). tprint a huge string alias example="run example.js; run example2.js"; alias example2" and so on. Then user copy and paste it.

@alainbryden
Copy link
Owner

I meant it could be non automatic (sucks, yeah). tprint a huge string alias example="run example.js; run example2.js"; alias example2" and so on. Then user copy and paste it.

Yes that's fair - the game now has the ability to split the terminal command on semicolons and evaluate multiple commands back-to-back, so we could take advantage of this and prepare one very long command for copy-pasting. I'll consider adding something which outputs this long string to the terminal so that the player can easily copy/paste it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants