I have a exported list of subscribers in just one line. Now I wanted to check via mIRC script if provided nickname ($2) exists in this file.
So it would output 'Ravelux was not found' if in subscribers.txt Ravelux is provided as
"Ravelux" and not as
Ravelux.
subscribers.txt:
command:
on *:TEXT:!test *:#: {
if ($read(subscribers.txt,w,$2)) {
msg $chan Successfully $2 found
}
else {
msg $chan $2 was not found
}
}
test.txt: "splinny" "splin" (1st line)
$false = //echo -ag $istok($read(test.txt,1),splin,32)
$true = //echo -ag $istok($read(test.txt,1),"splinny",32)
Thank you for your answer. Could you explain me those lines to understand them?
I don't know how I can use this in my problem.
$istok checks if there is exatly same token as it is written, an "32" - separator ($chr(32) = "space"). Yo can read mIRC help file about tokens for more info, there is a lot commands for tokens.
Okay, thank you.
But I don't know if this way would help me out in this way.
Because this textfiles includes 1 line and 49432 characters with no space between.
Looks like you have a lot of subs
No, I am not the streamer. I am just configuring the bot for the streamer. And subscribers should add them multiple times into the list.
So the bot needs to check:
Is it a sub? Yes? Add him multiple times.
A simple text file is not how you should be checking subscribers; use a hash table. If this list is composed by mIRC itself use a hash table to begin with. If this list is composed by another source parse it into a hash table first for future use.
Is this a JSON file? JSON parsers already exist that you can use to get these nicks into a hash table.
/help hash tables
Okay, maybe my way is wrong.
I have a link where I get this one line in webbrowser. I just did get this content via vbs into a textfile and now I want to check this file if $2 is provided in this file.
Maybe you have a better way because I just dont know?
So maybe there is a way to get the information if $2 is a sub or not without saving it into a file?