Code Monkey home page Code Monkey logo

scarpet's People

Contributors

aebkea avatar altrisi avatar aplet123 avatar b-2u avatar bisumto avatar ch-yx avatar commandleo avatar crec0 avatar dorapower avatar dragoncrafted87 avatar firigion avatar fooeyround avatar fxmorin avatar ghoulboy78 avatar ghoulboy78-alt avatar gnembon avatar gnottero avatar indoorjetpacks avatar kingoftheclouds avatar konaeakira avatar madff386 avatar manyrandomthings avatar meenimc avatar mwappner avatar ninja202 avatar opsaaaaa avatar pegasusepsilon avatar rv3r avatar senth avatar thecatsaber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scarpet's Issues

Adding custom enchantments

Having the ability to add custom enchantments built into scarpet. Adding NBT to look like enchantment text, with a hidden tag value so scarpet can add custom scripts when preforming actions with the new events, or with custom enchantment call events.

Running command as a stored entity

I found that the run() function only has 1 parameter which is the command itself, and the command seems to be run as console at the world origin. I have to use the 'execute' command with the vanilla entity selector to specify the runner and the position. I hope that the run() function can have some parameter such as 'runner' and 'pos' so that I can run a command as an entity which has been stored into a variable, or at a position which has been stored into a list.

I can't check names of a certain item.

Hello!

I couldn't find a way to get the name of an item which is held in the main hand. We want to use the hammer script, but with a diamond pickaxe which has the name "Hammer".

My question/issue: Can you check the name of an item and if so, how?

Structure Blocks

I'm trying to create a funktion that automatically adds an a to the name of the Block. One big issue is that I haven't found a way to reed out the name of the current Structure Block. Another Problem is the fact that if you run /script run set(x,y,z,'structure_block','mode','save') the appearing Structure Block is still in data mode.

~I'm from Germany therefor my english probably isn't the best

Can't supply arguments to __command()?

if I define an app like this:

//hello.sc
__command(who) -> print('Hello, ' + who + '!');

I would expect to be able to call it in-game as /hello 'world'. But I actually get the error message, Incorrect argument for command.

According to the documentation, if __command() is defined, then it also defines all other global commands as sub-commands, so I assume that scarpet is looking for a sub-command called "world". But there are no sub-commands in this file, so I'd expect the "world" string to instead get passed to the __command() method. Is there a way to do this, or can the "root command" not accept arguments?

Event hooks

rather than try to track events that are hard to track, provide event hooks to attach custom functions to and manage them through /script events

Check for custom named items

I know there has to be a way to do this but I can't figure it out.
if (mainhand:custom_name:text == 'some_name')

I'm looking to do something similar to your storage drawers.
nbt(data:'CustomName'):'text' == 'Controller'

Windows Installer can't find "path specified" preventing download.

The installer does not allow me to specify where mine craft is located on my computer.

The system cannot find the path specified.
to patch client, you need to run 1.13.2 game at least once
Press any key to continue . . .

<<

Pressing any key closes the console. I've already ran, and re-ran the 1.13.2 patch.

Also, 7za.exe does nothing besides instantly crashing for me, even if ran as a admin.

Issues with language design

By looking at the language syntax so far, it strikes me as something very unreadable at some points. Considering that (AFAIK) you wish this language would be embedded in MC, it is not very user friendly. I have some questions and issues that might clarify the design choices.

  1. What languages were the inspiration for Scarpet?
  2. What are the principles for the language? Is it supposed to be OO, evented, procedural, functional?
  3. What about modularity? So far the naming schemes (with _ and __) feel very primitive and limiting, and the namespace for custom functions will be running out quickly (with global functions like air or put). Did you think about namespacing them? What about relying on magic strings vs constants (_ ~ 'sneaking' vs _ ~ Namespace.sneaking)?
  4. List and dicts literals?
  5. Do you plan on supporting first class functions? So far it kinda seems like it (with passing expressions into other functions) but the current syntax is super confusing and will cause a lot of problems in the future.
  6. About _ "magic variable"... There is a reason magic variables are so rare. They are implicit, confusing and very demanding from a person who reads the code. From what it seems, you are trying to create some kind of Perl-inspired language, but there is a reason why it is pretty much dead nowadays.

[suggestion] You should be able to manipulate scoreboards

