mIRC Homepage

On text message channel/user?

Posted By: Aragonfire

On text message channel/user? - 27/05/07 05:29 PM

Anyone can make a script for me.
I want the script do list something for me, for example

When you write

!rules
I will auto post the rules when requested.

Like this bot,

Quote:
<Aragonfire> .top10
-owtb- Top10(words): 1. angelx(262300) 2. xBaMx(126738) 3. dev(123779) 4. Cokemon(77976) 5. NLdopeyNL2(69649) 6. Akhkharu(55445) 7. QuE4DoN(53376) 8. TehDef(50225) 9. Vect0r(49964) 10. Nooblettacct(43348)


I want my script to list a list of rules or other stuff.

If you didn't fully understand this thread, please post smile

Thanks in advance.
Aragonfire
Posted By: Riamus2

Re: On text message channel/user? - 27/05/07 05:41 PM

Rules are easy to do. You can do them one of these ways:

/help on text

Code:
on *:text:!rules:#yourchannel: {
  msg $nick Rules are....
  msg $nick More rules are....
}


Or:
Code:
on *:text:!rules:#yourchannel: {
  dcc send $nick rules.txt
}


Change #yourchannel to the name of the channel you want this to work in. For multiple channels, use commas to separate them: #chan1,#chan2,#chan3

The first one will message the person with the rules. The second one will send the rules to the person as a text file if you have a file in your mIRC folder called rules.txt. Note that the second way allows you to send more text more easily, but the person requesting the rules needs to be able to download files and not everyone can do that. For the first one, you can just use a single /msg line, or two as shown, or more... whatever is needed. Just remember that too many /msg lines can cause you to be kicked off of the server due to "excess flood." Usually, that's somewhere around 5 lines per second.
Posted By: Aragonfire

Re: On text message channel/user? - 27/05/07 06:03 PM

Hmm... I tried the first one, and it worked.

But the thing is that I want the rules/list to be shown in the channel window, but not people in the channel can actually see it.

Like when you notice a channel.

You say the command, and the script says the rules to you, in the channel.

Picture:
http://img22.imagevenue.com/img.php?image=88925_asd_122_707lo.jpg
Posted By: RusselB

Re: On text message channel/user? - 27/05/07 06:05 PM

Use the first script, and change msg to notice
Posted By: Aragonfire

Re: On text message channel/user? - 27/05/07 06:19 PM

Oh yeah, it worked.

And I just talked with some of my friends, they said that if I add a long list, but just doesn't get flooded out, what if someone abuses it? :P

Soo my second request is, if anyone can make a kick/time ban script that if you abuse this command more then once/twice within x seconds, you get timed ban/kick.
Posted By: RusselB

Re: On text message channel/user? - 27/05/07 06:53 PM

There are a number of Flood Protection scripts already done.
Use the Search feature, and also check through Google
Posted By: Aragonfire

Re: On text message channel/user? - 27/05/07 07:12 PM

Ah, okey.

Thanks alot for the help!
Posted By: Riamus2

Re: On text message channel/user? - 27/05/07 11:26 PM

If you just want to avoid being flooded off without worrying about banning anyone automatically, you can just do this:

Code:
on *:text:!rules:#yourchannel: {
  if ($+(%,rules.timer,$nick)) { return }
  notice $nick Rules are....
  notice $nick More rules are....
  set -u60 %rules.timer $+ $nick On
}


Basically, that will only respond to each person once every 60 seconds. You can adjust the 60 if you want. Note that you could still be flooded if multiple people use it at the same time, but that probably isn't going to happen. If you are really concerned about that happening, you may want to think about just sending a rules.txt file instead.
Posted By: RusselB

Re: On text message channel/user? - 27/05/07 11:59 PM

The method that I use, is use the /play command. I've had up to 20 people request at the same time (well, within 60 seconds) and it hasn't had any problems.
Posted By: Riamus2

