mIRC Home    About    Download    Register    News    Help

Print Thread
power script #159466 17/09/06 05:53 PM
Joined: Jun 2006
Posts: 10
T
trombone2009 Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Jun 2006
Posts: 10
i have a power script and i want to know how no make it show my hop (%) power too how do i do that?
here is my code so far:
Code:
 alias power { 
  set %power.chan.counter 0 
  set %power.powerover 0 
  set %power.opchans 0 
  set %power.totalnetworks $scon(0)
  set %power.totalnetworks.count 0
  set %power.total.channels 0
  set %power.max.chans 0 
  :connectionloop
  inc %power.totalnetworks.count
  if ( %power.totalnetworks.count > %power.totalnetworks ) { goto end }
  scon %power.totalnetworks.count
  set %power.total.channels %power.total.channels + $chan(0)
  set %power.max.chans $chan(0)
  set %power.chan.counter 0
  :loop
  if ( %power.chan.counter > %power.max.chans ) { goto connectionloop }
  set %power.chan.counter $calc( %power.chan.counter + 1 )
  if ( $me isop $chan(%power.chan.counter) ) { 
    set %power.powerover %power.powerover + $nick($chan(%power.chan.counter),0)
    inc %power.opchans
  } 
  goto loop
  :end
  scon -r
  if ( %power.total.channels = 1 ) var %power.chanword channel
  if ( %power.total.channels > 1 ) var %power.chanword channels
  if ( %power.totalnetworks = 1 ) var %power.netword network
  if ( %power.totalnetworks > 1 ) var %power.netword different networks
  msg $active 4 I am OP'd in 14 %power.opchans $+ / $+ %power.total.channels 15 $+ %power.chanword 4 on < 14 %power.totalnetworks 4 >15 %power.netword $+ . 4 I pwn < 14 %power.powerover 4 >15 n00bs  
  unset %power.*
}
 

Re: power script #159467 17/09/06 06:40 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Do you mean that you want your half-ops to show as well as your ops? If so, then I'll re-do your code (might re-do it anyways as your coding methodology is not the greatest). If you want your half-ops to be included, like your ops currently are, then no problem..also do you want your voiced (+) to be included? Do you want everything in one display, or separate displays?

I'll re-code based on your response, and post back with a replacement as soon as I can.

Re: power script #159468 17/09/06 06:54 PM
Joined: Jun 2006
Posts: 10
T
trombone2009 Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Jun 2006
Posts: 10
Quote:
Do you mean that you want your half-ops to show as well as your ops?

yes
Quote:
If so, then I'll re-do your code (might re-do it anyways as your coding methodology is not the greatest).

lol i didnt even make the code i suck at scripting
Quote:
also do you want your voiced (+) to be included?

sure
Quote:
Do you want everything in one display, or separate displays?

one please
Quote:
I'll re-code based on your response, and post back with a replacement as soon as I can.

thanks laugh

Re: power script #159469 17/09/06 08:25 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 menu channel,nicklist,query {
  Power : power
}
alias power { 
  var %a = 1, %b = $scon(0)
  var %networks = network $+ $iif(%b > 1,s), %chan = channel
  while %a <= %b  {
    .scon %a
    var %c = 1, %d = $chan(0)
    inc %chans %d
    if %d > 1 {
      %chan = $addtok(%chan,s,32)
    }
    %chan = $remove(%chan,$chr(32))
    while %c <= %d {
      inc %noobs $nick($chan(%c),0,r)
      inc %Op $iif($me isop $chan(%c),1,0)
      inc %hop $iif($me ishop $chan(%c),1,0)
      inc %Voice $iif($me isvoice $chan(%c),1,0)
      inc %c
    }
    inc %a
  }
  scon -r
  msg $active 4 I am OP'd in 14 %op $+ / $+ %chans 15 $+ %chan 4 on < 14 $scon(0) 4 >15 %networks $+ . 
  msg $active 4 I am Half-OP'd in 14 %hop $+ / $+ %chans 15 $+ %chan 4 on < 14 $scon(0) 4 >15 %networks $+ .
  msg $active 4 I am OP'd in 14 %op $+ / $+ %chans 15 $+ %chan 4 on < 14 $scon(0) 4 >15 %networks $+ .
  msg $active 4 I pwn < 14 %noob 4 >15 n00bs  
  unset %Op
  unset %hop
  unset %voice
}
 

Last edited by RusselB; 17/09/06 09:00 PM.
Re: power script #159470 17/09/06 08:41 PM
Joined: Jun 2006
Posts: 10
T
trombone2009 Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Jun 2006
Posts: 10
* Invalid parameters: $nick (line 16, script1.txt)

Re: power script #159471 17/09/06 09:01 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Replacement code with reported errors and other small items repaired
Code:
 menu channel,nicklist,query {
  Power : power
}

alias power { 
  var %a = 1, %b = $scon(0)
  var %networks = network $+ $iif(%b > 1,s), %chan = channel
  while %a <= %b  {
    .scon %a
    var %c = 1, %d = $chan(0)
    inc %chans %d
    if %d > 1 || %chan == channels {
      %chan = channels
    }
    %chan = $remove(%chan,$chr(32))
    while %c <= %d {
      inc %noobs $nick($chan(%c),0,r)
      inc %Op $iif($me isop $chan(%c),1,0)
      inc %hop $iif($me ishop $chan(%c),1,0)
      inc %Voice $iif($me isvoice $chan(%c),1,0)
      inc %c
    }
    inc %a
  }
  scon -r
  msg $active 4 I have 14 %op  Ops, 14 %hop Half-Ops and 14 %voice Voices over 14 %chans 15 $+ %chan 4 on < 14 $scon(0) 4 >15 %networks $+ . 4 I pwn < 14 %noobs 4 >15 n00bs  
  unset %Op
  unset %hop
  unset %voice
unset %chans
unset %noobs
}
 

