mIRC Home    About    Download    Register    News    Help

Print Thread
#217820 23/01/10 01:56 AM
J
jrollins
jrollins
J
I havent written a script in a very long time and completely forget how to do it.

What i want to do is have a script that makes that whenever someone types "!topic" a random topic(word) is generated and posted in the channel. if anyone could help that would be wonderful

#217823 23/01/10 02:02 AM
G
gooshie
gooshie
G
Code:
on @*:TEXT:!topic:#:topic # $read(topic.txt)


Put a topic.txt plain text file with one topic per line into mIRC root directory and it will be accessible through help text files menu.

#217825 23/01/10 02:04 AM
Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
I would use the 'n' switch with $read so it doesn't try to evaluate dollars ($) or variables (%) in the text.

Code:
on @*:TEXT:!topic:#:topic # $read(topic.txt,n)

#217826 23/01/10 02:06 AM
J
jrollins
jrollins
J
if i remember right it goes in remote right?

hixxy #217830 23/01/10 02:14 AM
G
gooshie
gooshie
G
Maybe he wants to evaluate them as in "welcome to $chan today we are discussing how rarely people actually create random topic files that would create a problem"

#217832 23/01/10 02:18 AM
Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
Well that's up to him, he has both versions now! laugh

#217838 23/01/10 02:30 AM
J
jrollins
jrollins
J
it goes in the remote section right?

i tried in remote and user and it doesnt work

#217846 23/01/10 03:54 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Yes it goes in the remotes section
The code also requires the client that is running the code to have full ops in the channel.
Also, as it uses an ON TEXT event, you cannot initiate the code from the client on which it is installed.

Also make sure that the text file is named correctly and is in the correct directory. You can find out which directory it's supposed to be in by typing //echo -a $mircdir

RusselB #217866 24/01/10 12:43 AM
Joined: Jul 2006
Posts: 4,022
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,022
Quote:
Also, as it uses an ON TEXT event, you cannot initiate the code from the client on which it is installed.
More precisely, on text event can be triggered with the same client, either from the same connexion if it let you trigger in query, or simply with another connexion


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard