mIRC Homepage
Posted By: Ravelux find words inside a word - 18/05/15 01:52 PM
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:
Code:
"Ravelux"


command:
Code:
on *:TEXT:!test *:#: {
  if ($read(subscribers.txt,w,$2)) {
    msg $chan Successfully $2 found
  }
  else {
    msg $chan $2 was not found
  }
}
Posted By: splinny Re: find words inside a word - 18/05/15 01:55 PM
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)
Posted By: Ravelux Re: find words inside a word - 18/05/15 01:59 PM
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.
Posted By: splinny Re: find words inside a word - 18/05/15 02:19 PM
$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.
Posted By: Ravelux Re: find words inside a word - 18/05/15 02:38 PM
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.
Posted By: splinny Re: find words inside a word - 18/05/15 02:46 PM
Looks like you have a lot of subs shocked
Posted By: Ravelux Re: find words inside a word - 18/05/15 03:02 PM
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.
Posted By: Loki12583 Re: find words inside a word - 18/05/15 03:45 PM
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
Posted By: Ravelux Re: find words inside a word - 18/05/15 04:25 PM
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?
© mIRC Discussion Forums