mIRC Home    About    Download    Register    News    Help

Print Thread
#97869 18/09/04 08:32 AM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
How come $gettok($sline(@TimedAds,%sads.tmp),1,9) does not return the text / timer name?

Code:
menu @TimedAds {
  dclick halt
  stop the ads
  .selected ones: {
    var %sads.i = 1
    :0 
    var %sads.tmp = $sline(@TimedAds,%sads.i).ln
    if (%sads.tmp > 0) { 
      .timertm_advert $+ $gettok($sline(@TimedAds,%sads.tmp),1,9) off 
      eecho tm_advert $+ $gettok($sline(@TimedAds,%sads.tmp),1,9) is off 
      dline @TimedAds $sline(@TimedAds,%sads.i).ln 
      goto 0 
    }
  }
  .stop all:.timertm_advert* off | eecho All Ads are Off | if ($window(@TimedAds)) window -c @TimedAds
}

#97870 18/09/04 12:23 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
You need to use $line in that case, the following is a shortened version of the loop:

while ($sline(@TimeAds,1).ln) {
var %x = $gettok($line(@TimeAds,$ifmatch),1,9)
.timertm_advert $+ %x off
eecho tm_advert $+ %x is off
dline @TimeAds $ifmatch
}

#97871 18/09/04 01:07 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Just a sidenote: the 2nd $ifmatch could fail if the /eecho alias contains an if statement. If this is the case, I'd store $ifmatch (or $v1, as it is now known) in a var first.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#97872 18/09/04 01:27 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
Good point, or just reverse the order of the commands


Link Copied to Clipboard