Re: On text message channel/user? - 28/05/07 12:07 AM

Yeah, that's another good way to do it, though it does lead to possibly sending the same thing to the same person multiple times (if someone tries to get it and it doesn't start right away because it's queued, he/she may try again, which would result in sending the same thing to the person multiple times unnecessarily). Still, there really isn't a perfect method as each method has minor flaws...
  • DCC Sending a file -- some people may not be able to download it
  • Msg/Notice text with the flood timer -- Limit on the amount that can be sent
  • Playing a file to the person -- Possibility of playing it multiple times to the same person


With enough scripting, you can bypass many of those issues, of course.
Posted By: Aragonfire

Re: On text message channel/user? - 28/05/07 11:29 AM

Hmm.. I tried the timer script, and it worked perfectly, but a problem is that.

My script isn't based on rules. It's based on a list that goes alphabeticly:

Here's a little of my list script of animes.

Quote:
on *:text:!listA:#anime-eden: {
notice $nick Ah! My Goddess (Completed)
notice $nick Ah! My Goddess: Sorezore No Tsubasa (Completed)
notice $nick Ai Yori Aoshi (Completed)
notice $nick Ai Yori Aoshi ~Enishi~ (Completed)
notice $nick Air (Completed)
notice $nick Air Gear (Completed)
notice $nick Air Master (Completed)
notice $nick Aishiteruze Baby (Completed)
notice $nick Angel Sanctuary (Completed)
notice $nick Appleseed (Completed)
notice $nick Asatte no Houkou (Completed)
notice $nick Ayashi no Ceres (Completed)
notice $nick Azumanga Daioh (Completed)
}


Quote:
on *:text:!listB:#anime-eden: {
notice $nick Bakumatsu Kikansetsu Irohanihoheto (Completed)
notice $nick Basilisk (Completed)
notice $nick Beck (Completed)
notice $nick Beet The Vandel Buster (Completed)
notice $nick Beet The Vandel Buster Excellion (Ongoing)
notice $nick Black Blood Brothers (Completed)
notice $nick Black Cat (Completed)
notice $nick Black Jack 21 (Completed)
notice $nick Black Lagoon (Completed)
notice $nick Bleach (Ongoing)
notice $nick Blood+ (Completed)
notice $nick Blue Dragon (Ongoing)
notice $nick Boogiepop Phantom (Ongoing)
}


And soo on, the list goes alphabeticly, and if I want to put a timer on, I have to put the timer on each and every letter?
But yet, that doesn't work if you write !lista and !listb, because those are two different letters.
Posted By: chiram

Re: On text message channel/user? - 28/05/07 12:16 PM

to be lazy and quote 2 scripts at once..
Code:
on *:text:!list?:#anime-eden: {

  if ($+(%,rules.timer,$nick)) { return }
  set -u60 %rules.timer $+ $nick On

  if ($1 == !listA) {
    notice $nick Ah! My Goddess (Completed)
    notice $nick Ah! My Goddess: Sorezore No Tsubasa (Completed)
  }

  elseif ($1 == !listb) {
    notice $nick Bakumatsu Kikansetsu Irohanihoheto (Completed)
    notice $nick Basilisk (Completed)
  }

}
Posted By: Riamus2

Re: On text message channel/user? - 28/05/07 02:57 PM

You didn't say that in your original post. You specifically asked for displaying rules. If you request help on something, please provide accurate details of what you want or it will waste everyone's time.

Code:
on *:text:!list*:#yourchannel: {
  if ($exists($+(lists\,$right($1,-1),.txt))) {
    .play -nm1 $nick $+(lists\,$right($1,-1),.txt) 1000
  }
  else {
    if ($+(%,rules.timer,$nick)) { return }
    .notice $nick No such list.  Wait for 10 seconds and try again.
    set -u10 %rules.timer $+ $nick On
  }
}