If scarpet is truly going to be used in liaison with normal vanilla datapacks, which would be a nice thing to see, one must be able to manipulate the vanilla variables with scarpet: scores. I envision it as something like this:

score(scoreboard, entity)

returns score of 'entity' in scoreboard 'scoreboard' .If that entity is not tracked by the scoreboard, returns nothing.
'if(score('health',Ghoulboy)<2,print('Ghoulboy, you are dying!')'

add('score/entity',name,'score?',value?)

if running with 'score' in first parameter, then rest after 'name' is clearly redundant, scoreboard objective is created and that's it. But if it's 'entity', then you have to add what scoreboard, and 'value' defaults to zero if not specified

remove('score/entity','name','score?')

No need to guess here

I am assuming that with 'score' command, you will be able to manipulate it like a common variable, so you can set it and add to it as you will, so there will be no need for implementation of vanilla 'scoreboard players add' and 'scoreboard players set' command.
This way you could make datapacks and scarpet scripts interdependent in places where they should be, and make them run one another like:
end of first_function.mcfunction:
… script run do_important_complex_maths_that_you_cant_do_with_datapacks

and then to do_important_complex_maths_that_you_cant_do_with_datapacks.sc:
…(maths) run('function cool_stuff/second_function')

This way you could make a ton of things like BlingEdit way easier to code as they require tons of function files solely cos they need to do complex calculations what take like three lines in scarpet.

ability to detect when a key is down

it may be cool to have an event or something for when a player presses a key(maybe just a key bind or even maybe all keys) that way you could create things like a fast forward key. while you hold down the key, the games runs as fast as it can

eval() - execute string contents.

eval() gives every scripting language a lot of power - ability to construct scripts, get them from unusual inputs and store in unusual ways. Examples: text of a written book. Items with custom behaviors encoded in the item metadata, input from external plugins e.g. discord chat, and so on. It's also probably the easiest way to implement lambda expressions, especially if paired with means to extract function source as a string.

Support comments

The ability to add proper comments would be a great help for development. The current recommendation is to simply enclose comments in quotes, but this isn't great in some cases. Take the following line of code:

modify(_, 'pos', x*10, y, z*10)

Here, I've got a function which teleports a player far away. Obviously, this can have some unintended consequences when something isn't working right, so I want to comment it out until I know that it will be stable. The recommendation says to make it a string literal, but there's already one of those, so I end up needing to do:

'modify(_, \'pos\', x*10, y, z*10)'

Those two extra characters add up fast when dealing with many lines or lines that have more than one string literal in them. Note that they also need deleted once the line is uncommented.

I propose two/three solutions to this:

- Allow " and ' for string literals

As far as I can tell, " isn't used anywhere in the language yet. If ' and " could start and end strings, the code could be commented like so:

"modify(_, 'pos', x*10, y, z*10)"

This would have the side benefit of (slightly more easily) allowing for strings with ' in them, which may be useful, given that ' is common in English for contractions.

Alternatively,

- Add a line comment character

We have line breaks ($), so being able to comment out a line shouldn't be too difficult. I don't believe # is used in the code syntax yet, and it is used as the comment in some other languages (Python, Ruby, Assembly, etc). The # would start a comment that would last until the next $. Then the code would look like:

# modify(_, 'pos', x*10, y, z*10)

And/or:

- Add a proper comment block character/string

