This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

could this work?

Old posts that have not been replied to for several years.
Locked
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

could this work?

Post by DarkJFMan »

Code: Select all

bind pub - `power pub:power
proc pub:power { nick host hand channel args } {
global botnick power
  set test [chanlist $channel]
# The channels bot is in
  set reg($channel) 0
  for { set number 0 } { $number < [llength $test] } { incr number } {
    if {[onchan $botnick $channel]} {
       incr reg($channel)
     }
  }
# The channels bot is op
  set ops($channel) 0
  for { set number 0 } { $number < [llength $test] } { incr number } {
      if {[botisop [lindex $test $number] $channel]} {
        incr ops($channel)
      }
    }
# The number of users are in chan with bot
  set usera($channel) 0
    for { set number 0 } { $number < [llength $test] } { incr number } {
      if {[onchan $nick $channel]} {
        incr usera($channel)
      }
    }
# The number of users are in chan with bot with no op
  set usern($channel) 0
    for { set number 0 } { $number < [llength $test] } { incr number } {
      if {![isop $nick $channel] } {
   incr usern($channel)
      }
    }
puhelp "PRIVMSG $channel :I'm oped in $ops($channel) channels out of $reg($channel), \
    and can fool around with $usern($channel) of $usera($channel)"
  }
 return 0
}
}
[01:58:08pm] <DarkJFGirl> [17:00] Tcl error [pub:power]: wrong # args: should be "botisop ?channel?"

What's wrong?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

You are using the wrong number of arguments for the 'botisop' command.
See the tcl-commands.doc for BOTISOP.

Replace this

Code: Select all

      if {[botisop [lindex $test $number] $channel]} {
With this

Code: Select all

      if {[botisop $channel]} {
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

something is messed up
[02:54:54pm] (DarkJFMan) `power
[02:54:56pm] (DarkJFGirl) I'm oped in 4 channels out of 4, and can fool around with 0 of 4
what i want script to do
<nick>`power
<bot> I'm oped in (how many chans bot is op) channels out of (the chan's he's in), and can fool around with (people that don't got op) of (all the users in same chan with op)

The script is correct, it's just i need to find the right loops.
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Something like this should work:

Code: Select all

bind pub - `power pub:power
proc pub:power {nick uhost hand chan text} { 
 set chnum 0; set chusr 0; set nonop 0
 set totch [llength [channels]]

  foreach ch [channels] {
    if {[botisop $ch]} {
      set chn [llength [chanlist $ch]]
      incr chusr $chn
      incr chnum
      foreach u [chanlist $ch] {
        if {![isop $u $ch]} { incr nonop }
      }
    }
  }
 putserv "PRIVMSG $chan :I'm opped in $chnum out of $totch channels, and can fool around with $nonop out of $chusr users. "
}
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

my mistake, i didn't tell it correctly, everything is correct except, i need to know how to make "$chusr" count all the nicks that are in same chan with the bot, doesn't matter if they're oped/voice/ or nothing

Ty, scripts works great.
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

DarkJFMan wrote:i need to know how to make "$chusr" count all the nicks that are in same chan with the bot, doesn't matter if they're oped/voice/ or nothing

Code: Select all

set chusr 0
foreach c [channels] {
    incr chusr [llength [chanlist $c]]
}
Have you ever read "The Manual"?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

-1 user for each channel where reperesents itself :)
Once the game is over, the king and the pawn go back in the same box.
Locked