mIRC Homepage

Invite - welcome message

Posted By: Vinniej

Invite - welcome message - 30/05/06 02:00 PM

Hi,

I'm building a rip-off of the fishbot on Qnet for my own network in msl. Now I got one problem. It saves the nick who requested, but I can't let it see.

Code:
on *:invite:*: {
  if (%invitebot == on) { join $chan | set %invite $+ [ $chan ] $nick | describe $chan greets %invite $+ [ $chan ] }
  elseif (%invitebot == off) { notice $nick Sorry, but invite is currently off. }
}
  


What is wrong by "describe $chan greets %invite ..."
Posted By: Mpdreamz

Re: Invite - welcome message - 30/05/06 02:28 PM

Code:
on *:invite:*: {
  if (%invitebot == on) { join $chan | set $+(%,invite,$chan) $nick | describe $chan greets $($+(%,invite,$chan),2) }
  elseif (%invitebot == off) { notice $nick Sorry, but invite is currently off. }
}

I always find using $+ for dynamic vars is less of a headache and easier to quickly type out.
Posted By: Vinniej

Re: Invite - welcome message - 30/05/06 03:02 PM

Quote:
Code:
on *:invite:*: {
  if (%invitebot == on) { join $chan | set $+(%,invite,$chan) $nick | describe $chan greets $($+(%,invite,$chan),2) }
  elseif (%invitebot == off) { notice $nick Sorry, but invite is currently off. }
}

I always find using $+ for dynamic vars is less of a headache and easier to quickly type out.
Dank! smile

My next problem:

Code:
on *:part:#: {
  inc $+(%,partcount,$chan)
  timer2 1 5 unset $+(%,partcount,$chan)
  if ($($+(%,invite,$chan),2) > 2) { msg $chan ffs you let them get away!! >:( }
}  


It msg's more then once. Every one who parts, gets a msg "ffs you let them get away!! >:(". It only needs to be msg'd once.
Posted By: Mpdreamz

Re: Invite - welcome message - 30/05/06 04:39 PM

Code:
on me:^*:part:#: {
  inc $+(%,partcount,$chan)
  .timer2 1 5 unset $+(%,partcount,$chan)
  if ($($+(%,invite,$chan),2) > 2) { msg $chan ffs you let them get away!! >:( }
}


you can use on me:*:<EVENT> to trigger events ONLY when you trigger them. I also silenced the timer command by prefixing it with a dot. Seeing those Timer started & Timer halted will get quite annoying smile i also used ^* as the level, the ^ makes it do whatever commands you put before the commands mIRC does internally.
Posted By: Vinniej

Re: Invite - welcome message - 30/05/06 06:30 PM

I want that message when there is a mass part. (Part with 2 or more in 5 secs)
Posted By: DaveC

Re: Invite - welcome message - 31/05/06 05:59 AM

Code:
on me:^*:part:#: {
  inc $+(%,partcount,$chan)
  .timer.unset.partcount. $+ $chan 1 5 unset $+(%,partcount,$chan)
  if ($($+(%,partcount,$chan),2) == 2) { msg $chan ffs you let them get away!! &gt;:( }
}


* i replaced the timer name "2" with a real timer name, since using numbers is thundermentally wrong.
* i corrected the var used in the IF to be %partcount$chan

By only displaying on == 2 it well display once on second part in 5 seconds only.
Posted By: Mpdreamz

Re: Invite - welcome message - 31/05/06 07:38 AM

Code:
on *:part:#: {
  inc $+(%,partcount,$chan)
  .timer.unset.partcount. $+ $chan 1 5 unset $+(%,partcount,$chan)
  if ($($+(%,partcount,$chan),2) == 2) { msg $chan ffs you let them get away!! &gt;:( }
}


the me:^ wasnt needed either :P
Posted By: DaveC

Re: Invite - welcome message - 31/05/06 08:36 AM

doh! to right, unless of course your trying to catch ya self flood /HOPing the channel :-)
© 2021 mIRC Discussion Forums