AgentGamerPro Posted December 16, 2020 Share Posted December 16, 2020 i want to check if a message contains a % of numbers, (e.g. code below) on chat: if 25% or more of message contains numbers: Anyway to solve this? Lifestealed | Minecraft Servers OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - Present Link to comment Share on other sites More sharing options...
_iZ_ Posted December 16, 2020 Share Posted December 16, 2020 This probably isn't the most efficient way, but it should work: on chat: set {_nums::*} to split "1 2 3 4 5 6 7 8 9 0" at " " set {_chat::*} to split message at "" loop {_chat::*}: if {_nums::*} contains loop-value: add 1 to {_count} set {_length} to length of message if {_count} / {_length} >= 0.25: #code here I think you need SkQuery for this to work but I'm not 100% sure. 1 1 » IGN: _iZ_ « » Joined: 12/18/2016 « » VIP: 1/13/2018 « » Helper: 1/29/2021 « » [<3]: 5/8/2021 « » Skript dev « » Discord: iZz#0420 « React to this if I was helpful, found this interesting, or you're just nice Link to comment Share on other sites More sharing options...
AgentGamerPro Posted December 16, 2020 Author Share Posted December 16, 2020 1 minute ago, _iZ_ said: This probably isn't the most efficient way, but it should work: on chat: set {_nums::*} to split "1 2 3 4 5 6 7 8 9 0" at " " set {_chat::*} to split message at "" loop {_chat::*}: if {_nums::*} contains loop-value: add 1 to {_count} set {_length} to length of message if {_count} / {_length} >= 0.25: #code here I think you need SkQuery for this to work but I'm not 100% sure. Thanks Lifestealed | Minecraft Servers OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - Present Link to comment Share on other sites More sharing options...
_iZ_ Posted December 16, 2020 Share Posted December 16, 2020 Just now, AgentGamerPro said: Thanks No problem » IGN: _iZ_ « » Joined: 12/18/2016 « » VIP: 1/13/2018 « » Helper: 1/29/2021 « » [<3]: 5/8/2021 « » Skript dev « » Discord: iZz#0420 « React to this if I was helpful, found this interesting, or you're just nice Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now