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.

loops in tcl

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

loops in tcl

Post by DarkJFMan »

well i'm more of a mirc script guy, but i'm learning TCL, i've been trying to get experienced with loops, you know for example, if i type `chans my bot replies, with all the chans he's in, and whether he's oped/voiced in these chans showing @ or + in front of that chan. I have no idea on how to start such script, any hint are appreciated, unless you wanna do the script ;)
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

Code: Select all

alias op-brag {
  var %i = 1, %loosers, %opchans, %1 = $iif($1,$1,$active), %totalnicks = 0
  while ($chan(0)  >= %i) {
    inc %totalnicks $nick($chan(%i),0)
    if ($me isop $chan(%i)) {
      inc %opchans
      var %loosers = $calc(%loosers + $nick($chan(%i),0,a) - 2)
    }
    inc %i
  }
  if (%opchans) {
    msg %1 I am op'ed in %opchans channels of $chan(0) that's $round($calc((%opchans / $chan(0)) * 100),0) $+ % $+ , and can fool around with %loosers loosers of %totalnicks that's $round($calc((%loosers / %totalnicks) * 100),0)) $+ %
  }
  else {
    msg %1 Im not op'ed in any channels! :(
  }
}
Here's my script in mIRC, how do i make it tcl ??
Locked