mIRC Home    About    Download    Register    News    Help

Topic Options
#232299 - 29/05/11 03:53 PM question about /play
Kreuz123123 Offline
Ameglian cow

Registered: 09/05/11
Posts: 24
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


Edited by Kreuz123123 (29/05/11 03:53 PM)

Top
#232312 - 29/05/11 09:35 PM Re: question about /play [Re: Kreuz123123]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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.


Edited by Tomao (29/05/11 09:49 PM)

Top
#232315 - 29/05/11 10:01 PM Re: question about /play [Re: Kreuz123123]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#232316 - 30/05/11 02:56 AM Re: question about /play [Re: Riamus2]
Kreuz123123 Offline
Ameglian cow

Registered: 09/05/11
Posts: 24
and if i want to input the gettok into the play command itself? without making an alias is that possible?

Top
#232317 - 30/05/11 03:01 AM Re: question about /play [Re: Kreuz123123]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
No. Anything other than displaying everything as-is requires an alias or some other external method.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#232320 - 30/05/11 09:47 AM Re: question about /play [Re: Kreuz123123]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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.

Top
#232321 - 30/05/11 02:03 PM Re: question about /play [Re: Tomao]
Kreuz123123 Offline
Ameglian cow

Registered: 09/05/11
Posts: 24
yea but if other people will want to change that? if i remove
Quote:
1=
2=
3=

will those lines still be changeable?

Top
#232325 - 30/05/11 03:22 PM Re: question about /play [Re: Kreuz123123]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#232328 - 30/05/11 04:39 PM Re: question about /play [Re: Riamus2]
Kreuz123123 Offline
Ameglian cow

Registered: 09/05/11
Posts: 24
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
?

Top
#232331 - 30/05/11 06:19 PM Re: question about /play [Re: Kreuz123123]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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.

Top
#232332 - 30/05/11 06:46 PM Re: question about /play [Re: Kreuz123123]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#232334 - 30/05/11 07:08 PM Re: question about /play [Re: Riamus2]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
Opps, I overlooked that the $nick is used. I thought he wanted to find out about a topic in the ini file.


Edited by Tomao (30/05/11 07:08 PM)

Top
#232336 - 30/05/11 08:20 PM Re: question about /play [Re: Tomao]
Kreuz123123 Offline
Ameglian cow

Registered: 09/05/11
Posts: 24
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

Top