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.

Some fairly easy TCL questions

Old posts that have not been replied to for several years.
Locked
R
Real
Voice
Posts: 24
Joined: Mon Mar 08, 2004 11:27 am

Some fairly easy TCL questions

Post by Real »

Hello,

I can use a shell of a friend of mine to put my irc bot on. But I don't know anything about TCL scripts, so I'm going to ask some help here :)


EDIT: *first problem solved*

Next, there's the !admin command. Everybody can use the !admin <reason> command. This will highlight every op on the channel, and give them to reason.
Example:

PersonA: !admin Just testing.
Eggbot: Op1 , Op2 , Op3 Message: Just testing.


I have this in my irc script already, but I have no idea how to write it in TCL, if it's even possible.
The irc script is:

Code: Select all

on 1:TEXT:!admin *:#here:{
  set %i 1 
  set %list $null 
  :next 
  set %nick $nick(#,%i,o) 
  if %nick == $null goto done 
  %lijst = %list $chr(32) $+ %nick 
  inc %i 
  goto next 
  :done 
  /msg $chan 4 $+ %list -- 7Admin needed! 10Reason: $2-
}

Please help :)
R
Real
Voice
Posts: 24
Joined: Mon Mar 08, 2004 11:27 am

Post by Real »

ok so my first problem is solved, but there's still the !admin problem, and I think this one's really hard.

Can anyone help me with this please? :-/
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

Try this code:

Code: Select all

bind pubm - "!admin *" pub:admin
proc pub:admin {nick host hand chan args} {
  set list ""
  foreach nick2 [chanlist $chan] {
    if {[isop $nick2 $chan]} {
      append list " $nick2"
    }
  }
  putserv "PRIVMSG $chan :4$list -- 7Admin needed! 10Reason: [lrange $args 1 end]"
}
I think it should work, but i didn't test it.
Hope it helps :P
Xpert.
R
Real
Voice
Posts: 24
Joined: Mon Mar 08, 2004 11:27 am

Post by Real »

Thanks very much, I can't test it now, since the person who can update the eggdrop is offline.

One more question though, can you change it so that it only works on 1 channel?
Thank you!
C
Careto
Voice
Posts: 11
Joined: Tue Mar 02, 2004 1:33 pm

Post by Careto »

Code: Select all

bind pubm - "!admin *" pub:admin 
proc pub:admin {nick host hand chan args} { 
if {[string equal -nocase $chan "#anychannel"]} {
  set list "" 
  foreach nick2 [chanlist $chan] { 
    if {[isop $nick2 $chan]} { 
      append list " $nick2" 
    } 
  } 
  putserv "PRIVMSG $chan :4$list -- 7Admin needed! 10Reason: [lrange $args 1 end]" 
} 
}
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

RTFM!

Post by user »

Xpert wrote:bind pubm - "!admin *" pub:admin
Careto wrote:bind pubm - "!admin *" pub:admin
doc/tcl-commands.doc - bind pubm
The mask is matched against the channel name followed by the text
Have you ever read "The Manual"?
R
Real
Voice
Posts: 24
Joined: Mon Mar 08, 2004 11:27 am

Post by Real »

Code: Select all

bind pubm - "!admin *" pub:admin

proc pub:admin {nick host hand chan args} { 
if {[string equal -nocase $chan "#telenet.to"]} { 
  set list "" 
  foreach nick2 [chanlist $chan] { 
    if {[isop $nick2 $chan]} { 
      append list " $nick2" 
    } 
  } 
  putserv "PRIVMSG $chan :\0034$list -- \0037Admin needed! \00310Reason: [lrange $args 1 end]" 
} 
}
Can somebody then tell me why this doesn't work? :o Thanks

Doesn't it have to be "bind pub" instead of "bind pubm" ?

And {nick mask hand channel args} instead of {nick host hand chan args} ?

Just guessing a bit :)
Last edited by Real on Thu Mar 11, 2004 11:47 am, edited 1 time in total.
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

Where's the bind gone?:)
Add this bind to your script:

Code: Select all

bind pubm - !admin pub:admin
:P
Xpert.
R
Real
Voice
Posts: 24
Joined: Mon Mar 08, 2004 11:27 am

Post by Real »

I forgot to paste it, it's in my TCL script though :p

And it doesnt work
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

lol, and i thought you removed it:P
I think this code will worked:

Code: Select all

bind pubm - !admin pub:admin 
proc pub:admin {nick host hand chan args} { 
  if {$chan == "#telenet.to"]} { 
    set list "" 
    foreach nick2 [chanlist $chan] { 
      if {[isop $nick2 $chan]} { 
        append list " $nick2" 
      } 
    } 
    putserv "PRIVMSG $chan :\0034$list -- \0037Admin needed! \00310Reason: [lrange $args 1 end]" 
  } 
}
Xpert.
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Xpert wrote:lol, and i thought you removed it:P
I think this code will worked:

Code: Select all

bind pubm - !admin pub:admin
...
I think you should have read my previous post. Do you mean 'pub'?
Have you ever read "The Manual"?
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

user wrote:I think you should have read my previous post. Do you mean 'pub'
It worked on my eggdrop with the bind pubm.... :-?
Xpert.
R
Real
Voice
Posts: 24
Joined: Mon Mar 08, 2004 11:27 am

Post by Real »

It doesn't on mine :/

Can somebody see what's wrong?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

This should work .. but not tested it yet altho i don't realy see the point of sutch script ..... :o

Code: Select all

bind pub - !admin pub:admin

set mychan "#telenet.to"

proc pub:admin {nick host hand chan arg} {
  global mychan 
  if {[string match -nocase $mychan $chan]} { 
    foreach user [chanlist $chan] {
      if {[isop $user $chan]} {
        if {[info exists list]} {
          append list " $user"
        } else {
          set list "$user"
        }
        
      } 
    }
    putserv "PRIVMSG $chan :\0034$list -- \0037Admin needed! \00310Reason: [lrange $arg 0 end]"
  } 
}
XplaiN but think of me as stupid
R
Real
Voice
Posts: 24
Joined: Mon Mar 08, 2004 11:27 am

Post by Real »

Thanks mate, it works :)
Locked