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.

!vhost nick vhost.you.choose

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
R
Repdientu
Voice
Posts: 37
Joined: Thu Apr 30, 2009 3:45 am
Location: Viet Nam
Contact:

Post by Repdientu »

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.
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

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
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Thats True, as simo says the vhost would only be active until the user disconnects :roll:
ComputerTech
R
Repdientu
Voice
Posts: 37
Joined: Thu Apr 30, 2009 3:45 am
Location: Viet Nam
Contact:

Post by Repdientu »

Thank you. Can i set it work only channel ?
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

yes you can
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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"
}
R
Repdientu
Voice
Posts: 37
Joined: Thu Apr 30, 2009 3:45 am
Location: Viet Nam
Contact:

Post by Repdientu »

thank you, i will try it
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

tnx caesar
R
Repdientu
Voice
Posts: 37
Joined: Thu Apr 30, 2009 3:45 am
Location: Viet Nam
Contact:

Post by Repdientu »

thank you
Post Reply