mIRC Home    About    Download    Register    News    Help

Print Thread
#150224 30/05/06 02:00 PM
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
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 ..."

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
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.


$maybe
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
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.

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
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.


$maybe
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
I want that message when there is a mass part. (Part with 2 or more in 5 secs)

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
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


$maybe
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
doh! to right, unless of course your trying to catch ya self flood /HOPing the channel :-)


Link Copied to Clipboard