mIRC Home    About    Download    Register    News    Help

Print Thread
#163170 27/10/06 12:23 AM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
I am having trouble with this if someone can advise and show me where i am going wrong it will be much appreciated

Code:
 /allchans {
  var %i = 1
  while (%i <= $chan(0)) {
    if ($me !isop $chan(%i)) {
      os mode $chan(%i) +o $me | mode $chan(%i) + $+ $1
    }
    inc %i
  }
}
 


it just keeps on crashing


Newbie
#163171 27/10/06 01:13 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You are usiing a valid entry for $1, I hope. If not, then that might be your problem.

Since you've done such a good job on this, I'm going to presume that you know it has to go in the Aliases section as is, or Remotes changing /allchans { to alias allchans {

#163172 27/10/06 01:25 AM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi
Yes its in my aliases section and i am using a valid entry. It just crashes my client though and i always have to Ctrl + break out of it i have no idea what maybe causing it.


Newbie
#163173 27/10/06 01:31 AM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
hi
I realised my mistake i was doing /allchans +i when i should have been doing /allchans i as i put a + in my script already.
I still have a problem though its only doing one channel and not all the channels that i am in.


Newbie
#163174 27/10/06 02:01 AM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
If i take away the IF statement it works. But i see no reason why i should have to do that. can anyone shed any light on this for me?


Newbie
#163175 27/10/06 02:45 AM
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
You have both actions set for chans where you are not opped, is that what you want?
Code:
allchans {
  var %i = 1
  while ($chan(%i)) {
    if ($me !isop $v1) { os mode $v2 +o $me | mode $v2 + $+ $1 }
    inc %i
  }
}

Or for the mode change to act on all chans
Code:
allchans {
  var %i = 1
  while ($chan(%i)) {
    if ($me !isop $v1) { os mode $v2 +o $me }
    mode $v2 + $+ $1
    inc %i
  }
}

#163176 27/10/06 12:17 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
deegee thanks for that. Its still not working. When i am not opped it ops me on all channels but does the mode setting on only ONE channel


Newbie
#163177 27/10/06 06:47 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
mirc itsels has a nice thing called perform you can set all kinds of settings there.
Just put a op command inthere with every channel you have op acces to.

#163178 27/10/06 07:50 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I think this will work for you
Code:
allchans {
  var %i = 1
  var %c = $chan(0)
  while (%i <= %c) {
    if ($1 isreg $chan(%i)) {
      if ($me !isop $chan(%i)) {
        os mode $chan(%i) +o $me
        .timerdelay 1 1 mode $chan(%i) + $+ $1
      }
      elseif ($me isop) { mode $chan(%i) + $+ $1 }
    }
    inc %i
  }
}


BTW is that meant to be os or Cs

Last edited by MikeChat; 27/10/06 08:23 PM.
#163179 27/10/06 09:23 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
Hi
Thanks alot for that and i will try it out. This script i wanted to use operserv as i dont have chanserv access to each channel.
i had meanwhile made some sort of fix where it worked but your solution looks alot better.
Thanks again


Newbie
#163180 27/10/06 10:06 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
as i sit here looking at this, isnt there a parameter missing?

mode $chan(%i) + $+ $1 $2

or

mode $chan(%i) + $+ $1-

/allchan i mike

without the $2 its /mode #channel +i
ie nothing to do

#163181 28/10/06 09:28 PM
Joined: Jul 2006
Posts: 242
H
HaleyJ Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Jul 2006
Posts: 242
nope mike not working frown i am try ing to set channel modes; all channels i am not op on operserv will op me and set the channel mode. All channels i AM op on it will just set the mode.


Newbie
#163182 29/10/06 12:33 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
evidently I cant see my own } errors
try this
Code:
allchans {
  var %i = 1
  var %c = $chan(0)
  while (%i <= %c) {
    if ($me !isop $chan(%i)) {
      os mode $chan(%i) +o $me
      .timerdelay 1 3 mode $chan(%i) $1-
    }
    else { 
      mode $chan(%i) $1- 
    }
    inc %i
  }
}


to change channel mode:
/allchans (+/-)mode
fex: /allchans +nt-R

to op a nick in all channels you are in (doesnt check for $comchannel)
/allchans (+/-) mode Nick
fex: /allchans +o superman


Link Copied to Clipboard