I'm new to $gettok, not everyone can the scripting language at once.
You've been here since 2003, and I've lost count of how many times people have told you about the mIRC help file. I understand that you might've forgotten how to script, but you can learn in the same way you could 3/4 years ago: by reading the help file.
Yes, on and off i have been here, but i have been doing other things from time to time, so even due i have been a "member" here since 2003 dosent meen i have been coding all the time since that year.
Perhaps if you don't understand something, you should post the script and ask how to find the answers for yourself? That way you'll learn as well as be pointed in the right direction.
I dont know if i have asked someone to "write" me a script, i have been asking "how do i solve this", and i have been reading the code people helped me with, also been trying to understand them, last time i did that was today, the person that helped me broke down the code, then explained what every line does, how ever i dont use the same code all the time, so need to ask again if i dont understand something that is new to me.
In this case, to figure out what was wrong, all you had to do was check what character has the ascii number of 48 by typing //echo -a $chr(48). How did you come up with the number 48 in the first place? I'm guessing you typed //echo -a $asc(/), and then memorised the wrong number in your head.
I asked in a channel, and they told me that i had to figure out it by my self, i tryed to echo the output to me many times, and i couldent get that part to work, and the number 48 was given to me as "the right number to use in this event".
$gettok() is incredibly simple. It simply splits a string into pieces at each point where the character specified is found, and then returns the Nth piece.
$gettok(a.b.c.d,1,46)
mIRC will split the string into four tokens:
a
b
c
d
This is because you've specified 46 as the final parameter, which is the asc number for a dot: .
Now, mIRC will return the 1st token in that list, because you specified 1 in the second parameter. The first token is 'a'
Similar examples:
$gettok(a!b c!d e f!g,3,33)
Tokens:
a
b c
d e f
g
This is because 33 is the ascii number for an exclamation point: !
mIRC returns 'd e f' because that is the third token.
However, if you were to supply 32 as the ascii number instead (a space), the tokens would be:
a!b
c!d
e
f!g
It's not really mindblowing stuff, and the help file explains it in-depth. I'm not sure what you couldn't work out from the help file, are you sure you read it thoroughly, more than once?
48 replaced with 47 did the trick.
$gettok($did(3).sel,1,47)
Do you not think this is something you could've worked out yourself from the start? If something isn't working properly, echo each of the parameters you're passing to the identifier just to make sure you're passing what you're supposed to. If you're passing things like ascii numbers as parameters, then try finding out what their character is by typing //echo -a $chr(<ascii number>) - that will at the very least let you know whether you're using the right number or not. What you need to do is learn how to debug your own scripts.
I trying to understand the code, but i didnt, so i scripted around it instead, but the result would be slower then what you would get. And i trying to debug my script, i even asked here what the best way way, i got a code as answer, but nothing explained what it did. so i still know as mutch now as i did befor about it.
But im done flame about it here. I solved my problem, and i now know a litle bit more about it then i did when i woke up this morning.