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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Repdientu
Voice
Posts: 37 Joined: Thu Apr 30, 2009 3:45 am
Location: Viet Nam
Contact:
Post
by Repdientu » Fri Jul 10, 2020 8:27 am
simo wrote: the codes in the urls i posted do exactly that checking if user has a registered nick on join of vhost channel
i not ower the network. i am only ircops on it. i want to make bot to used !vhost to give vhost user on the network too. the codes in your post is set vhost user. but i want to make only ower/master/op of the bot can used this command to give vhost for user.
ComputerTech
Master
Posts: 399 Joined: Sat Feb 22, 2020 10:29 am
Contact:
Post
by ComputerTech » Fri Jul 10, 2020 10:38 am
caesar wrote: What's with the $args[0] in there CrazyCat? TCL doesn't know that stuff.
Anyway, here's something:
Code: Select all
bind pub mn !vhost change:vhost
proc change:vhost {nick uhost hand chan text} {
if {[scan $text {%s%s} user host] != 2} {
puthelp "NOTICE $nick :Error, sytnax is: !vhost <nick> <vhost>"
return
}
puthelp "CHGHOST $user $host"
puthelp "NOTICE $nick :Changed $user host to $host"
}
Caesars Code does exactly that, it only allow's global +m and channel +n to change a user's vhost.
ComputerTech
simo
Revered One
Posts: 1107 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Fri Jul 10, 2020 11:03 am
only now you provided more info as to what the criteria are and the conditions you work with then indeed caesars code will do the job only the vhosts arent permant so they would have to come to channel to get vhost everytime
ComputerTech
Master
Posts: 399 Joined: Sat Feb 22, 2020 10:29 am
Contact:
Post
by ComputerTech » Fri Jul 10, 2020 1:58 pm
Thats True, as simo says the vhost would only be active until the user disconnects
ComputerTech
Repdientu
Voice
Posts: 37 Joined: Thu Apr 30, 2009 3:45 am
Location: Viet Nam
Contact:
Post
by Repdientu » Fri Jul 10, 2020 9:52 pm
Thank you. Can i set it work only channel ?
simo
Revered One
Posts: 1107 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Sat Jul 11, 2020 8:18 am
yes you can
simo
Revered One
Posts: 1107 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Sat Jul 11, 2020 9:22 am
try this:
Code: Select all
set scan(chan) "#vhost"
bind pub mn !vhost change:vhost
proc change:vhost {nick uhost hand chan text} {
global scan(chan)
if {$chan != "$scan(chan)"} {
putserv "NOTICE $tls_nick : Don't Use This Command Outside $scan(chan)"
return 0
}
if {[scan $text {%s%s} user host] != 2} {
puthelp "NOTICE $nick :Error, sytnax is: !vhost <nick> <vhost>"
return
}
puthelp "CHGHOST $user $host"
puthelp "NOTICE $nick :Changed $user host to $host"
}
Repdientu
Voice
Posts: 37 Joined: Thu Apr 30, 2009 3:45 am
Location: Viet Nam
Contact:
Post
by Repdientu » Sun Jul 12, 2020 12:58 am
thank you, i will try it
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Jul 16, 2020 9:24 am
Code: Select all
global scan(chan)
if {$chan != "$scan(chan)"} {
putserv "NOTICE $tls_nick : Don't Use This Command Outside $scan(chan)"
return 0
}
@simo I see 3 issues with your code:
- it should be 'global scan' (notice the lack of
(chan) part)
- there's no
$tls_nick variable
- the
if {$chan != "$scan(chan)"} will fail when the to names won't be at the upper or lower case, so use
string equal -nocase to be sure the stuff will match no matter the case.
Updated code:
Code: Select all
set scan(chan) "#vhost"
bind pub mn !vhost change:vhost
proc change:vhost {nick uhost hand chan text} {
global scan
if {![string equal -nocase $scan(chan) $chan]} {
puthelp "NOTICE $nick :Don't Use This Command Outside $scan(chan)"
return
}
if {[scan $text {%s%s} user host] != 2} {
puthelp "NOTICE $nick :Error, sytnax is: !vhost <nick> <vhost>"
return
}
puthelp "CHGHOST $user $host"
puthelp "NOTICE $nick :Changed $user host to $host"
}
Once the game is over, the king and the pawn go back in the same box.
simo
Revered One
Posts: 1107 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Thu Jul 16, 2020 9:42 am
tnx caesar
Repdientu
Voice
Posts: 37 Joined: Thu Apr 30, 2009 3:45 am
Location: Viet Nam
Contact:
Post
by Repdientu » Wed Jul 22, 2020 12:33 am
thank you