#(alexo14) possibility to see if a execute was succesfull or not &narrate the output of a - execute

88 messages · Page 1 of 1 (latest)

inland zealot
#

Hello, first, the logs
V
Logs: https://paste.denizenscript.com/View/119303

Now, i am trying to make it able to execute commands from my discord and if a command is working, i should print the error or atleast "Command not working." or smth like that and if it works, "Success". This is what i've currently done, it executes commands but if it fails it doesn't print anything, i know rn it's broken and it displays worked for every entry.

https://paste.denizenscript.com/View/119304

devout sigilBOT
#

(alexo14) possibility to see if a execute was succesfull or not &narrate the output of a - execute

devout sigilBOT
#

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.

robust tinsel
#

!c execute tags

meager geyserBOT
# robust tinsel !c execute tags
Group

server

Syntax

execute [as_player/as_op/as_npc/as_server] [<Bukkit-command>] (silent)

Short Description

Executes an arbitrary server command as if the player, NPC, or server typed it in.

Description

Allows the execution of server commands through a Denizen script.
Commands can be executed as the server, as an npc, as an opped player, or as a player, as though it was typed by the respective source.

Note that you should generally avoid using 'as_op', which is only meant for very specific special cases. 'as_server' is usually a better option.

Note: do not include the slash at the start. A slash at the start will be interpreted equivalent to typing two slashes at the front in-game.

Note that...

Related Tags

<entry[saveName].output> returns the output to an as_server sender.

robust tinsel
#

^ you can get the output when using as_server

inland zealot
#

so <entry[saveName].output>

#

saveName being the command?

late oak
#

!Lang save argument

meager geyserBOT
# late oak !Lang save argument

The "save:<name>" argument is a special meta-argument that is available for all commands, but is only useful for some.
It is written like:

  • run MyScript save:mysave

When the save argument is used, the results of the command will be saved on the queue, for later usage by the "entry" tag.

The useful entry keys available for any command are listed in the "Tags" documentation section for any command.
For example, the "run" command lists "<entry[saveName].created_queue>".
The "saveName" part should be replaced with whatever name you gave to the "save" argument,
and the "created_queue" part changes between commands.
Some commands have multiple save entry keys, some have just one, most don't have any.

Many users make the mistake of using dynamic save names like "save:<[something]>" - this is almost always wrong. Use a constant name, just like you do for definitions.

Group

Script Command System

inland zealot
#

damn this made it even worse lmao

#

so saves are created by using run

#

so i should use run execute save:cmdSave, then use <entry[cmdSave].output>

late oak
#

What

#

You don't have to use run

#

That's just an example

inland zealot
#

oh save can be an attribute for - execute

#

like - execute as_server save:cmdSave

late oak
#

- execute as_server "say something" save:my_savename

inland zealot
#

oh alright

#

let me see

#

so if im executing sayHiWorld, it gives me "li@Uknown command, type /help for help |", if im executing another command like "lp user Blabla promote rankup" and user Blabla doesn't exist, it gives "li@", and for commands that exist and that are correct, still "li@"...

robust tinsel
#

They do their permission operations and all then send a message back later once it's done, I.e. too late for the command to see

inland zealot
#

alright so there's no way of showing those

robust tinsel
#

It will work for most commands, it's just that special cases like LuckPerms might have different handling

inland zealot
#

oh alright

#

then this problem is solved, thanks, i have one more small question

#

i tried doing a chat bridge and i wanted to show the world that the player is currently in and before each world, there is a w@, is it possible to not display w@

#

and, roles,

#

for example if i am admin , and using <player.luckperms_primary_group>, it displays luckpermsgroup@ admin

rustic rune
#

!rule 8

meager geyserBOT
# rustic rune !rule 8
Rule 8

Don't overuse the edit/delete buttons. https://denizenscript.com/discord_rules#rule8
Use the edit button to fix typos, and the delete button to remove an accidental post shortly after posting.
Do not remove a post that pings someone, do not edit or delete a post that people have already replied to.

inland zealot
#

sorry, i copy pasted the luckpemrsgroup@ admin

#

and accidentaly didn't do a space between @ and admin and i would have tagged all admins 🙂

inland zealot
#

is there a way to only show the primary track name the user is in?

meager geyserBOT
inland zealot
#

what about the tracks from luckperms?

robust tinsel
#