Last edited by RusselB; 17/09/06 09:30 PM.
Re: power script #159472 17/09/06 09:05 PM
Joined: Jun 2006
Posts: 10
T
trombone2009 Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Jun 2006
Posts: 10
[04:03:09] <%trombone2009> I am OP'd in 1/42 channels on < 1 > network.
[04:03:09] <%trombone2009> I am Half-OP'd in 3/42 channels on < 1 > network.
[04:03:09] <%trombone2009> I am OP'd in 1/42 channels on < 1 > network.
[04:03:09] <%trombone2009> I pwn < > n00bs

something is still wrong smirk

Re: power script #159473 17/09/06 09:19 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Use the LAST code I posted. It has a number of repairs done to it.

Re: power script #159474 17/09/06 09:48 PM
Joined: Jun 2006
Posts: 10
T
trombone2009 Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Jun 2006
Posts: 10
I have 1 Ops, 3 Half-Ops and Voices over 6 channels on < 1 > network. I pwn < 2 > n00bs << this seems wrong
I have ~ in one room
% in three rooms and
+ in 2 rooms
in the one that i have ~ in there are currently 16 ppl that I have a higher power than
in the 3 that i have % in there are 6 ppl that i have a higher power than

so there must be something wrong smirk

Re: power script #159475 17/09/06 10:00 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The ~ is not recognized by the script as a power option. The only items that are recognized are @, %, and +

Make sure you're using just the script I supplied, as it was tested by Ryu (whom you met in the scripting channel on maximum-irc) and it works for him.

Re: power script #159476 17/09/06 10:28 PM
Joined: Aug 2006
Posts: 36
D
DragonRyder Offline
Ameglian cow
Offline
Ameglian cow
D
Joined: Aug 2006
Posts: 36
menu channel,nicklist,query {
Power : power
}
alias power {
var %a = 1, %b = $scon(0)
var %networks = network $+ $iif(%b > 1,s), %chan = channel
while %a <= %b {
.scon %a
var %c = 1, %d = $chan(0)
inc %chans %d
if %d > 1 || %chan == channels {
%chan = channels
}
%chan = $remove(%chan,$chr(32))
while %c <= %d {
inc %noobs $nick($chan(%c),0,r)
inc %Op $iif($me isop $chan(%c),1,0)
inc %hop $iif($me ishop $chan(%c),1,0)
inc %Voice $iif($me isvoice $chan(%c),1,0)
inc %c
}
inc %a
}
scon -r
msg $active 15C14onnected 15H14ere 15V14ia:3  $+ $server $+ . I have %op Ops, %hop Half-Ops and %voice Voices over %chans %chan on < $scon(0) > %networks $+ . I pwn < %noobs > n00bs
unset %Op
unset %hop
unset %voice
unset %chans
unset %noobs
}

Re: power script #159477 12/10/06 06:53 AM
Joined: Sep 2006
Posts: 71
O
o0Chris0o Offline
Babel fish
Offline
Babel fish
O
Joined: Sep 2006
Posts: 71
hmmm I can't get this to work? can someone help?

Re: power script [Re: o0Chris0o] #200966 15/06/08 08:04 PM
Joined: Aug 2006
Posts: 36
D
DragonRyder Offline
Ameglian cow
Offline
Ameglian cow
D
Joined: Aug 2006
Posts: 36
Aliases
Code:
power {
  var %a = 1, %b = $scon(0)
  var %networks = network $+ $iif(%b > 1,s), %chan = channel
  while %a <= %b  {
    .scon %a
    var %c = 1, %d = $chan(0)
    inc %chans %d
    if %d > 1 || %chan == channels {
      %chan = channels
    }
    %chan = $remove(%chan,$chr(32))
    while %c <= %d {
      inc %noobs $iif($me ison $chan(%c),$nick($chan(%c),0,a,o),$iif($me ishop $chan(%c),$nick($chan(%c),0,a,oh),$nick($chan(%c),0,r)))
      inc %Op $iif($me isop $chan(%c),1,0)
      inc %hop $iif($me ishop $chan(%c),1,0)
      inc %Voice $iif($me isvoice $chan(%c),1,0)
      inc %c
    }
    inc %a
  }
  scon -r
  msg $active  15C14onnected 15H14ere 15V14ia3: 10<12  $+ $server $+  10>14. 15I H14ave: 10<4 $+(%op, $+ 3/04 $+ ,%chans)  10> 15O14ps, 10<4 $+(%hop, $+ 3/04 $+ ,%chans) 10> 15H14elp10-15O14ps 15a14nd 10<4 $+(%voice, $+ 3/04 $+ ,%chans) 10> 15V14oices. 15I A14m 15O14n 10<4 $scon(0) 10> 15N14etwork(s). 15I H14ave 15C14ontrol 15O14ver 10<4 %noobs 10> 15M14ortal 15V14ictoms.
  unset %Op
  unset %hop
  unset %voice
  unset %chans
  unset %noobs
}

PopUps (Channel Section)
Code:
IRC Power: power