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.

tcl request

Old posts that have not been replied to for several years.
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

Post by bobjuh »

Hi,

I'm looking for a script that when i say "!masters" on the channel it wil say who are the masters and thee current nick.something like.

There is 1 master in de channel : BoBjUh (BoB[Away]).

I tried looking for it but couldn't find it anywhere. Can anyone tell me how to do it or where te find it.




_________________
BoBjUh
----
At first there was nothing. Then God said 'Let there be light!'
Then there was still nothing. But you could see it.

<font size=-1>[ This Message was edited by: bobjuh on 2002-06-23 09:22 ]</font>
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

set masters {
"master 1"
"master 2"
}
bind pub o !master pub:t
proc pub:t {nick uhost hand chan text} {
global masters
set rulenick [lindex [split $text " "] 0]
if {$text != "" && [onchan $rulenick $chan]} {
puthelp "NOTICE $rulenick :these are the masters of our channel. Pay attention!"
foreach line $masters { puthelp "NOTICE $rulenick :$line" }
return 0
}
foreach line $masters {puthelp "PRIVMSG $chan :$line" }
}

ripped from rules1.0.tcl, NOT written by me
haven't tryed, just modified...hope it works

<font size=-1>[ This Message was edited by: GodOfSuicide on 2002-06-23 09:32 ]</font>
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

Post by bobjuh »

ripped from rules1.0.tcl, NOT written by me
haven't tryed, just modified...hope it works
Wasn't really working or doing wat i was asking for. anybody else ?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Code: Select all

bind pib o !masters pub:showmasters
proc pub:showmasters {nick uh hand chan arg} {
  set a {}
  foreach b [chanlist $chan m|m] {
    lappend a "$b ([nick2hand $b $chan])"
  }
  if {[llength $b] >= 2} {
    puthelp "PRIVMSG $chan :There are [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
  }  else {
    puthelp "PRIVMSG $chan :There is [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
  }
}
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

Post by bobjuh »

ppslim wrote:

Code: Select all

bind pib o !masters pub:showmasters
proc pub:showmasters {nick uh hand chan arg} {
  set a {}
  foreach b [chanlist $chan m|m] {
    lappend a "$b ([nick2hand $b $chan])"
  }
  if {[llength $b] >= 2} {
    puthelp "PRIVMSG $chan :There are [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
  }  else {
    puthelp "PRIVMSG $chan :There is [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
  }
}
oke but this still didn't work if i do this it crashed with the error
[15:52:17] <MrZap> [15:52] Tcl error in file 'mrzap.conf':
[15:52:17] <MrZap> [15:52] bad type, should be one of: act, away, bcst, bot, chat, chjn, chof, chon, chpt, ctcp, ctcr, dcc, disc, evnt, fil, filt, flud, join, kick, link, load, lost, mode, msg, msgm, need, nick, nkch, notc, note, part, pub, pubm, raw, rcvd, rejn, sent, sign, splt, time, topc, tout, unld, wall
[15:52:17] <MrZap> while executing
[15:52:17] <MrZap> "bind pib o !masters pub:showmasters "
[15:52:17] <MrZap> (file "scripts/homonl.tcl" line 116)
[15:52:17] <MrZap> invoked from within
[15:52:17] <MrZap> "source scripts/homonl.tcl"
[15:52:17] <MrZap> (file "mrzap.conf" line 333)

i found the error and changed it but the script still doesn't work.

[15:55:23] <BoBjUh> !masters
[15:55:24] <MrZap> There is 1 masters in the channel: BoBj

also if i change my nick still doesn't display my whole nick
g
gk^
Halfop
Posts: 70
Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:

Post by gk^ »

ppslim wrote:

Code: Select all

bind pib o !masters pub:showmasters
proc pub:showmasters {nick uh hand chan arg} {
  set a {}
  foreach b [chanlist $chan m|m] {
    lappend a "$b ([nick2hand $b $chan])"
  }
  if {[llength $b] >= 2} {
    puthelp "PRIVMSG $chan :There are [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
  }  else {
    puthelp "PRIVMSG $chan :There is [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
  }
}
Working code:

Code: Select all

bind pub o !masters pub:showmasters
proc pub:showmasters {nick uh hand chan arg} {
  set a {}
  foreach b [chanlist $chan m|m] {
    lappend a "$b ([nick2hand $b $chan])"
  }
  if {[llength $b] >= 2} {
    puthelp "PRIVMSG $chan :There are [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
  }  else {
    puthelp "PRIVMSG $chan :There is [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
  }
}
Note that this code only will work it ppslim's code should work (except that little bind error that I fixed)
g
gk^
Halfop
Posts: 70
Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:

Post by gk^ »

maybe I should have read the hole post before I did anything else :oops:
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

Post by bobjuh »

gk^ wrote:maybe I should have read the hole post before I did anything else :oops:
*g*

The bind problem i already solved.
I'm not so good in tcl but that's a error someone as stupid as me can solve :P
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Typos, so shoot me :wink:
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

Post by bobjuh »

ppslim wrote:Typos, so shoot me :wink:
We got rid of the (stupid) typo.
It still doesn't work. it doesn't do what it should do
Last edited by bobjuh on Mon Nov 04, 2002 12:04 pm, edited 1 time in total.
g
gk^
Halfop
Posts: 70
Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:

Post by gk^ »

I will... some day :P
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

What error are you receiving now?

If I remember, I will have a look in detail tonight to resolve this
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

Post by bobjuh »

[15:55:23] <BoBjUh> !masters
[15:55:24] <MrZap> There is 1 masters in the channel: BoBj

It doesn't display my whole nick

In my first post i also asked. when i type master that it first says my bothandle and then de nick on the chan between ( )

"There is 2 master(s) in de channel : BoBjUh (BoB[Away]) AtomicDJ (Atomic|AW). "
Last edited by bobjuh on Mon Nov 04, 2002 12:10 pm, edited 1 time in total.
g
gk^
Halfop
Posts: 70
Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:

Post by gk^ »

What you are looking for is a kind of a seen script... right?
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

Post by bobjuh »

gk^ wrote:What you are looking for is a kind of a seen script... right?
no, take your own advise
"maybe I should have read the hole post before I did anything else"
not only 1 whole post but the first question. That will give you a clue what i'm looking for ;)
Locked