mIRC Home    About    Download    Register    News    Help

Print Thread
#232299 29/05/11 02:53 PM
Joined: May 2011
Posts: 24
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: May 2011
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

Last edited by Kreuz123123; 29/05/11 02:53 PM.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.

Last edited by Tomao; 29/05/11 08:49 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: May 2011
Posts: 24
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: May 2011
Posts: 24
and if i want to input the gettok into the play command itself? without making an alias is that possible?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
No. Anything other than displaying everything as-is requires an alias or some other external method.


Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.

Joined: May 2011
Posts: 24
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: May 2011
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?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: May 2011
Posts: 24
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: May 2011
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
?

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Opps, I overlooked that the $nick is used. I thought he wanted to find out about a topic in the ini file.

Last edited by Tomao; 30/05/11 06:08 PM.
Joined: May 2011
Posts: 24
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: May 2011
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


Link Copied to Clipboard