Change the channel to match what you want. Then, create a folder in mIRC's folder called "lists" (no quotes). Inside that folder, create text files (using notepad) that include all of the information you want to show. Label the files like this:

lista.txt
listb.txt
listc.txt

Etc. (You can use capitals if you want to, such as ListA.txt)

Note that this will slowly notice the person with everything inside the file. If the user types !lista, it will show them lista.txt. If the user types !listfun, it will show them listfun.txt, if it exists. Etc.

If the file doesn't exist, it will tell the user to wait 10 seconds and try again. This will help to prevent any chance of being flooded off by people just requesting a fake file multiple times.
Posted By: RusselB

Re: On text message channel/user? - 28/05/07 04:18 PM

Alternatively they could use the -t switch using topics in the txt file.
Quote:
[A]
Ah! My Goddess (Completed)
Ah! My Goddess: Sorezore No Tsubasa (Completed)
Ai Yori Aoshi (Completed)
Ai Yori Aoshi ~Enishi~ (Completed)
Air (Completed)
Air Gear (Completed)
Air Master (Completed)
Aishiteruze Baby (Completed)
Angel Sanctuary (Completed)
Appleseed (Completed)
Asatte no Houkou (Completed)
Ayashi no Ceres (Completed)
Azumanga Daioh (Completed)
[B]
Bakumatsu Kikansetsu Irohanihoheto (Completed)
Basilisk (Completed)
Beck (Completed)
Beet The Vandel Buster (Completed)
Beet The Vandel Buster Excellion (Ongoing)
Black Blood Brothers (Completed)
Black Cat (Completed)
Black Jack 21 (Completed)
Black Lagoon (Completed)
Bleach (Ongoing)
Blood+ (Completed)
Blue Dragon (Ongoing)
Boogiepop Phantom (Ongoing)

Code:
on *:text:!list?:#yourchannel:{
  if ($+(%,rules.timer,$nick)) { return }
  .play -nm1t $+ $2 $nick lists\list.txt
  set -u10 %rules.timer $+ $nick On
}


NOTE: I don't know what will happen if someone requests a topic that doesn't exist in the list, but you can make empty topics by specifying the topic name, then the next topic name, since topics only play per the specified topic.
Posted By: Bekar

Re: On text message channel/user? - 28/05/07 09:21 PM

You could use $ini() to check for them..
Posted By: RusselB

Re: On text message channel/user? - 28/05/07 10:47 PM

I thought of that, but when I tested it, it didn't work, so I'm guessing that it's because the file is in text format, rather than ini format.

Either that or I screwed up my test.
Posted By: Bekar

Re: On text message channel/user? - 28/05/07 11:32 PM

To expand upon your code..
Code:
on *:text:!list?:#yourchannel:{
  var %file = lists\list.txt
  if ($+(%,rules.timer,$nick)) { return }
  if ($ini(%file, $2)) {
    .play -nm1t $+ $2 $nick %file
    set -u10 %rules.timer $+ $nick On
  }
}

Although this example won't take the format '!listA', but '!list A'..
Posted By: deegee

Re: On text message channel/user? - 29/05/07 04:25 PM

Originally Posted By: Bekar
To expand upon your code..

Although this example won't take the format '!listA', but '!list A'..

This will trigger on !lista, !listb, etc
Code:
on *:text:!list?:#yourchannel:{
  var %file = lists\list.txt,%2 = $right($1,1)
  if ($+(%,rules.timer,$nick)) { return }
  if ($ini(%file,%2)) {
    .play -nm1t $+ %2 $nick %file
    inc -u10 %rules.timer $+ $nick
  }
}
Posted By: deegee

Re: On text message channel/user? - 29/05/07 04:29 PM

Originally Posted By: RusselB
NOTE: I don't know what will happen if someone requests a topic that doesn't exist in the list...

You'll get a "topic not found in file" error and the script will halt smile
© 2021 mIRC Discussion Forums