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 

.+host .-host public commands

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Getodacul
Voice


Joined: 07 Jun 2007
Posts: 20

PostPosted: Tue Jun 17, 2008 9:56 am    Post subject: .+host .-host public commands Reply with quote

I need a script to add or remove a host on channel.
Quote:

<me> .+host User1 *!*@new-hostname.tld
<Bot> *!*@new-hostname.tld added to User1

I find some tcl's that convert some dcc commands in public commands but modifications make that scripts broken or useless Smile
Thanks.
Back to top
View user's profile Send private message
Getodacul
Voice


Joined: 07 Jun 2007
Posts: 20

PostPosted: Tue Jun 17, 2008 11:45 am    Post subject: Reply with quote

Half problem solved but remhost or delhost it's out of line Smile
Quote:

bind pub o "+host" pub:addhost
#that's for user
bind pub n ".+host" pub:changehost
#that's for bots or other people

proc pub:addhost { nick userhost hand chan host } {
if {$host == ""} {
puthelp "privmsg $chan :+host <your-new-hostname>"
return 0
}
set hostname [lindex $host 0]
addhost $hand $hostname
puthelp "privmsg $chan :Added hostname $hostname to $hand"
}

proc pub:changehost { nick userhost hand chan text } {
set handle [lindex $text 0]
set newhost [lindex $text 1]
if {$text == ""} {
puthelp "privmsg $chan :.+host <handle> <new-hostname> (to see a handle use: !whois <nickname>)"
return 0
}
addhost $handle $newhost
puthelp "privmsg $chan :Added hostname $newhost to $handle "
}
putlog "Addhost Loaded"

The script it's tested and working fine. Feel free to modify.
Back to top
View user's profile Send private message
Papillon
Owner


Joined: 15 Feb 2002
Posts: 724
Location: *.no

PostPosted: Tue Jun 17, 2008 12:12 pm    Post subject: Reply with quote

from tcl-commands.doc
Quote:
getuser <handle> <entry-type> [extra info]
Description: an interface to the new generic userfile support. Valid
entry types are:
BOTFL - returns the current bot-specific flags for the user
(bot-only)
BOTADDR - returns a list containing the bot's address, telnet port,
and relay port (bot-only)
HOSTS - returns a list of hosts for the user
LASTON - returns a list containing the unixtime last seen and the
last seen place. LASTON #channel returns the time last
seen time for the channel or 0 if no info exists.
INFO - returns the user's global info line
XTRA - returns the user's XTRA info
COMMENT - returns the master-visible only comment for the user
EMAIL - returns the user's e-mail address
URL - returns the user's url
HANDLE - returns the user's handle as it is saved in the userfile
PASS - returns the user's encrypted password
Returns: info specific to each entry-type
Module: core

setuser <handle> <entry-type> [extra info]
Description: this is the counterpart of getuser. It lets you set the
various values. Other then the ones listed below, the entry-types are
the same as getuser's.
PASS - sets a users password (no third arg will clear it)
HOSTS - if used with no third arg, all hosts for the user will be
be cleared. Otherwise, *1* hostmask is added Razz
LASTON - This setting has 3 forms. "setuser <handle> LASTON
<unixtime> <place>" sets global LASTON time, "setuser
<handle> LASTON <unixtime>" sets global LASTON time
(leaving the place field empty), and "setuser <handle>
LASTON <unixtime> <channel>" sets a users LASTON time for
a channel (if it is a valid channel).
Returns: nothing
Module: core

can't remember I've seen a remhots/delhost command, perhapse it was being provided by some other script?
something like this might work though
Code:
# remhost <user> <hostmask>
#returns 1 if ok, 0 if not
proc remhost {user host} {
   if {([validuser $user]) && ([set ind [lsearch -exact [set hostlist [getuser $user HOSTS]] $host]] != -1)} {
      set hostlist [lreplace $hostlist $ind $ind]
      foreach {h} $hostlist { setuser $user HOSTS $h }
      return 1
   } else {
      return 0
   }
}

_________________
Elen sila lúmenn' omentielvo
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
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