#(Behr) Counting a string in text
83 messages · Page 1 of 1 (latest)
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.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
i can't always rely on it being one character or space separated either, or i'd use to_list or space_separated
thats... interesting, after getting list of those elements you could use listtag.count[] tho
your solution there seems competent
it'd get more complex if you needed to actually do anything with the element
@ocean mist <element[my lasagna named lasagna loves lasagna].split[lasagna].size>
Tag parse results for <element[my lasagna named lasagna loves lasagna].split[lasagna].size>: https://paste.denizenscript.com/View/110034
3
the split[thing].size just needs to be split[thing].size.sub[1] and that works i guess lol
unless uh
i just realized your example is different than what im working with
Tag parse results for <element[my lasagna named lasagna loves lasagna anything after the check].split[lasagna].size>: https://paste.denizenscript.com/View/110035
4
if it has any text after it, it needs -1
@ocean mist <element[hi hello hi huh let'shi see].split[hi].size>
Tag parse results for <element[hi hello hi huh let'shi see].split[hi].size>: https://paste.denizenscript.com/View/110036
4
ah
Tag parse results for <element[zero taco one taco two].split[taco].size><n><element[taco one taco].split[taco].size><n><element[taco one taco two].split[taco].size>: https://paste.denizenscript.com/View/110037
3
2
3
oh, and if text before
Tag parse results for <element[zero taco one taco two].split.count[taco]>: https://paste.denizenscript.com/View/110038
2
?
that's space split
i wont actually have spaces in my usage, im splitting by crazy strings lol
@ocean mist <element[hi hello hi huh let'shi see].split.count[hi]>
Tag parse results for <element[hi hello hi huh let'shi see].split.count[hi]>: https://paste.denizenscript.com/View/110040
2
doesn't work
show me yah crazy strings
this is vague like a rague
span class="meta_url">ObjectType</span><a href="
yes
im replacing span class="meta_url">ObjectType</span><a href=" in
Sends a message to a Discord channel.
Command may fail if the bot does not have permission within the Discord group to send a message in that channel.
You can send the message to: a channel, user, or in reply to a previous message.
If sending as a reply, optionally use "no_mention" to disable the default reply pinging the original user.
Channels can be specified as either a copied ID, or using any tag that returns a valid DiscordChannelTag.
To get IDs, enable "Developer Mode" in your Discord settings, then right click on the channel and press "Copy ID".
You can edit an existing message by using "edit:<message>".
You can use "attach_file_name:<name>" and "attach_file_text:<text>" to attach a text file with longer content than a normal message allows.
You can use "rows" to attach action rows of components, such as buttons to the message, using <span class="meta_url">ObjectType</span><a href="/Docs/ObjectTypes/DiscordButtonTag">DiscordButtonTag</a>, and <span class="meta_url">ObjectType</span><a
href="/Docs/ObjectTypes/DiscordSelectionTag">DiscordSelectionTag</a>.
The command can be ~waited for. See <span class="meta_url">Language:</span><a href="/Docs/Languages/~waitable">~waitable</a>.```
lmfao
why
I'm still a little confused of your end goal
but uh,
!t element.replace_text
Returns the element with all instances of an element removed.
element manipulation
ElementTag
Returns the element with all instances of a element replaced with another.
Specify regex: at the start of the replace element to use Regex replacement.
Specify firstregex: at the start of the replace element to Regex 'replaceFirst'
element manipulation
ElementTag
dDiscordBot
external
discordmessage (id:<id>) [reply:<message>/edit:<message>/channel:<channel>/user:<user>] (<message>) (no_mention) (rows:<rows>) (embed:<embed>|...) (attach_files:<map>)
Sends a message to a Discord channel.
Sends a message to a Discord channel.
Command may fail if the bot does not have permission within the Discord group to send a message in that channel.
You can send the message to: a channel, user, or in reply to a previous message.
If sending as a reply, optionally use "no_mention" to disable the default reply pinging the original user.
Channels can be specified as either a copied ID, or using any tag that returns a valid DiscordChannelTag.
To get IDs, enable "Developer Mode" in your Discord ...
there's two object links in this description
to get the name of each one, i have to use element manipulation to get discordbutton and discordselection
i dont want to use regex though
it kills the queuespeed
Do you haaaave more background info?
Because you could just ``.split[/Docs/ObjectTypes]>and then.after[/].before["]` on both entries of the list
it's for two different projects, it's half for my
custom meta command script
and the other half is for my website fancy colorizer
this is close, but it can't work because of this example:
if <[text]> is:
. . . . . . . . .
. . . . axb . . .
. . . . . . ayb .
. . . . . . . . .```
if i want x to have a fancy a and b, i can't just do:
- foreach x|y as:string:
- define text <[text].after[a].before[b]>
- define text <[text].replace_text[a<[string]>b].with[-a-<[string]>-b-]>
because the second loop will fill my first tag <[text].after[a].before[b]> with -<[string]>- and not <[string]>
i have to grab x and y and then replace them after or replace the whole thing exactly once
i also need to save a few different parts of that so i can format stuff the way i want for both projects
What's the outcome you wish for?
this but not broken on the DiscordSelectionTag link, i just have to finish writing it
i had to add the repeat to get to the second one
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Wanna post ya current scripty script
depends on if you want to puke or not 
it is not clean at all and i planned on doing that waaay later LMAO
would either need to rename this thread or start a new one if you wanted to do that too, cause i think i have what i wanted tag-wise lol
!c discordmessage usage
dDiscordBot
external
discordmessage (id:<id>) [reply:<message>/edit:<message>/channel:<channel>/user:<user>] (<message>) (no_mention) (rows:<rows>) (embed:<embed>|...) (attach_files:<map>)
Sends a message to a Discord channel.
- discordmessage id:mybot channel:1234 "Hello world!"
- discordmessage id:mybot reply:<context.message> "Hello world!"
- discordmessage id:mybot channel:1234 embed:<discord_embed[title=hi;description=this is an embed!]>
- ~discordmessage id:mybot channel:1234 "Hello world!" save:sent
- announce "Sent as <entry[sent].message.id>"
- discordmessage id:mybot user:<[user]> "Hello world!"
... and 5 more.
fack
because ive completely buried my chat with that alone
but i can at least breathe with this less space
my little x even deletes the message + my !c command
and cause this is pretty 
there's not a good reason
she's beautiful 
lmk if you want to see that script though, it's just under serious baggage as a fair warning lol