!s track

meager geyserBOT
# robust tinsel !s track
Search Results

[Partial Name Match] !Tag luckperms.track, !ObjectType luckpermstracktag, !Tag luckperms.list_tracks, !Tag luckpermstracktag.name, !Mechanism entitytag.tracking_range, !Tag luckpermstracktag.groups, !Mechanism itemtag.lodestone_tracked, !Tag itemtag.lodestone_tracked, !Tag playertag.luckperms_tracks, !Event player tracks|untracks entity, !Tag luckpermstracktag.loaded_groups,
[Semi-Strong Match] !Event player right|left clicks fake entity,
[Semi-Decent Match] !Command map, !Command wait, !Command glow, !Command health, !Command shoot, !Language script, !Command explode, !Command runlater, !Command fakespawn, !Command scoreboard, !Command schematic, !Command ratelimit, !Command invisible, !Command npcbossbar, !Tag server.structure_types, !Language /npc constant command, !Tag playertag.fake_entities, !Event entity killed by cause, !Tag server.area_notes_debug, !Language advanced object matching, !Mechanism itemtag.lodestone_location, !Tag itemtag.lodestone_location, !Tag locationtag.mcmmo.is_placed, !Language the player and npc arguments, !Mechanism worldtag.simulation_distance, !Language script event special contexts, !Tag entitytag.mcmmo.is_spawned_mob, !Event player raises|lowers|toggles item,
[Just Barely Matched] !Tag flaggableobject.flag, !Tag flaggableobject.has_flag, !Tag flaggableobject.flag_map, !Tag flaggableobject.list_flags, !Mechanism flaggableobject.clean_flags, !Tag flaggableobject.flag_expiration.

robust tinsel
#

!t luckperms_tracks

meager geyserBOT
inland zealot
#

yea but this returns the tracks, doesn’t show the group from a specific track

#

like i have 2 tracks that players are constantly in, levels and ranks

#

levels 1-25

#

ranks: admin,default..etc.

#

so a normal player in chat is : world - 1 Default - “name” : “chats”

#

so maybe something like <PlayerTag.luckperms_tracks.track[level].group>

#

🤔

inland zealot
#

so i gave up on tracks but i got another questino, can you edit a user's message using this :

discordTextFormatting:
    type: world
    events:
        after discord message received:
            - if <context.new_message.text.contains_text[&4]>:
                - discordmessage id:mybot edit:<context.message> channel:<context.new_message.channel> Hi
steady horizon
#

Im fairly certain you cant edit other peoples messages

inland zealot
#

i thought so but also thought that there's a permission for that, apparently not

#

and also, messages can't be on more rows right?

#

like :

World
#

or is there a certain way to do it?

steady horizon
#

!t &n

meager geyserBOT
steady horizon
#

Eh not that one

#

Theres a tag for the newline character

#

!t &nl

meager geyserBOT
steady horizon
#

There we go

#

Hi<&nl>world

inland zealot
#

Yea nice it works! but, if i have a message that starts with &4, <context.message.text.replace_text[&4, ]> won't replace the &4 with nothing, right?

#

I mean it doesn't, but there's probably another tag i should use

steady horizon
#

it would replace a litteral &4, with nothing, yes

#

if you were trying to remove color

inland zealot
#

yea

steady horizon
#

!t strip_color

meager geyserBOT
# steady horizon !t strip_color

Returns the element with all color encoding stripped.
This will remove any/all colors, formats (bold/italic/etc), advanced formats (fonts/clickables/etc), and translate any translatables (&translate, &score, etc).
This will automatically translate translatable sections

Group

text manipulation

Returns

ElementTag

inland zealot
#

well im trying to convert &4 to discord's color formatting

#

and right there im using the red color formatting of discord and in the middle i want the message that the user writes

#

and he'll write &4Hi

#

and the bot writes in red &4Hi, so yea

steady horizon
#

did you mean to use

#

!t replace.with

meager geyserBOT
inland zealot
#

so this would be context.message.replace[&4].with[""} ?

steady horizon
#

well.. not "" if you just want to remove it you dont need the with part

#

but if you are replacing with something you would put it in the with section

inland zealot
#

no i just want to delete it

#

and the rest to remain

#

so just context.message.replace[&4]

steady horizon
#

ya

inland zealot
#

alright thanks man 🙂