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.

.channel #abc as public command

Old posts that have not been replied to for several years.
Locked
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

.channel #abc as public command

Post by ProXy »

Hello,

I would like to have the ".channel #abc" response in the partyline as answer for the public channel command ".channel #abc". I have written everything, to check the user`s input, but I don`t know how to make the bot answer in the specified channel!

First of all I need to know, how to give the eggdrop the ".channel #abc" command via the tcl to it`s partyline. The second thing is: How can I show the response of the eggdrop in a channel, instead of the partyline?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

WHat you have asked for, is posibble, but is a tad tricky.

First off. Is what you are asking for is this?
Someone in a channel types ".channel #abc"
The messages is displayed to users in the partyline.

It would all depednd who you wanted to display it to in the partyline.

All users, on all bots? Then use the "dccbroadcast" comand.

All users on on bot? Then you will have to use either "putlog", or foreach through the list of partyline users obtained from "dcclist".

One user obn the bot? This is a tad tricky. How do you know which user to send to? If you are going to send to the handle, assoiated with the nickname of the person making the request, then you can use "hand2idx". Otherwise, we will need more info.

As for responding in a channel. See the hundres of Tcl script that do this sort of thing. They are show examples of output to a channel.
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

Post by ProXy »

Well I think you missed me. I will try to explain it another way: All People should be allowed to type ".channel a#bc" in any channel as a public command. The eggdrop should response to that channel with the same thing he would resond to the partyline! I just want an Alias to the partyline command ".channel #abc" that is public!

When I am in #abc and type ".channel #xyz" the eggdrop should display all information to the channel that is also shown in the partyline!
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You will have tyo re-create the ".channel" commands C code, in Tcl.

There is no easy way to request information from a partyline command. All this ifnormation is output to the partyline, and has no other way of capturing or re-direction, other than to use a loopback connection (make a script that connect to the bot, requests the ifnormation and posts it. No simple, and slow~).

However, all of the ifnormation that is available in the DCC based ".channel" command, can be obtained using Tcl commands. You simply have to send the information to the destination in a formatted way.

See the "chanlist" command in tcl-commands.doc
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

it's your lucky day :p hehe nah... I was bored so I made this little code.. it will give exactly the same info as .channel command in partyline.. only difference is that it does not return key of a channel (safty reason) ... and it does not line it up neatly as the partyline command... other than that it's the same :)

Code: Select all

bind pub - .channel channel_in_tcl

proc channel_in_tcl {nick host hand chan text} {
	if {[validchan [lindex [split $text] 0]]} {
		set mems 1
		foreach m [chanlist [lindex [split $text] 0]] {
			if {[validuser [nick2hand $m [lindex [split $text] 0]]} { incr mems }
		}
		set modes [lindex [split [getchanmode [lindex [split $text] 0]]] 0]
		puthelp "PRIVMSG $chan :Channel [lindex [split $text] 0], $mems members, mode $modes\:"
		puthelp "PRIVMSG $chan :(n = owner, m = master, o = op, d = deop, b = bot)"
		puthelp "PRIVMSG $chan : NICKNAME    HANDLE     JOIN  IDLE  USER@HOST"
		foreach n [chanlist [lindex [split $text] 0]] {
			if {[isop $n [lindex [split $text] 0]]} { 
				set info "@$n"
			} elseif {[isvoice $n [lindex [split $text] 0]]} {
				set info "+$n"
			} else { set info $n }
			set h [nick2hand $n [lindex [split $text] 0]]
			set j [getchanjoin $n [lindex [split $text] 0]]
			set j [clock format $j -format "%H:%M"]
			set i "[getchanidle $n [lindex [split $text] 0]]m"
			set hst [getchanhost $n [lindex [split $text] 0]]
			if {[matchattr $h n]} { set fl "n" 
			} elseif {[matchattr $h m]} { set fl "m"
			} elseif {[matchattr $h o]} { set fl "o"
			} elseif {[matchattr $h d]} { set fl "d"
			} elseif {[matchattr $h b]} { set fl "b" 
			} else { set fl "-" }
			puthelp "PRIVMSG $chan :$info  $h  $j $fl $i $hst"
		}
	}
}
Elen sila lúmenn' omentielvo
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

Post by ProXy »

Thx a lot Papillon. If I can help you ever, tell me :)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

lol :lol: send me a lotta money... or pay the all the loans I have and I'll make whatever script you want :P
Elen sila lúmenn' omentielvo
Locked