mIRC Home    About    Download    Register    News    Help

Print Thread
#48686 11/09/03 09:54 AM
R
red_erik
red_erik
R
Is it possible to make a script that will be run on connect, will check the number of users on a channel, and then join that channel if there are more than 4 users in it? I am connecting to a server in Croatia, and the channel I am planning to use the script on has a stats-bot in it.

thanks!

#48687 11/09/03 10:51 AM
K
killsaids
killsaids
K
I don't see any way of doing this other than by listing the channel u want:
Code:
on *:connect:{
  .list #channelyouwnat
}
raw 322:*:{
  if ($3 > 4) {
    join $2
    halt
  }
}
 

#48688 11/09/03 05:04 PM
Joined: May 2003
Posts: 161
A
Vogon poet
Offline
Vogon poet
A
Joined: May 2003
Posts: 161
That's going to go crazy when you list all channels. You should have it only join when it's the right channel

Code:
on *:connect:{
  .list #channelyouwant
}

raw 322:*:{
  if ($2 == #channelyouwant) && ($me !ison $2) && ($3 > 4) {
    join $2
  }
}

#48689 11/09/03 05:38 PM
R
red_erik
red_erik
R
this may seem a stupid question, but since I'm new to mIRC, it's not stupid for me:
where do I enter the code?

thanks!

#48690 11/09/03 05:48 PM
R
r0ck0
r0ck0
R
ALT+R in your mIRC

#48691 11/09/03 05:58 PM
R
red_erik
red_erik
R
t doesn't work.
I get "ON Unknown command"
I am using mIRC 6.10

#48692 11/09/03 05:59 PM
R
r0ck0
r0ck0
R
well then you have a missing bracket somewhere above it

#48693 11/09/03 08:29 PM
R
red_erik
red_erik
R
a friend suggested this:
#tolkien_newsi is the channel i'll be using the script on

on 1:CONNECT:{
.list #tolkien_newsi
raw 322:*:{
if ($2 == #tolkien_newsi) && ($3 > 4)
/join $2
}
}

#48694 11/09/03 08:32 PM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
Then this "friend" doesn't know his scripting too well. You can't have an event inside an event, and raw events are events. Ashkrynt gave you code that should work. The error you pasted indicates that the code BEFORE Ashkrynt's isn't properly terminated.

#48695 12/09/03 08:47 AM
R
red_erik
red_erik
R
I have copied Askhrynt's code into scripts.ini, but when I connect to the server, it only shows the number of users on the channel, it doesn't join it!

#48696 12/09/03 11:03 AM
O
Om3n
Om3n
O
Make sure that the channel does not have mode +s on. As this would hide it from any /list, therefor failing to trigger the if in Askhrynt's code.


Link Copied to Clipboard