mIRC Home    About    Download    Register    News    Help

Print Thread
#182058 03/08/07 11:37 PM
Joined: Jan 2004
Posts: 509
L
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
/play -c doesn't evaluate all commands.

Say I have oldest.txt

And in there I have:

Code:
var %i = 1 | inc %i
/say %i $+ . Yone Minagawa (January 4, 1893) $iif($gettok($date($ctime),3,47) < $gettok($date(04/01/1993),3,47),$calc(2007-1893),$calc(2006-1893)) years $gettok($betterduration($calc($ctime($date) - $ctime(04/01/1993))),2,44) | inc %i
/say %i $+ . Edna Parker (April 20, 1893) $iif($gettok($date($ctime),3,47) < $gettok($date(20/04/1993),3,47),$calc(2007-1893),$calc(2006-1893)) years $gettok($betterduration($calc($ctime($date) - $ctime(20/04/1993))),2,44) | inc %i
/say %i $+ . Maria de Jesus (Septembr 10, 1893) $iif($gettok($date($ctime),3,47) < $gettok($date(10/09/1993),3,47),$calc(2007-1893),$calc(2006-1893)) years $gettok($betterduration($calc($ctime($date) - $ctime(10/09/1993))),2,44) | inc %i
/say %i $+ . Bertha Fry (December 1, 1893) $iif($gettok($date($ctime),3,47) < $gettok($date(01/12/1993),3,47),$calc(2007-1893),$calc(2006-1893)) years $gettok($betterduration($calc($ctime($date) - $ctime(1/12/1993))),2,44) | inc %i
/say %i $+ . Shitsu Nakano (January 1, 1894) $iif($gettok($date($ctime),3,47) < $gettok($date(01/01/1994),3,47),$calc(2007-1894),$calc(2006-1894)) years $gettok($betterduration($calc($ctime($date) - $ctime(01/01/1994))),2,44) | inc %i
/say %i $+ . Arbella Ewing (March 13, 1894) $iif($gettok($date($ctime),3,47) < $gettok($date(13/03/1994),3,47),$calc(2007-1894),$calc(2006-1894)) years $gettok($betterduration($calc($ctime($date) - $ctime(13/03/1994))),2,44) | inc %i
/say %i $+ . Marie-Simone Capony (March 14, 1894) $iif($gettok($date($ctime),3,47) < $gettok($date(14/03/1994),3,47),$calc(2007-1894),$calc(2006-1894)) years $gettok($betterduration($calc($ctime($date) - $ctime(14/03/1994))),2,44) | inc %i
/say %i $+ . Gertrude Baines (April 6, 1894) $iif($gettok($date($ctime),3,47) < $gettok($date(06/04/1994),3,47),$calc(2007-1894),$calc(2006-1894)) years $gettok($betterduration($calc($ctime($date) - $ctime(06/04/1994))),2,44) | inc %i
/say %i $+ . Tsuneyo Toyonaga (May 21, 1894) $iif($gettok($date($ctime),3,47) < $gettok($date(21/05/1994),3,47),$calc(2007-1894),$calc(2006-1894)) years $gettok($betterduration($calc($ctime($date) - $ctime(21/05/1994))),2,44) | inc %i
/say %i $+ . Yasu Nishima (August 20, 1894) $iif($gettok($date($ctime),3,47) < $gettok($date(20/08/1994),3,47),$calc(2007-1894),$calc(2006-1894)) years $gettok($betterduration($calc($ctime($date) - $ctime(20/08/1994))),2,44) | inc %i


Then I //play -c $mircdirGerontology\OldestList.txt 500

I get:

[August 03 2007 Friday 06:23:51 PM] <Neal> . Yone Minagawa (January 4, 1893) 114 years 210 days
[August 03 2007 Friday 06:23:52 PM] <Neal> 1. Edna Parker (April 20, 1893) 114 years 104 days
[August 03 2007 Friday 06:23:53 PM] <Neal> 2. Maria de Jesus (Septembr 10, 1893) 114 years 326 days
[August 03 2007 Friday 06:23:54 PM] <Neal> 3. Bertha Fry (December 1, 1893) 114 years 244 days
[August 03 2007 Friday 06:23:55 PM] <Neal> 4. Shitsu Nakano (January 1, 1894) 113 years 213 days
[August 03 2007 Friday 06:23:56 PM] <Neal> 5. Arbella Ewing (March 13, 1894) 113 years 142 days
[August 03 2007 Friday 06:23:57 PM] <Neal> 6. Marie-Simone Capony (March 14, 1894) 113 years 141 days
[August 03 2007 Friday 06:23:58 PM] <Neal> 7. Gertrude Baines (April 6, 1894) 113 years 118 days
[August 03 2007 Friday 06:23:59 PM] <Neal> 8. Tsuneyo Toyonaga (May 21, 1894) 113 years 73 days
[August 03 2007 Friday 06:24:00 PM] <Neal> 9. Yasu Nishima (August 20, 1894) 113 years 348 days

In other words, the inc works, but not set.

Say I //play the file again.

[August 03 2007 Friday 06:24:41 PM] <Neal> 10. Yone Minagawa (January 4, 1893) 114 years 210 days
[August 03 2007 Friday 06:24:41 PM] <Neal> 11. Edna Parker (April 20, 1893) 114 years 104 days
[August 03 2007 Friday 06:24:42 PM] <Neal> 12. Maria de Jesus (Septembr 10, 1893) 114 years 326 days
[August 03 2007 Friday 06:24:42 PM] <Neal> 13. Bertha Fry (December 1, 1893) 114 years 244 days
[August 03 2007 Friday 06:24:43 PM] <Neal> 14. Shitsu Nakano (January 1, 1894) 113 years 213 days
[August 03 2007 Friday 06:24:43 PM] <Neal> 15. Arbella Ewing (March 13, 1894) 113 years 142 days
[August 03 2007 Friday 06:24:44 PM] <Neal> 16. Marie-Simone Capony (March 14, 1894) 113 years 141 days
[August 03 2007 Friday 06:24:44 PM] <Neal> 17. Gertrude Baines (April 6, 1894) 113 years 118 days
[August 03 2007 Friday 06:24:45 PM] <Neal> 18. Tsuneyo Toyonaga (May 21, 1894) 113 years 73 days
[August 03 2007 Friday 06:24:45 PM] <Neal> 19. Yasu Nishima (August 20, 1894) 113 years 348 days

I tried:

//set %i 0 | inc %i

Play the file, starts at 20 to 29.

At the end of the file, I tried:

//unset %i | echo -a %i

Lists the nicks again from 30 to 39

By the time I'm at 89, at the end of the file, I add, dec %i 100

Goes from 90 to 99.

Play it 1 more time, and it starts from 100 to 109.

Nevertheless, inc %i works in /play, but not /dec %i, set %i anything, echo -a %i, nothing, etc... Just inc. Rather annoying..

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
(topic moved from Bug Reports)

There's nothing wrong with mirc here. The first line in the file:
var %i = 1 | inc %i
declares a local var and increments it by 1. The file however is not treated as a script (as a whole), the lines are treated individually: line 2 will not know anything about a local var %i, so it will treat %i as global. This is why a second /play command will pick up the global var from the previous run and increment it further. Replacing the first line in the file with:
set %i 0 | inc %i
works fine though and I don't know why it didn't seem to work for you.

As I have told you in private, before reporting what you think are scripting-related bugs, make sure they are not actually scripting mistakes, by asking in the Scripts&Popups forum.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jan 2004
Posts: 509
L
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Perfect, thanks.


Link Copied to Clipboard