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.

[SOLVED] Force join channel

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Fire-Fox
Master
Posts: 299
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

[SOLVED] Force join channel

Post by Fire-Fox »

HI,

No clue if someone allready requested something like this but im looking for a script that doing the following :

user types : !help
then the bot should make the user join a support channel
Last edited by Fire-Fox on Sat May 27, 2023 3:41 am, edited 1 time in total.
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Re: force join channel

Post by willyw »

Fire-Fox wrote: ...
then the bot should make the user join a support channel

This would require that the bot itself is a Network Administrator, or something like that. That is: it would have the privilege of being able to force a user into a channel.

Also, beware. You can possibly irritate a user, by forcing them to join a channel.

If the bot is such, then I think it would be possible to do a script like this. It might not be easy for the scripter to test it though, not without having such a bot to test it on.

In the meantime, here is an idea to consider :

Check out this script:
http://tclarchive.org/search.php?str=ho ... 7&sub.y=13

All it does, is read the text of a file that you type up, to the channel, on command.
Since it is reading a plain text file, that makes it very easy to change the text to be displayed.
Just put in the file something like:
Hello. Please join #someChanName and post your question there. That's the channel for help.
or whatever message that you wish to convey to the user that did !help .

I've used this file over the years, for this very purpose. :)

It's a simple script. If you need to edit it for some tweak that you might like, it shouldn't be too difficult to figure out.

I hope this helps.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
User avatar
Fire-Fox
Master
Posts: 299
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Post by Fire-Fox »

willyw wrote:You can possibly irritate a user, by forcing them to join a channel.
Then they should not type !help ;)
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i added a check if nick is already on the support channel or not for this to work the eggdrop has to be on the support channel as well to check if the nick who requested help is already sajoined there

Code: Select all

bind pub -|- !help Pub:Sajoin:SupportChan

proc Pub:Sajoin:SupportChan {nick host hand chan text} {

  set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }] 

  set SupChan #SupChan

  if {![onchan $nick $SupChan]} { putnow "SAJOIN $nick $SupChan" }
}

User avatar
Fire-Fox
Master
Posts: 299
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Post by Fire-Fox »

I'll give that a go, thanks :)
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
User avatar
CrazyCat
Revered One
Posts: 1299
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

What is the interest of the regsub about $text ? Using resources ?
User avatar
Fire-Fox
Master
Posts: 299
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Post by Fire-Fox »

You have a better way, im just asking :)
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
User avatar
CrazyCat
Revered One
Posts: 1299
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Code: Select all

set helpchan "#help"
bind pub -|- "!help" sapubhelp
proc sapubhelp {nick uhost handle chan text} {
   if {![string match -nocase $chan $::helpchan] && ![onchan $nick $::helpchan]} {
      putserv "SAJOIN $nick $::helpchan"
   }
}
Just change #help to feat your desired hel channel.

I made a double verification (just for example) : the channel where the comman is typed must not be the destination chan and the user must not be on the chan.
User avatar
Fire-Fox
Master
Posts: 299
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Post by Fire-Fox »

Thanks :)
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

oh i thought in the case of the command used in colors to strip the colors to recognize the command i wasnt sure if the bind pub already did that
User avatar
Fire-Fox
Master
Posts: 299
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Post by Fire-Fox »

Thanks to both !
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
User avatar
CrazyCat
Revered One
Posts: 1299
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

No, the regsub works on the text after the command, and $text is not used anywhere.
If someone typs "!help i'm in trouble", $text contains "i'm in trouble".

But if someone uses color before !help, the bind won't work.
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i guess your right CrazyCat altho ive tested the command with colors in front of it and it recognized it fine and i didnt load a color stripper script as i made sure thats unloaded first unless im mistaken but so far it seems bind pub can be used with color codes as well
Post Reply