mIRC Home    About    Download    Register    News    Help

Print Thread
#272675 08/06/24 05:14 AM
Joined: Jun 2024
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Jun 2024
Posts: 2
I looked through the forums and saw a few but could never get them to work right. I'm looking for a simple script where, when the user types !rules in the channel the bot sends them a private message with the rules. I do have the rules in a rules.txt from trying other script commands I seen in the forums but all the other scripts give me errors. please someone help, big bada boom.

Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
I have created for you the simplest, small script that should do what you ask.

Try using this script code:
Code
on *:TEXT:!rules:#: unset %num_line | rules $nick

alias -l pathfile { return rules.txt }
alias -l delaymsg { return 1500 }

alias -l rules {
  inc %num_line | var %str $read($pathfile,nt,%num_line)
  if (%str == $null) var %str $chr(160) | .msg $1 %str
  if (%num_line >= $lines($pathfile)) { return }
  .timerRULES -m 1 $delaymsg rules $1
}

In the alias "pathfile" you can specify your path to the file with the channel rules.
In the alias "delaymsg" you can specify a delay time in milliseconds for sending messages, to prevent flooding.


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #272678 08/06/24 10:32 PM
Joined: Jun 2024
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Jun 2024
Posts: 2
It worked PERFECTLY thanks

Joined: Nov 2021
Posts: 115
Vogon poet
Offline
Vogon poet
Joined: Nov 2021
Posts: 115
you could also have the rules on a website and have the url in the topic.

Joined: Dec 2011
Posts: 19
J
Pikka bird
Offline
Pikka bird
J
Joined: Dec 2011
Posts: 19
mIRC includes a /play command which plays a text file line by line.

Code
   on *:TEXT:!rules:#: play -n $nick rules.txt 1200

-n = send /notice instead of /msg
1200 = 1200 ms delay (to avoid flooding)

You can find the /play command in the help file.


Link Copied to Clipboard