mIRC Home    About    Download    Register    News    Help

Print Thread
#120347 17/05/05 02:08 AM
Joined: Feb 2003
Posts: 106
L
Vogon poet
OP Offline
Vogon poet
L
Joined: Feb 2003
Posts: 106
While looking at the code of the popular trivia script, and wondering why it will not run on newer versions of Mirc I came across an identifier called '$token'. I found no reference to that identifier in the mirc help file, nor could I find it declared as a custom identifier in any of the *.ini files which come with Trivbot2001.
I was wondering if $token was an undocumented identifier in earlier versions of mirc.
Anybody know?

thanks Mark


-
Just because it never happened doesn't mean it isn't true.
#120348 17/05/05 02:17 AM
Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
$token was replaced by $gettok but it still works.

~ Edit ~
Taken from http://www.mirc.co.uk/versions.txt

-----------------------------------------

09/12/96 - mIRC v4.7

121.Added token handling identifiers:

$addtok(text,token,C) - adds a token to the end of text but only if it's not already in text.
$findtok(text,token,C) - returns Nth position of token in text
$gettok(text,N,C) - returns Nth token in text
$instok(text,token,N,C) - inserts token into Nth position in text even if it already exists in text.
$remtok(text,token,C) - removes 1 matching token from text
$reptok(text,token,new,C) - replaces 1 matching token with new token in text.

$gettok() replaces $token(), however $token() is still supported for this version.


-----------------------------------------

It says "still supported for this version" but $token is still working in v6.16

-----------------------------------------

30/06/96 - mIRC v4.5

48.New Identifiers:

$token(N,C,text) return Nth token separated by character C


-----------------------------------------

$token(N,C,text)
$token(1,32,this is a test) returns this

but I noticed that $token also works like $gettok

$token(text,N,C)
$token(this is a test,1,32) returns this

~ Edit ~
Well, upon testing the old $token format, it seems $token(N,C,text) no longer works
but when used in same format as $gettok(text,N,C) it works fine: $token(text,N,C)

Ok, I'm done rambling smile

Last edited by mIRCManiac; 17/05/05 02:38 AM.
#120349 17/05/05 02:45 AM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
There was an update by Watchdog to work with 6.03 (dunno if it would work with anything newer). Unfortunately, he has removed all references to IRC from his website, which makes it virtually impossible to get a copy of it unless you have a friend that has one.


I refuse to engage in a battle of wits with an unarmed person. wink
#120350 17/05/05 10:20 PM
Joined: Feb 2003
Posts: 106
L
Vogon poet
OP Offline
Vogon poet
L
Joined: Feb 2003
Posts: 106
Thanks to everyone for their answers.
I had already discovered that $gettok will work instead of $token, but to make the Trivbot script work, the identifier arguments needed to be arranged in a different order. ie
n55=;return $token($2,$asc($3),$1)
n56=return $gettok($1,$2,$asc($3))
I found one other error, which mirc reported as ' /if: insufficient parameters (line 220, script.ini)'.
Mirc 6.16 reports this error, but Mirc 5.6 lets it go by with no problems running the script. However I managed to nut that problem out too. Hint : count the opening and closing brackets in line 220 lol
Anyways, Trivbot now runs in the latest version of Mirc.
Why do I want it so? Dunno... I just like wasting time, and I won't be able to do it when I am dead smile

regards, Mark


-
Just because it never happened doesn't mean it isn't true.

Link Copied to Clipboard