chatのリンククリックについて

on chat:
cancel event
send "%message%" to player
on chat:
cancel event
send "%message%" to player
このコードで送られるメッセージにリンクがあった場合そのリンクを開くことができません。 開けるようにするにはどうすればいいですか? また%message%にlunachatが通らないようにするにはどうすればいいですか? イメージ
28 Replies
unnnnnnnnnnn
unnnnnnnnnnn2y ago
priorityいじればlunachatは回避できそう
yukkina
yukkina2y ago
lunachatのpriority上げるか、skのpriority下げるか
soramame_256
soramame_2562y ago
前者めんどくさいかも。 <url:%url%>をメッセージにかませればいけるんだけどurlの抽出とその直前と直後に文をさはむのがだるい
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
configに設定あるよ
soramame_256
soramame_2562y ago
mj
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
このdisabledをstrictに変えればいい
わし
わし2y ago
はえ^~
ぐううううう
すみません、反応遅れました。 ありがとうございます!前者のほうは解決できました。 しかし、後者のリンクを踏むものができませんでした。。 再起動したり、Skriptのバージョンを変えてみたりしてみたのですが、踏めませんでした。 リンクの件
on chat:
cancel event
send "%message%" to player
on chat:
cancel event
send "%message%" to player
でチャットに"リンク"と書いたときはできなかったんですけど、
on chat:
cancel event
send "リンク" to player
on chat:
cancel event
send "リンク" to player
ではいけました。 チャットの内容を踏めるようにできませんか?
on chat:
cancel event
set {_t} to message
send "%{_t}%" to player
on chat:
cancel event
set {_t} to message
send "%{_t}%" to player
で一回変数に入れてみたんですけど変わりませんでした。
mirageeeeeeeeeeeeeeeeeeeeeeeeeee
config変えても出来ませんでしたか?
ぐううううう
config すべて試しました。 on chat: cancel event send "https://www.google.co.jp/" to player このようにしたら読み込めました。
yukkina
yukkina2y ago
evaluateしちゃう? (最終手段)
evaluate "send ""%message%"" to player"
evaluate "send ""%message%"" to player"
何か
何か2y ago
command /test:
trigger:
set {_p} to parse_links("test&ahttps://docs.skriptlang.org/effects.html どこに&bhttps://docs.skriptlang.org なにが あっても &3http://mirage.com parseします")
send formatted {_p}

function parse_links(str: string) :: string:
set {_start} to 0
set {_end} to 0
set {_last_end} to 0
set {_result} to ""
set {_skipped_text} to ""
while {_start} is not -1:
set {_start} to str_indexof({_str}, "http", {_end})
set {_end} to str_indexof({_str}, " ", {_start}) - 1

if {_start} > {_end}:
set {_end} to length of {_str}

if {_start} * {_end} > 1:
set {_skipped_text} to substring of {_str} from {_last_end} + 1 to {_start} - 1
set {_url} to substring of {_str} from {_start} to {_end}
set {_result} to "%{_result}%%{_skipped_text}%<url:%{_url}%>%{_url}%&r"

set {_last_end} to {_end}

if length of {_result} is 0:
return {_str}

set {_remains} to ""
if {_last_end} < length of {_str}:
set {_remains} to substring of {_str} from {_last_end} + 1 to length of {_str}

set {_result} to "%{_result}%%{_remains}%"

return {_result}

function str_indexof(source: string, find: string, start: number = 1) :: number:
if length of {_source} < {_start}:
return -1
set {_sub} to substring of {_source} from {_start} to length of {_source}
set {_index} to index of {_find} in {_sub}
if {_index} is -1:
return -1
if {_start} > 1:
subtract 1 from {_index}
return {_index} + {_start}

command /test:
trigger:
set {_p} to parse_links("test&ahttps://docs.skriptlang.org/effects.html どこに&bhttps://docs.skriptlang.org なにが あっても &3http://mirage.com parseします")
send formatted {_p}

function parse_links(str: string) :: string:
set {_start} to 0
set {_end} to 0
set {_last_end} to 0
set {_result} to ""
set {_skipped_text} to ""
while {_start} is not -1:
set {_start} to str_indexof({_str}, "http", {_end})
set {_end} to str_indexof({_str}, " ", {_start}) - 1

if {_start} > {_end}:
set {_end} to length of {_str}

if {_start} * {_end} > 1:
set {_skipped_text} to substring of {_str} from {_last_end} + 1 to {_start} - 1
set {_url} to substring of {_str} from {_start} to {_end}
set {_result} to "%{_result}%%{_skipped_text}%<url:%{_url}%>%{_url}%&r"

set {_last_end} to {_end}

if length of {_result} is 0:
return {_str}

set {_remains} to ""
if {_last_end} < length of {_str}:
set {_remains} to substring of {_str} from {_last_end} + 1 to length of {_str}

set {_result} to "%{_result}%%{_remains}%"

return {_result}

function str_indexof(source: string, find: string, start: number = 1) :: number:
if length of {_source} < {_start}:
return -1
set {_sub} to substring of {_source} from {_start} to length of {_source}
set {_index} to index of {_find} in {_sub}
if {_index} is -1:
return -1
if {_start} > 1:
subtract 1 from {_index}
return {_index} + {_start}

何か
何か2y ago
何か
何か2y ago
Want results from more Discord servers?
Add your server