mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#213886 11/07/09 07:27 AM
Joined: Jul 2009
Posts: 3
Self-satisified door
OP Offline
Self-satisified door
Joined: Jul 2009
Posts: 3
Just wondering if someone could post a mass greet script here that will enable me to say Hello to everyone in the nick list of a channel at the same time by using a popup or alias command?

I used to have one, but lost it somewhere.

Thanks.

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Have look into these mIRC Scripts links and search about it click here


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Do you want to
1) say "Hello Nick1, Nick2, Nick3" or
2) greet each nick separately?
And do you want to
a) greet *every* nick or
b) select some nicks to greet in the nicklist (e.g. your friends) and greet only selected nicknames?

Note that while 1) may "only" annoy the users ("mass-highlight" usually isn't well received) 2) is even worse as it can be rated flood. Both may result in a kick or a ban...depending on how large the channel is and how relaxed its rules/OPs are.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Put this in your popups nicklist:
Code:
Greet All:var %x = 1 | while ($nick(#,%x)) { if ($nick(#,%x) != $me) .timer 1 $calc(%x * 2) say Hello $+ , $v1 | inc %x }
Then right click for 'Greet All' to activate the script. There will be a two-second delay in greeting, in case of flooding.

Joined: Jul 2009
Posts: 3
Self-satisified door
OP Offline
Self-satisified door
Joined: Jul 2009
Posts: 3
Hi, sorry for my delayed response here...

What I wanted was an alias prompted script that would do as your example #1, like:

Hello nick1, nick2, nick3, nick4

all on the same line, not separate lines, for everyone in the channel. Two other people in my channel have such a script, however they don't use mirc (the turds) and we cannot figure how to convert their scripts to mirc. And so yes, the ppl and the op's in there don't mind this kind of script being used.

Also need it to leave out my nick (so i dont say hello to myself) and not include the channel name and have it actually post in the channel itself. My feeble attempt to create this script resulted in all of the above.... I know not of what I do.
And if it could possibly leave out the bots in the room, that'd be great, but if not, that's ok.

Thanks again for your assist with this. I tried to hunt down this type of script in various places, but couldn't find any.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
menu nicklist {
  Greet : greet $chan
}
alias -l greet {
  var %a = 1, %b = $nick($1,0), %greet
  while %a <= %b {
    %greet = $addtok(%greet,$nick($1,%a),44)
    inc %a
  }
  %greet = $remtok(%greet,$me,1,44)
  %greet = $replace(%greet,$chr(44),$+($chr(44),$chr(32)))
  .msg $1 Hello %greet
}

For the bots, just add a line like
Code:
%greet = $remtok(%greet,$me,1,44)
replacing $me with the nick of the bot

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
This one's a bit more elaborated, but uses the same method: loop $nick($chan,N) to create a string of nicknames.
You may use the channel-popup or call the command "/greetall" on your own. For the command, you can use either "/greetall <my greet message>" or "/greetall" (to get an input prompt).
Hope the comments are of use... smile

Code:
menu channel {
  -
  $iif(($calc($nick($chan,0) -1)),Greet all $v1 users of $chan)
  ."Hello" : greetall Hello
  ."See you later" : greetall See you later
  .-
  .<other> : greetall
}

alias greetall {
  ; ---- SETUP START ----
  ; add nicks (e.g. of Bots) you want to exclude after "$me" (separated by spaces)
  var %exclude = $me
  ; delay in ms for multiple lines (to prevent flood in case a long greeting / a greeting of many nicks exceeds a line length of aprox. 260 chars)
  var %delay = 500
  ; ---- SETUP END ----

  ; active window is a joined channel
  if ($me ison $active) { 
    ; there are other users in the channel
    if ($calc($nick($active,0) -1)) {

      ; prompt for greet message (if no message provided as parameter of the alias)
      var %t = $v1, %greeting = $$iif(($1- != $null),$v1,$input(Enter greet message:,eog,Greet all %t users of channel $active,Hello))
      ; make sure the tempfile is empty
      write -c greetall.txt

      ; loop all nicknames - build a string of nicknames
      var %n = 1, %nickstring
      while ($nick($active,%n)) {
        var %nick = $v1
        ; don't greet yourself or nicknames specified above
        if (!$istok(%exclude,%nick,32)) {
          ; add this nickname to the string
          var %nickstring = %nickstring %nick
          ; greeting+string reached a certain length (avoid a too long line)
          if ($len(%greeting %nickstring) > 250) { 
            ; write this line to the tempfile "greetall.txt", the line will be "greet message" + "formatted string of nicks"
            ; formatting: insert 1) "and" as second-last word and 2) commas after nicknames, up to the second-last nickname
            write greetall.txt %greeting $+ $chr(15) $iif(($numtok(%nickstring,32) == 1),%nickstring, $&
              $replace($gettok(%nickstring,1--2,32),$chr(32),$+($chr(44),$chr(32))) and $gettok(%nickstring,-1,32))
            ; clear string
            var %nickstring
          }
        }
        inc %n
      }

      ;  if nicks are left in the string: write line to tempfile
      if (%nickstring) {
        write greetall.txt %greeting $+ $chr(15) $iif(($numtok(%nickstring,32) == 1),%nickstring, $&
          $replace($gettok(%nickstring,1--2,32),$chr(32),$+($chr(44),$chr(32))) and $gettok(%nickstring,-1,32))
      }

      ; play tempfile (send greetings to the channel) and remove it
      .play -p $active greetall.txt $iif((%delay isnum 0-),$int($v1),500)
      .remove greetall.txt
    }

    ; there are no other users in the channel
    else { echo -agc info * /greetall: Taking care of yourself? o_O }
  }
  ; active window is no joined channel
  else { echo -agc info * /greetall: Cannot greet here ( $+ $active is not a joined channel) }
}

Last edited by Horstl; 07/08/09 04:13 AM.
Joined: Nov 2003
Posts: 102
T
Vogon poet
Offline
Vogon poet
T
Joined: Nov 2003
Posts: 102
this dont really seem to work that well for me. Says hello to two random users and thats all it seems to do ?


Rock and Metal Music videos ON DEMAND!
<<<<<< http://www.tormented.tv >>>>>>
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
I'm not able to reproduce your issue... confused works for me like expected.
Maybe something got lost on your side in copy-pasting of the code?

Joined: Nov 2003
Posts: 102
T
Vogon poet
Offline
Vogon poet
T
Joined: Nov 2003
Posts: 102
I did copied it 2 times and still have the same outcome...idk if it could be a server side issue or not. Sexnet is kinda weird with the chanserv name being sexgod and stuff like that. But when i enter a room with say 8 users and go to the menu and select say hello or goodbye to all 8 users it does this.

[5:38pm] heh (~Whatever@horny-5AF0AC0C.res-cmts.snh.ptd.net) has joined. «10 people»
[5:38pm] <@R2Dildo> hi heh
[5:40pm] heh (~Whatever@horny-5AF0AC0C.res-cmts.snh.ptd.net) has parted. «9 people»
[7:52pm] <ToRmEnTeD> See you later KooKyGuY and SPunKBubble
[7:55pm] <ToRmEnTeD> .


This shows it not saying hello to R2dildo ..but there was 6 other users it skipped also so idk?


Rock and Metal Music videos ON DEMAND!
<<<<<< http://www.tormented.tv >>>>>>
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Sometimes it's better to go with a simpler script, like the one I posted, rather than a complex script, like Horstl's.

If you find that my simple script works for you, we can work on adding stuff to it later.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I like the idea of simplicity in scripting. Keep it simple; life is complicated enough.

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Sorry, but did you other posters test the script at least?

Yes, it is a bit more lengthy:
- half of it is comments, to help the OP understanding the code
- it contains some additional checks to prevent possible common sources of error, like: "invalid window", "channel not joined", "not connected", "no other users in channel"
- it prevents the common "line too long" error, by splitting long greetings (in channels with lot of nicknames) to multiple lines
- as multiple lines may be thrown, it goes for /play with a delay, to prevent possible flooding. /play further has (in comparison to timers which often aren't used properly) the advantages of showing no multiple "no such target" errors (e.g. in case of a part/kick while playing) and adding no evaluation to the output text (i.e. of a custom greet message).
As the only "cosmetical" part, it's inserting "and" as second-last word (for greetings of more than one nick) with plain token means. Just to give the mechanical act of mass-greeting a wee bit of human touch...

The script itself is neither *complex* in structure, nor "bloated" nor uses *fancy* commands/methods for the task. Debugging shouldn't be hard. I don't find a bug (an antique mIRC version or overridden internal commands could be a source of error - but you cannot blame the code for that) - be my guest to find the problem. But please don't blame the "complexity" of a script if it's complexity is for the sake of prevention of errors.

For my part and out of curiosity, I even tested it successfully on the network mentioned by ToRmEnTeD (v6.35 and v6.31).

@ToRmEnTeD:
Do all nicks on the channel show if you insert after the line:
Code:
var %nick = $v1
the additional line:
Code:
echo -ag * greetall: looping nick no. %n of $active = %nick
?

Joined: Nov 2003
Posts: 102
T
Vogon poet
Offline
Vogon poet
T
Joined: Nov 2003
Posts: 102
I hope you didnt think that i was bitching about it not working. I was just having issues with it and the comments had paused so i figured i would keep it going. Seemed like a script i could use and wanted to see if it worked or if it was something on my end.
Horstl, I added the line that you asked about. It did do things a bit different but yet again it still only gives me two of the nicks.

Code:


> Successfully joined #sex on Saturday at 11:25am
[11:25am] * Topic is '©º°¨¨°º©©º°¨¨°º© Come in and join the #sex party! ©º°¨¨°º©©º°¨¨°º©)'
[11:25am] * Set by KooKyGuY on Tue Mar 17 18:30:56
> Channel Modes: +ntr
> Created on Thursday, July 2nd, 2009 at 2:04pm
* greetall: looping nick no. 1 of #sex = KooKyGuY
* greetall: looping nick no. 2 of #sex = Dave32-UK
* greetall: looping nick no. 3 of #sex = HighHeels
* greetall: looping nick no. 4 of #sex = iRiS
* greetall: looping nick no. 5 of #sex = ItalianStallion
* greetall: looping nick no. 6 of #sex = Na_Cl
* greetall: looping nick no. 7 of #sex = NiteHawk
* greetall: looping nick no. 8 of #sex = ToRmEnTeD
* greetall: looping nick no. 9 of #sex = ZeeMaN
[11:25am] <ToRmEnTeD> Hello KooKyGuY and ZeeMaN
[11:25am] <HighHeels> hi
[11:25am] <HighHeels> 26 f usa
[11:26am] HighHeels «~kylmor@horny-CF3206E8.nap.wideopenwest.com» has Quit iRC (Nice ass! HighHeels) «8 people»
[11:29am] Mr_Cute (~yumyum@D1FB578F.5B64AB1.A3E2A962.IP) has joined. «9 people»

 


Im not going to claim to understand what it did first with the looping but i dont think during that process anyone was sent a greet. It seems it just collected nicks ? idk


Rock and Metal Music videos ON DEMAND!
<<<<<< http://www.tormented.tv >>>>>>
Joined: Nov 2003
Posts: 102
T
Vogon poet
Offline
Vogon poet
T
Joined: Nov 2003
Posts: 102
btw ..figured i would add this in.
I am using INVISION with mIRC v6.3


Code:
 


&ToRmEnTeD is running —I-n-v-i-s-i-o-n— 3.1 (December '08) with Advanced File Serving features by cRYOa on mIRC v6.3 32bit obtained from #Invision on irc.irchighway.net and http://www.i-n-v-i-s-i-o-n.com



Rock and Metal Music videos ON DEMAND!
<<<<<< http://www.tormented.tv >>>>>>
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Weird... well - some remote debugging then. Please try the following "verbose" version of the greetall alias - what's your output?
Code:
alias greetall {
  ECHO -ag * GREETALL $1-
  var %exclude = $me
  var %delay = 500
  if ($me ison $active) { 
    if ($calc($nick($active,0) -1)) {
      var %t = $v1, %greeting = $$iif(($1- != $null),$v1,$input(Enter greet message:,eog,Greet all %t users of channel $active,Hello))
      write -c greetall.txt
      ECHO -ag * file created: $isfile(greetall.txt) lines: $lines(greetall.txt)
      var %n = 1, %nickstring
      while ($nick($active,%n)) {
        var %nick = $v1
        ECHO 7 -ag * loop: nick no. %n in $active is %nick
        if (!$istok(%exclude,%nick,32)) {
          var %nickstring = %nickstring %nick
          ECHO -ag * (not excluded) nickstring is now: %nickstring
          if ($len(%greeting %nickstring) > 250) { 
            ECHO 9 -ag * write (len reached): %greeting $+ $chr(15) $iif(($numtok(%nickstring,32) == 1),%nickstring, $&
              $replace($gettok(%nickstring,1--2,32),$chr(32),$+($chr(44),$chr(32))) and $gettok(%nickstring,-1,32))
            write greetall.txt %greeting $+ $chr(15) $iif(($numtok(%nickstring,32) == 1),%nickstring, $&
              $replace($gettok(%nickstring,1--2,32),$chr(32),$+($chr(44),$chr(32))) and $gettok(%nickstring,-1,32))
            ECHO 9 -ag * read of last line: $read(greetall.txt,n,$lines(greetall.txt))
            var %nickstring
          }
        }
        inc %n
      }
      if (%nickstring) {
        ECHO 9 -ag * write (final line): %greeting $+ $chr(15) $iif(($numtok(%nickstring,32) == 1),%nickstring, $&
          $replace($gettok(%nickstring,1--2,32),$chr(32),$+($chr(44),$chr(32))) and $gettok(%nickstring,-1,32))
        write greetall.txt %greeting $+ $chr(15) $iif(($numtok(%nickstring,32) == 1),%nickstring, $&
          $replace($gettok(%nickstring,1--2,32),$chr(32),$+($chr(44),$chr(32))) and $gettok(%nickstring,-1,32))
        ECHO 9 -ag * read of last line: $read(greetall.txt,n,$lines(greetall.txt))
      }
      ECHO -ag * playing file of $lines(greetall.txt) lines to $active ...
      play -p $active greetall.txt $iif((%delay isnum 0-),$int($v1),500)
      remove greetall.txt
    }
    else { echo -agc info * /greetall: Taking care of yourself? o_O }
  }
  else { echo -agc info * /greetall: Cannot greet here ( $+ $active is not a joined channel) }
}

Joined: Nov 2003
Posts: 102
T
Vogon poet
Offline
Vogon poet
T
Joined: Nov 2003
Posts: 102
Ok do i load that one the same as the other cause i have nothing when i load it. i dont see the menu or anything anymore?


Rock and Metal Music videos ON DEMAND!
<<<<<< http://www.tormented.tv >>>>>>
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
It's a temporary replacement for the current "greetall"-alias, it uses the same menu. Either
- replace the old alias in your file with this one
- create a new file with the new alias, copy the old menu into it, then unload the old file
- add the new alias to the existing file and put the old alias in /* [...] */ quotes (or rename the old alias)

As this one's for testing only, you also could test it without menu by e.g.: /greetall Hello

Joined: Nov 2003
Posts: 102
T
Vogon poet
Offline
Vogon poet
T
Joined: Nov 2003
Posts: 102
Yea i was still a little confused as to what that was but when it was loaded i was able to do the
/greetall Hello command and got the folowing results


Code:
 


[5:04pm] *TRiViA^* Use !help to see trivia commands
[5:04pm] <&TRiViA^>  ToRmEnTeD was the  40  person to join  #fuckmehard
* GREETALL Hello
* file created: $true lines: 0
* loop: nick no. 1 in #fuckmehard is Joyce
* (not excluded) nickstring is now: Joyce
* loop: nick no. 2 in #fuckmehard is Michelle
* (not excluded) nickstring is now: Joyce Michelle
* loop: nick no. 3 in #fuckmehard is sophie
* (not excluded) nickstring is now: Joyce Michelle sophie
* loop: nick no. 4 in #fuckmehard is TRiViA^
* (not excluded) nickstring is now: Joyce Michelle sophie TRiViA^
* loop: nick no. 5 in #fuckmehard is sPeRmBaNk
* (not excluded) nickstring is now: Joyce Michelle sophie TRiViA^ sPeRmBaNk
* loop: nick no. 6 in #fuckmehard is AssLover
* (not excluded) nickstring is now: Joyce Michelle sophie TRiViA^ sPeRmBaNk AssLover
* loop: nick no. 7 in #fuckmehard is SlfDstrct
* (not excluded) nickstring is now: Joyce Michelle sophie TRiViA^ sPeRmBaNk AssLover SlfDstrct
* loop: nick no. 8 in #fuckmehard is Sniper-XXX
* (not excluded) nickstring is now: Joyce Michelle sophie TRiViA^ sPeRmBaNk AssLover SlfDstrct Sniper-XXX
* loop: nick no. 9 in #fuckmehard is ToRmEnTeD
* write (final line): Hello Joyce and Sniper-XXX
* read of last line: Hello Joyce and Sniper-XXX
* playing file of 1 lines to #fuckmehard ...
* Playing 'greetall.txt' to #fuckmehard with 500ms delay
* Removed 'C:\Invision\greetall.txt'
[5:04pm] <ToRmEnTeD> Hello Joyce and Sniper-XXX
* Playback of 'greetall.txt' complete





Rock and Metal Music videos ON DEMAND!
<<<<<< http://www.tormented.tv >>>>>>
Joined: Nov 2003
Posts: 102
T
Vogon poet
Offline
Vogon poet
T
Joined: Nov 2003
Posts: 102
lol sry about the room names...this network is slim pickin on normal shit


Rock and Metal Music videos ON DEMAND!
<<<<<< http://www.tormented.tv >>>>>>
Page 1 of 2 1 2

Link Copied to Clipboard