mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
How can I make it so that this script only work in the main channels.. And not in private window with me?

This person who do not even say who he is, found my script, and is in bad need of attention or something, thus he spam me every chance he got.. (He seems to own like 30-50 individual bot's or got freinds 'helping' him..) I ignore them all now, but it might not help in the long run.. And it is so borning to ignore them one by one..

I have done ANYTHING now to see if I could make the spam protect that already is in the script work for the private MSG window to. But, I only mess up the rest of the script..

I got it working again now after messing it up when trying to add the spam protect function to the privat window, but there is probably much unused code in there, as I do not really know much coding..

So forget the spam protect I aksed for in my other post (unless you happen to know how to do it), and just tell me how to disable the private part of the script? So that one HAS to type it in a #channel, to be able to get a quote from me..

Please? smile

Code:

;--------------------------------------------------------------------------------------------------------:

;
; - !Quotescript...
;





on *:text:!quote*:*: {
  if ($level($address($nick,8)) == Quote.Ban) { return }
  else var %who = $nick
  if ($chan) {
    if (!$istok(#narkotika #paranormal #mensa #sirstargazer #quote #quotes #freethought #spiritual #4threich #normal #spirit! #asylum #♥ #astral #br1 #TheSpot #philosophy #philosophy! #Invision #ddayhome #shroomery #spiritualmaterialism #coders #TheTruth #immortal-technique #felles #tv.no #chemistry #filosofi #NanoTechnology #åndelig #ganja #Le·g·ion! #innvikling #Truth #Gudene #shamanism #christian #innsikt #2012 #utvikling #sms.no #tao #rytmeboksen #dreamt #3d_life #archangels #spiritual #ascension #ugdulf #dreaming #spirituality #buddhism #shrooms #psychedelics #spiritual #narkotika #filosofisk #filosofi #åndelighet,$chan,32)) { return }
    var %who = $chan
    if (%quote.delay) {
      .notice $nick Please try again after random delay of: $duration(%quote.delay) - Or use !"commands" in a PM.
      return
    }
    else {
      var %delay = $rand(5,25)
      set -u [ $+ [ %delay ] ] %quote.delay %delay
    }
  }
  if ($2) {

    if (%quote.delay) {
      .notice $nick Please try again after random delay of: $duration(%quote.delay)
      return 
    }
    else {
      var %delay = $rand(5,25)
      set -u [ $+ [ %delay ] ] %quote.delay %delay
    }

    if ($2 !isnum) {
      window -h @quote.search
      loadbuf -r @quote.search quotes.txt
      var %quote.temp $fline(@quote.search,$+(*,$2-,*),0)
      if (%quote.temp isnum 1-20) {
        var %i = 1,%quote.match
        while ($fline(@quote.search,$+(*,$2-,*),%i)) {
          %quote.match = $addtok(%quote.match,$v1,44)
          inc %i
        }
        msg $chan Matches for $2 --> %quote.match
        window -c @quote.search
      }
      elseif (%quote.temp == 0) { msg $chan No match found. }
      else { msg $chan More than 20 matches found, please narrow your search down }
    }
    else {

      if (%quote.delay) {
        .notice $nick Please try again after random delay of: $duration(%quote.delay)
        return 
      }
      else {
        var %delay = $rand(25,55)
        set -u [ $+ [ %delay ] ] %quote.delay %delay
      }


      if ($lines(quotes.txt) < $2) { msg %who Quote $chr(35) $+ $2 doesn't exist. | return }
      msg %who $read(quotes.txt,$2)
    }
  }
  elseif ($1 == !quotes) { msg %who Total quotes: $lines(quotes.txt) }
  else msg %who $read(quotes.txt)
}

on *:text:!addquote*:*: {
  if ($2 == $null) { .notice $nick You need to include a quote to add. }
  if (%quote.delay) {
    .notice $nick Please try again after random delay of: $duration(%quote.delay)
    return 
  }
  else {
    var %delay = $rand(5,25)
    set -u [ $+ [ %delay ] ] %quote.delay %delay
  }
  write quotes.txt $2-
}

menu nicklist {
  !Quote Ban: auser Quote.Ban $address($snick($chan,1),8)
}

on *:input:*: {
  if ($1 == !quote) {
    var %who = $iif($chan,$chan,$me)
    if ($chan) {
      if (!$istok(#narkotika #paranormal #sirstargazer #♥ #freethought #quote #quotes #spiritual #mensa #asylum #4threich #spirit! #normal #astral #br1 #TheSpot #philosophy #philosophy! #Invision #ddayhome #shroomery #spiritualmaterialism #coders #TheTruth #felles #immortal-technique #felles #tv.no #chemistry #filosofi #NanoTechnology #åndelig #ganja #Le·g·ion! #innvikling #Truth #Gudene #shamanism #christian #innsikt #2012 #utvikling #sms.no #tao #rytmeboksen #dreamt #3d_life #archangels #spiritual #ascension #ugdulf #dreaming #spirituality #buddhism #shrooms #psychedelics #spiritual #narkotika #filosofisk #filosofi #åndelighet,$chan,32)) { return }
      if (%quote.delay) {
        echo -a Please try again after $duration(%quote.delay) or use !quote in a PM.
        return
      }
      else {
        var %delay = $rand(3,5)
        set -u [ $+ [ %delay ] ] %quote.delay %delay
      }
    }
    if ($2) {
      if ($2 !isnum) {
        window -h @quote.search
        loadbuf -r @quote.search quotes.txt
        var %quote.temp $fline(@quote.search,$+(*,$2-,*),0)
        if (%quote.temp isnum 1-20) {
          var %i = 1,%quote.match
          while ($fline(@quote.search,$+(*,$2-,*),%i)) {
            %quote.match = $addtok(%quote.match,$v1,44)
            inc %i
          }
          msg $chan Matches for $2 --> %quote.match
          window -c @quote.search
        }
        elseif (%quote.temp == 0) { msg $chan No match found. }
        else { msg $chan More than 20 matches found, please narrow your search down }
      }
      else {
        if ($lines(quotes.txt) < $2) { msg %who Quote $chr(35) $+ $2 doesn't exist. | return }
        msg %who $read(quotes.txt,$2)
      }
    }
    else msg %who $read(quotes.txt)
  }
  elseif ($1 == !quotes) { msg %who Total quotes: $lines(quotes.txt) }
  elseif ($1 == !addquote) {
    if ($2 == $null) { echo -a You need to include a quote to add. }
    else write quotes.txt $2-
  }
}


on *:text:!help:#: { 
  msg $nick Available commands: !quote, !quotes, !quote "number", and !addquote "quote" - Author. And: !quote "word" to search...
}
:-----------------





Last edited by gomp; 18/01/08 08:52 AM.

I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Joined: Jan 2008
Posts: 13
T
Pikka bird
Offline
Pikka bird
T
Joined: Jan 2008
Posts: 13
The location where this event occurs can be specified using:

? for any private message

# for any channel message

#mirc for any messages on channel #mirc

* for any private or channel messages




on 1:TEXT:hello*:#:/msg $chan Welcome to $chan $nick!

This listens on any channel for any line beginning with the word hello and welcomes the user who said it to the channel.




on 1:NOTICE:*:?:/msg $nick I'm AFK, back in a moment!

This listens for any private notice and responds with the message that you're away from the keyboard.



"How can I make it so that this script only work in the main channels.. And not in private window with me?"

So..basically just change the * to the # in order to fix it.


Last edited by tessa1; 18/01/08 09:21 AM.
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
Oh.. But it already works in the channel.. I just ask how to disable the private part. Not how to make the privat part also work in channel. That must breed conflicts, I guess..

I got in contact with the nice person who made it for me though. So it seems I do not need this. But if anyone know, please share how to, just in case.. It is not funny being "spammed offline" by kids.. (At least not when it is my own damn fault, as I asked for the privat part to be limitless, cause I had some silly trust in people. I do not understand what I was thinking..)


I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
The post above yours told you how to fix it.

Change the * to a #.

* means 'from anywhere'
# means 'from channels only'
? means 'from private only'

-genius_at_work

Joined: May 2003
Posts: 41
D
Ameglian cow
Offline
Ameglian cow
D
Joined: May 2003
Posts: 41
Code:
 %who = $target 
or %who = $chan 

Code:
on *:text:!quote*:#: { 


Last edited by Damsulegna; 14/02/08 03:16 PM.

If At First You Don't Succeed, Ask Someone For Help......
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
As a note, this is already solved. I redid part of the script for him on IRC that handled private messages.


Invision Support
#Invision on irc.irchighway.net
Joined: May 2003
Posts: 41
D
Ameglian cow
Offline
Ameglian cow
D
Joined: May 2003
Posts: 41
ok.


If At First You Don't Succeed, Ask Someone For Help......
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
Code:
;--------------------------------------------------------------------------------------------------------:

;
; - !quotes!cript...
;





on *:text:!quote*:*: {
  if ($level($address($nick,8)) == Quote.Ban) { return }
  else var %who = $nick

  if (%quote.delay) {
    .msg $nick Please try again after random delay of: $duration(%quote.delay)
    return 
  }
  else {
    var %delay = $rand(25,35)
    set -u [ $+ [ %delay ] ] %quote.delay %delay
  }



  if ($chan) {
    if (!$istok(#filosofisk #filosofi #åndelighet,$chan,32)) { return }
    var %who = $chan

  }
  if ($2) {
    if ($2 !isnum) {
      window -h @quote.search
      loadbuf -r @quote.search quotes.txt
      var %quote.temp $fline(@quote.search,$+(*,$2-,*),0)
      if (%quote.temp isnum 1-20) {
        var %i = 1,%quote.match
        while ($fline(@quote.search,$+(*,$2-,*),%i)) {
          %quote.match = $addtok(%quote.match,$v1,44)
          inc %i
        }
        msg $chan Matches for $2 --> %quote.match
        window -c @quote.search
      }
      elseif (%quote.temp == 0) { msg $chan No match found. }
      else { msg $chan More than 20 matches found, please narrow your search down }
    }
    else {


      if ($lines(quotes.txt) < $2) { msg %who Quote $chr(35) $+ $2 doesn't exist. | return }
      msg %who $read(quotes.txt,$2)
    }
  }
  elseif ($1 == !quotes) { msg %who Total quotes!: $lines(quotes.txt) }
  else {

    msg %who $read(quotes.txt)
  }
}

on *:text:!addquote*:*: {
  if ($2 == $null) { .notice $nick You need to include a quote to add. }
  if (%quote.delay) {
    .msg $nick Please try again after random delay of: $duration(%quote.delay)
    return 
  }
  else {
    var %delay = $rand(25,35)
    set -u [ $+ [ %delay ] ] %quote.delay %delay
  }
  write quotes.txt $2-
}

menu nicklist {
  !Quote Ban: auser Quote.Ban $address($snick($chan,1),8)
}

on *:input:*: {
  if ($1 == !quote) {
    var %who = $iif($chan,$chan,$me)
    if ($chan) {
      if (!$istok(#filosofisk #filosofi #åndelighet,$chan,32)) { return }

    }
    if ($2) {
      if ($2 !isnum) {
        window -h @quote.search
        loadbuf -r @quote.search quotes.txt
        var %quote.temp $fline(@quote.search,$+(*,$2-,*),0)
        if (%quote.temp isnum 1-20) {
          var %i = 1,%quote.match
          while ($fline(@quote.search,$+(*,$2-,*),%i)) {
            %quote.match = $addtok(%quote.match,$v1,44)
            inc %i
          }
          msg $chan Matches for $2 --> %quote.match
          window -c @quote.search
        }
        elseif (%quote.temp == 0) { msg $chan No match found. }
        else { msg $chan More than 20 matches found, please narrow your search down }
      }
      else {
        if ($lines(quotes.txt) < $2) { msg %who Quote $chr(35) $+ $2 doesn't exist. | return }
        msg %who $read(quotes.txt,$2)
      }
    }
    else {

      msg %who $read(quotes.txt)
    }
  }
  elseif ($1 == !quotes) { msg %who Total quotes!: $lines(quotes.txt) }
  elseif ($1 == !addquote) {
    if ($2 == $null) { echo -a You need to include a quote to add. }
    else write quotes.txt $2-
  }
}


on *:text:!help:#: { 

  if (%quote.delay) {
    .msg $nick Please try again after random delay of: $duration(%quote.delay)
    return 
  }
  else {
    var %delay = $rand(25,35)
    set -u [ $+ [ %delay ] ] %quote.delay %delay
  }

  msg $nick Available commands: !quote, !quotes, !quote "number", and !addquote "quote" - Author. And: !quote "word" to search...
}



:-----------------





Not sure if I need all that, but it works perfectly now!

At least I hope it cannot be abused more. :p It should perhaps be some flood protect on the "please try again after random delay" ...

Is there a simple way to make it only be sent one time, for each user?

Code:
  if (%quote.delay) {
    .msg $nick Please try again after random delay of: $duration(%quote.delay)
    return 
  }
  else {
    var %delay = $rand(25,35)
    set -u [ $+ [ %delay ] ] %quote.delay %delay
  }


...that part I mean.

As it is now, I guess people can do like this:

[16:14:25] <IAmPartOf> !quote
[16:14:25] <Curious> "ONLY the INDIVIDUAL may separate from the/a WHOLE ... "
[16:14:25] <IAmPartOf> !quote
[16:14:26] <Curious> Please try again after random delay of: 30secs
[16:14:26] <IAmPartOf> !quote
[16:14:26] <Curious> Please try again after random delay of: 30secs
[16:14:26] <IAmPartOf> !quote
[16:14:27] <Curious> Please try again after random delay of: 30secs
[16:14:27] <IAmPartOf> !quote
[16:14:27] <Curious> Please try again after random delay of: 30secs
[16:14:27] <IAmPartOf> !quote
[16:14:28] <Curious> Please try again after random delay of: 30secs
[16:14:28] <IAmPartOf> !quote
[16:14:28] <Curious> Please try again after random delay of: 30secs
[16:14:28] <IAmPartOf> !quote
[16:14:29] <Curious> Please try again after random delay of: 30secs
[16:14:29] <IAmPartOf> !quote
[16:14:29] <Curious> Please try again after random delay of: 30secs
[16:14:29] <IAmPartOf> !quote
[16:14:29] <Curious> Please try again after random delay of: 30secs


But, I do not know if that will disconnect me or not..

I shall play around with (!%antiflood) some more. But please help if any of you can think of a simple sulution. smile


I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.

Link Copied to Clipboard