mIRC Homepage
Posted By: Kreuz123123 question about /play - 29/05/11 02:53 PM
Hello i use a /play command to play 10 to 15 lines from my ini folder but the lines that saved in the ini are like this

Quote:
1= text
2= text
3= text

and when i play it plays even the "1= 2= 3=" inside the ini file
is there something to remove them?
not from the ini file but so it wont appear in the play command
Posted By: Tomao Re: question about /play - 29/05/11 08:35 PM
You may need to filter the content of the ini file to a temporary file and then play it like this:
Code:
alias playlines {
  if $isid {
    write lines $gettok($1-,-1,61)
    .timerlines 1 1 .play # lines 2000
  }
  else {
    write -c lines
    filter -fk YourFile.ini playlines *=*
  }
} 
The command is:
Code:
/playlines
Change YourFile.ini to your actual one.
Posted By: Riamus2 Re: question about /play - 29/05/11 09:01 PM
You can just use an alias...

//play -a clean file.ini

Code:
alias clean { msg $1 $gettok($1-,2-,61) }


Of course, adjust the /play command to suit your needs.
Posted By: Kreuz123123 Re: question about /play - 30/05/11 01:56 AM
and if i want to input the gettok into the play command itself? without making an alias is that possible?
Posted By: Riamus2 Re: question about /play - 30/05/11 02:01 AM
No. Anything other than displaying everything as-is requires an alias or some other external method.
Posted By: Tomao Re: question about /play - 30/05/11 08:47 AM
Alternatively you could check out the /play command and its -t switch. It works like so:
In a text file, put all the relative info in this format:
Quote:
[topic1]
text
text
text
[topic2]
text
text
text
etc..Then use:
Code:
//play -t<TopicHere> $chan lines.txt 2000
<TopicHere> are the ones enclosed by the [topic1] and [topic2]When you have specified topic1, it'll only play the texts within topic1 and so on and so forth.
Posted By: Kreuz123123 Re: question about /play - 30/05/11 01:03 PM
yea but if other people will want to change that? if i remove
Quote:
1=
2=
3=

will those lines still be changeable?
Posted By: Riamus2 Re: question about /play - 30/05/11 02:22 PM
If you do not use the standard ini file format, then you have to change how you read/write to the file. Using that really small alias is a lot easier than changing everything else you do with the file to handle a file without item names. If you don't do anything else with the file, then it's an easy enough change, but otherwise just use the alias. It's not very hard to use.
Posted By: Kreuz123123 Re: question about /play - 30/05/11 03:39 PM
hmm and how am i supposed to use the /play command with -a and -t?
should it be like that

Quote:
.play -at clean $+ $nick $chan file.ini 10
?
Posted By: Tomao Re: question about /play - 30/05/11 05:19 PM
Code:
alias -l clean msg $1 $gettok($1-,2-,61)
alias playlines play $+(-at,$$1) clean file.ini 2000
Then use:
Code:
/playlines TopicHere
You should change the number 10 to 2000, which equals to a 2-second delay between each output.
Posted By: Riamus2 Re: question about /play - 30/05/11 05:46 PM
The topic is attached to the -t switch...

/play -atSomeTopic clean #channel file.ini 1500

If your topic is $nick, then:

/play -at $+ $nick clean #channel file.ini 1500

Of course, 1500 is whatever delay you want to use.
Posted By: Tomao Re: question about /play - 30/05/11 06:08 PM
Opps, I overlooked that the $nick is used. I thought he wanted to find out about a topic in the ini file.
Posted By: Kreuz123123 Re: question about /play - 30/05/11 07:20 PM
thanks alot guys smile i tested it and it works like a charm

now i need to browse the /help section in mIRC for something else :P
© mIRC Discussion Forums