mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2006
Posts: 2
G
GrAngel Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
G
Joined: Jan 2006
Posts: 2
Hi,

I'm fairly new to irc scripting.

I have the following problem: I have a file with information like:

[tag1]
info1
info2
info3
--------
[tag2]
info1
info2
info3
-------
[tag3]
info1
info2
info3
-------

etc...

Now I want to play that file to ppl requesting info from it.

The command for that would be:

/play -q4ttag2 D:\Program\mIRCStorm\timezone.txt 200

now I want my ircchannel to respond on something like:

showinfo aTag (where aTag can be any of the tags in the file)

I have a line in Remote that says:

on 1:text:*showinfo*:#mytest:/pinfo $$2

IMHO meaning: act on an entry that contains the word showinfo in channel #mytest. When found execute /pinfo and pass the 2nd variable (aTag in this case) on to the /pinfo command.

Now in my aliases I have:

/pinfo /play -q4t$2 $nick D:\Program\mIRCStorm\info.txt

now I would think that this would pass aTag in $2 into the t command from play, but the problem is that play doesn't see it as a variable but as the real input:

/play: topic '[$2]' not found in 'info.txt'

Is it at all possible to make play getting a variable input there ?
and if so, HOW?

Thanks in advance for your time and advice.

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
This should do. Keep the spacing in tact.

/pinfo /play -q4t $+ $2 $nick D:\Program\mIRCStorm\info.txt

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
In mIRC, identifiers (commands that start with $ and return a value) cannot be directly next to characters other than space. Try this:

/pinfo /play -q4t $+ $2 $nick D:\Program\mIRCStorm\info.txt

The $+ identifier joins the text before and after itself.

-genius_at_work

Joined: Jan 2006
Posts: 2
G
GrAngel Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
G
Joined: Jan 2006
Posts: 2
Thanks both for the answer, this is something I seem to have missed in my searches.

it's working now

Any tips of what would be a good tutorial on irc scripting ??

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
The help file is a good place to get started.

/help

There's also some tutorials on these sites:

http://mircscripts.org
http://www.hawkee.com/
http://www.scriptsdb.org

And of course there's code snippets. Just look at other people's code. See how they did things. I find that to be pretty helpful in many cases.

Joined: Mar 2005
Posts: 212
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
the best tutorial is to get in there and get your hands dirty
using the help file as a reference along the way and coming here when you find yourself stuck


Link Copied to Clipboard