egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

!vhost nick vhost.you.choose
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Repdientu
Voice


Joined: 30 Apr 2009
Posts: 33
Location: Viet Nam

PostPosted: Fri Jul 10, 2020 8:27 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Fri Jul 10, 2020 10:38 am    Post subject: Reply with quote

caesar wrote:
What's with the $args[0] in there CrazyCat? TCL doesn't know that stuff. Smile

Anyway, here's something:
Code:

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Fri Jul 10, 2020 11:03 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Fri Jul 10, 2020 1:58 pm    Post subject: Reply with quote

Thats True, as simo says the vhost would only be active until the user disconnects Rolling Eyes
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Repdientu
Voice


Joined: 30 Apr 2009
Posts: 33
Location: Viet Nam

PostPosted: Fri Jul 10, 2020 9:52 pm    Post subject: Reply with quote

Thank you. Can i set it work only channel ?
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sat Jul 11, 2020 8:18 am    Post subject: Reply with quote

yes you can
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sat Jul 11, 2020 9:22 am    Post subject: Reply with quote

try this:

Code:

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"
}
Back to top
View user's profile Send private message
Repdientu
Voice


Joined: 30 Apr 2009
Posts: 33
Location: Viet Nam

PostPosted: Sun Jul 12, 2020 12:58 am    Post subject: Reply with quote

thank you, i will try it
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Jul 16, 2020 9:24 am    Post subject: Reply with quote

Code:

 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:

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.
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Thu Jul 16, 2020 9:42 am    Post subject: Reply with quote

tnx caesar
Back to top
View user's profile Send private message
Repdientu
Voice


Joined: 30 Apr 2009
Posts: 33
Location: Viet Nam

PostPosted: Wed Jul 22, 2020 12:33 am    Post subject: Reply with quote

thank you
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber