I think the point people are trying to make is to start smaller. Don't try to write a huge script if you don't know some basic things first. Start out with smaller scripts that are easier to handle until you learn enough to handle larger scripts. Based on your number of questions, it does appear that you are trying to write large scripts that you simply aren't ready for.

If you don't understand a specific command/identifier, read the help file, or ask about it with specific questions. Don't try to work around something you don't understand as that will just cause you more trouble.

As mentioned, $gettok is really easy. Think of it like separating words. You know how to count the words in a sentence, right? You also know how to count the sentences in a paragraph, right? It's the same idea.

$gettok(text,word number,separator)

Sample text located in the %text variable: "This is a test sentence. This is another sentence."

You know by looking at it, that the 3rd word is "a". You are figuring out the word number by separating the text by spaces. If you were counting sentences, you would separate the text by periods (assuming all sentences ended in periods rather than other punctuation marks). Well, the ASCII character for a space is 32. For a period, it's 46. So, let's look at the text using $gettok (remember that the text is located in the %text variable in this example).

$gettok(%text,3,32)

That will tell you the 3rd word (3 = 3rd item, 32 = space as mentioned previously).

$gettok(%text,2,46)

That will tell you the second sentence (2 = 2nd item, 46 = period as mentioned previously).

You can also count the total items using $gettok by using 0 as the item number...

$gettok(%text,0,32)

That will tell you the number of words (separated by spaces). Of course, $numtok does this in less text because you don't need the item number.

Now, keeping that in mind, you can separate the items (aka words) using other characters rather than spaces or periods. Maybe you want to find the Xth item in a list of items separated by commas. If so, you'd use the item number you want to find for the second parameter and 44 as the separator number. 44 = comma.

If you need to find out what number to use, type:

//echo -a $asc(character)

Replace "character" with the character you want to look up. For example, a period...

//echo -a $asc(.)

Note that some characters cannot be displayed with $asc due to how mIRC parses information. Two examples are spaces (32) and commas (44).

Note that all token identifiers work the same basic way. Just read the help file to find out the syntax.

As far as asking for help in channels, I'd suggest finding a channel that is more helpful. There are good scripting help channels and bad ones. If they aren't being much help, then try a different one. Ones that I used in the past were on DALnet, but I don't think they are still around.

Anyhow, like I said, you really should just start smaller and then work your way up. Don't mess with dialogs until you understand how to use basic scripting. Don't mess with sockets until you understand how to use basic scripting. Don't try to write a "full" script until you understand how to use basic scripting. Etc. This is why programming books start you out with how to display "Hello world!" to your screen before they teach you how to write a game or some other more complex thing.


Invision Support
#Invision on irc.irchighway.net