Many languages have comment block characters/strings (such as /* */ for Java/C). * already has syntatic meaning in scarpet, so this may not be the best option, and the use of / is common in Minecraft commands, so /* may not be the best option. Perhaps { } would be a good option. The code would then look like:

{modify(_, 'pos', x*10, y, z*10)}

This would also allow for multi-line comments.

Whatever happens, I am confident that comments would be of substantial help to developers, which would in turn encourage more developers to work on scarpet, which would in turn help show the power that such an API can have. If you have any thoughts or suggestions, I'd love to hear what other people working with scarpet think, and of course from gnembon as this is his language.

Creating New Blocks and Items with Scarpet

Are their plans or is it even possible to add the ability to create new blocks and items in the game (even GUI's) I know Minecraft has added the ability to sort of make new items but it is still very limiting and one of the biggest limits with it, is creating custom crafting recipes for these items.

Would love to create new blocks and basically entire mods in the game just through scripts.

pos() should probably carry dimension information

particle('heart', pos(player))

... will generate particles at the targeted player's position in the dimension where the command is run, not in the dimension where the targeted player actually is.

Solve the bug how you like, but I think pos() carrying dimensional information (possibly as an optional 4th parameter for the sake of legacy code) is probably the best option.

Running material() on wood blocks returns as wool

Checked in carpet 1.3.6 and 1.3.7, running material() on a block that should be wood (i.e., oak log, stripped spruce log, birch planks, etc) will return as wool instead of the expected wood. As far as I can tell, happens with all variants of logs and planks, both normal and stripped. Didn't test with slabs/stairs though.

Can test by placing any wood one block northward of the player and running:
/script run print(material(pos_offset(pos(player()),'north')))

Function values dont persist

In this code:

Object = m( l( 'myFunction', fun (x) -> ( print(x) ) ) );
call( Object : 'myFunction', 'Hello World!' );

I get an error "function 0 is not defined yet at position...".
Further testing revealed that all functions return a numerical value that cannot be called.
For example:

myCall( fun, param ) -> ( call( fun, param ); );
myCall( print, 'Hello World!' );

Gives me the same error.
Changing the scope to global does not fix this issue either.

An unexpected error occurred trying to execute that command

After running /script invoke _haus it spills that error message out. Any Ideas why it does that?
script run _haus() -> ( $ set(-11,102,37, 'structure_block'); run('data merge block -11 102 37 {mode:"SAVE", posX:1, posY:0, posZ:1, sizeX:13, sizeY:11, sizeZ:11, showair:0, ignoreEntities:0, name:"haus:1"}'); $ set(-12,102,36, 'structure_block'); run('data merge block -12 102 36 {mode:"SAVE", posX:1, posY:0, posZ:1, sizeX:2, sizeY:2, sizeZ:2, showair:0, ignoreEntities:0, name:"haus:1"}'); $ set(-10,103,38, 'structure_block'); run('data merge block -10 103 38 {mode:"LOAD", posX:-1, posY:-1, posZ:-1, name:"haus:1"}'); $ set(-10,102,38, 'structure_block'); run('data merge block -10 102 38 {mode:"LOAD", posX:0, posY:0, posZ:0, name:"haus:1"}') $)

Holy Hand Grenade 1.15 server

Holy Hand Grenade on a 1.15 fabric server will crash it, but on a single player world using the fabric client it works fine. I am sure it is a bug with the fabric server version. I think the vine-miner doesn't work ether.

You should create a sort of library

Essentially I see it as like more files added in the .jar file in the directory of event-test.sc, but with all the apps in programs/fundamentals and when the ability comes to import functions, you wont have to copy pasta code, you can just do like import(math.sc,rnd) at the beginning, and it will glow yellow and you can do rnd(whatever,whatever)

view functions

I've made a function a few days ago and run it. Now I wan't to chane some bits and pices, but I havn't save a file and the commandblock is destroyed. Is there a way to look up, how my Function worked?

Add import / export

It is currently not possible to import functionality from one app to another.
I suggest a node.js-esque solution:

// in myFirstApp.cs
app : 'exports' = m(
    l( 'A', _( a, b ) -> functionA( a, b ) ),
    l( 'B', _( a, b ) -> functionB( a, b ) )
);
// or
export(
   m(...)
);

and

// in mySecondApp.cs
firstApp = import( 'myFirstApp.cs' ); // reference to app : 'exports' from myFirstApp.cs

While it is possible to run( 'script load myFirstApp' );, its not really possible to retreive values in a non-hacky way.

MySQL

Would it possible to implement MySQL connections eventually?
I would love to have something like test_events to populate some tables so I can query stuff later.

Issue with Gnembon Autolighter

1
New to coding and keep getting this error, I don't know what to replace it with. When I take out "a", a new error comes up saying "torch" can't be placed after "can"

Inventory management

Being able to query more slots than hands and armour, and being able to modify them (using items, affecting durability of tools, armour etc)

lambda function type is internal

If you try evaluating type( _(...) -> (...) );
You will get "How did you get there? Cannot get type of an internal type".
Also, putting this expression in a try...catch block does not catch the exception.
I suggest setting the type of a lambda expression to 'function'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.