mIRC Home    About    Download    Register    News    Help

Print Thread
#217820 23/01/10 01:56 AM
Joined: Jan 2010
Posts: 3
J
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Jan 2010
Posts: 3
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

jrollins #217823 23/01/10 02:02 AM
Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
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.

gooshie #217825 23/01/10 02:04 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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)

gooshie #217826 23/01/10 02:06 AM
Joined: Jan 2010
Posts: 3
J
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Jan 2010
Posts: 3
if i remember right it goes in remote right?

hixxy #217830 23/01/10 02:14 AM
Joined: Nov 2009
Posts: 117
Vogon poet
Offline
Vogon poet
Joined: Nov 2009
Posts: 117
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"

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

gooshie #217838 23/01/10 02:30 AM
Joined: Jan 2010
Posts: 3
J
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Jan 2010
Posts: 3
it goes in the remote section right?

i tried in remote and user and it doesnt work

jrollins #217846 23/01/10 03:54 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
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