#(JustinS) Same command in multiple scripts?

23 messages · Page 1 of 1 (latest)

marble hatch
#

Is it possible to create the same command in multiple scripts?
I have a script in which I added the /flag command to easily flag blocks/entities with custom flags. I now have another script and want to add the /flag sc [block] command. Is this possible?

woven vectorBOT
#

(JustinS) Same command in multiple scripts?

woven vectorBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

mellow heath
#

Or am I misunderstanding

marble hatch
#

yeah

#

so the other dsc file has /flag, /flag display, /flag list, etc. And I want my new dsc file to use /flag sc ...

mellow heath
#

Well, can just - run/- inject task scripts from within your command script then - different command scripts will override each other

marble hatch
#

I dont want them to be dependent of each other though

#

or that 1 is dependent of the other

mellow heath
#

They don't need to depend on each other, can just

- choose <context.args.first>
  - case display:
    - run flag_display_command
  - case list:
    - run flag_list_command
  ...

In your command script

#

Or can even go extra fancy and do a dynamic thing, where it checks for a script called flag_<first arg>_command and runs it if it exists

#

So that you can create more scripts and it'll automatically work

marble hatch
#

Im confused

#

or are you confused

#

I have 2 seperate .dsc files

#

Ill just use a differen command

mellow heath
#

You can't have a command script container twice, because they'll both be creating the same command

marble hatch
#

yeah that makes sense

mellow heath
#

If you want /command x and /command y with x and y's handling in different scripts, you can put them in task scripts and call these task scripts from the command script

marble hatch
#

Good to know

#

Thanks