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.

Undernet New Code, Request For New TCL

Old posts that have not been replied to for several years.
Locked
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Undernet New Code, Request For New TCL

Post by blood_x »

Hi all,

Recently, undernet has upgrade their IRC software to have utility to hiding their users hostname. To use this mode, someone should have undernet username. When someone login to X, and then, he/she type /mode his_her_username +x, it will be MyNick!Myidentd@his_her_username.users.undernet.org when someone whois he/she. For more info about it, http://www.undernet.org/show_news.php?main_n_id=36

Anyone can make TCL script that can hide bot/eggdrop hostname, such as mentioned above.

Thanks.
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Re: Undernet New Code, Request For New TCL

Post by egghead »

blood_x wrote:Hi all,

Recently, undernet has upgrade their IRC software to have utility to hiding their users hostname.

Anyone can make TCL script that can hide bot/eggdrop hostname, such as mentioned above.

Thanks.
What you need to do is "bind EVNT - init-server" and when this bind is triggered login to X and set the mode to +x.
The only problem exists when the service X is not there when the bot attempts to connect to the server.

Anyway, my work in progress is http://members.fortunecity.com/eggheadt ... ex.tcl.txt
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

From what I see on most networks (note, I aint no expert, and I don't use services), the service bots, are located as a seperate connection, into the network.

Requests to auth (even usign built-in server commands, rather than msg commands), are forwarded onto the service bot, before being confirmed.

As such, simply setting +x, straight after sending the auth command, would not allways work.

Part due to X not allways being there, and the rest, due to lag, and sending the +x mode too quickly after the auth command (IE, sending +x, before having permission to do so).
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

ppslim wrote:From what I see on most networks (note, I aint no expert, and I don't use services), the service bots, are located as a seperate connection, into the network.

Requests to auth (even usign built-in server commands, rather than msg commands), are forwarded onto the service bot, before being confirmed.

As such, simply setting +x, straight after sending the auth command, would not allways work.

Part due to X not allways being there, and the rest, due to lag, and sending the +x mode too quickly after the auth command (IE, sending +x, before having permission to do so).
Heh, I'm not an expert in these services either :) I assumed the +x mode is stored on the server and the LOGIN being sent to the services. What I noticed on undernet is that it is allowed to set the usermode +x and after that login to the services.
I also noticed that not all undernet servers already run this.
Anyway, in the script provided, both the LOGIN and the mode +x are sent out simultaneously. If the procedure fails on the initial connect (because X is not there) the script checks on a regular basis on the botname variable.
E
Exploited

Post by Exploited »

I'm using the xw_login.tcl that can be found on egghelp.org ...

There is allready a bind in it:

Code: Select all

bind notc - "AUTHENTICATION SUCCESSFUL*" xw_logged

# cut

proc xw_logged {cserv uhost handl logtext {target ""}} {
global log_x botnick
if {$target == ""} { set target $botnick }
set trimuh [string trimleft $uhost $cserv!]
if {$trimuh == "cservice@undernet.org"} {
set log_status [lindex $logtext 3]
putlog "÷ $log_status logged in to $cserv ($trimuh) ÷"
                set log_x 1
}
}
Adding the line

Code: Select all

putserv "MODE $botnick +x"
right after set log_x 1 will do the job I think ...
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Post by blood_x »

Dear Egghead,

I can't download that tcl.

"Anyway, my work in progress is http://members.fortunecity.com/eggheadt ... ex.tcl.txt"

Hum, if X is split for a long time or vacation, I think it is difficult for eggdrop to recognize user by that hostname, rite.. wow, undernet coder should fixed it.. more to server options, not to X..

Anyway I need this TCL to research this mode on undernet.org server..

Thanks.
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

blood_x wrote:Dear Egghead,

I can't download that tcl.

"Anyway, my work in progress is http://members.fortunecity.com/eggheadt ... ex.tcl.txt"

Hum, if X is split for a long time or vacation, I think it is difficult for eggdrop to recognize user by that hostname, rite.. wow, undernet coder should fixed it.. more to server options, not to X..

Anyway I need this TCL to research this mode on undernet.org server..

Thanks.
Then copy and paste from here. If the X service is away/splitted/on vacation, users will prolly not be able to login to this service and can not get the username.users.undernet.org host. But, I'm not an avid undernet/X user so I don't know how often this happens ;)

Code: Select all

#---------------------------------------------------------------------
# undernetmodex.tcl
# Tcl script for IRC bot eggdrop
#
# This script logs the bot into the X service on undernet and sets
# usermode +x. 
# The bot will be visible with the uhost username.users.undernet.org
#
# v0: 16-Oct-2002
# v1: 16-Oct-2002
# + send out a "WHOIS botnick" to update the botname.
#---------------------------------------------------------------------

# set these variables in the main config file just before sourcing
# this tcl.
# Do not set these variables in this script.
# set undernetusername hello
# set undernetpassword world

package require eggdrop 1.6
package require Tcl 8.0

bind EVNT - init-server undernetmodex:init
bind TIME - * undernetmodex:time

proc undernetmodex:init { args } {

   # login

   undernetmodex:login

}

proc undernetmodex:time { args } {

   # check every 15 minutes

   set secs [clock seconds]
   set mins [expr round($secs/60.0)]
   if {[expr $mins % 15]} { return 0 }

   # login

   undernetmodex:login

}

proc undernetmodex:login { args } {

   global botname
   global botnick
   global undernetusername
   global undernetpassword

   # check current botname

   set currenthost [lindex [split $botname "@"] 1]

   append desiredhost $undernetusername ".users.undernet.org"

   if { $currenthost == $desiredhost } { return 0 }

   # username and password exist?

   if {![info exists undernetusername]} {
      putlog "Login to X failed: Undernet username does not exist."
      return 0
   }

   if {![info exists undernetpassword]} {
      putlog "Login to X failed: Undernet password does not exist."
      return 0
   }

   # login and mode +x

   set X {X@channels.undernet.org}

   putserv "PRIVMSG $X :LOGIN $undernetusername $undernetpassword"

   putserv "MODE $botnick +x"

   # It seems that "botname" is not updated after connecting to
   # the server. Subsequently, if the login procedure failed upon
   # connecting to the server, comparing the botname with the
   # desired name will always fail and the bot will continue to
   # attempt to login to X and change mode +x.
   # Workaround: send out a WHOIS and let the bot process the result.

   puthelp "WHOIS $botnick"

}

putlog "UndernetModeX version 1 loaded."
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Post by blood_x »

Dear Egghead,

Thx for the script and it work on undernet.org when X is alive but do not know if X is dead.. hehe :)

When I add to my eggdrop, it works 100% for mode +x, but when I -o (deop) my eggdrop, my bot cannot op himself through X. Can u set, when someone deop my eggdrop, my bot will automatically +o via privmsg to X again or by adding more short time (in seconds) to check whether my bot ischanop or not..

For example:
MyBot!myident@myusername.users.undernet.org has join #mychannel
X set mode +o MyBot
X set mode -o Mybot (request by other users)
X set mode +o MyBot <- Automatically rescan if mybot doesn't have an op

Thanks.
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

blood_x wrote: Thx for the script and it work on undernet.org when X is alive but do not know if X is dead.. hehe :)
If X is dead, there is not much you can do anyway :) Nevertheless, according to undernet's website, once you are logged in, you stay logged in.
When I add to my eggdrop, it works 100% for mode +x, but when I -o (deop) my eggdrop, my bot cannot op himself through X. Can u set, when someone deop my eggdrop, my bot will automatically +o via privmsg to X again or by adding more short time (in seconds) to check whether my bot ischanop or not..

For example:
MyBot!myident@myusername.users.undernet.org has join #mychannel
X set mode +o MyBot
X set mode -o Mybot (request by other users)
X set mode +o MyBot <- Automatically rescan if mybot doesn't have an op

Thanks.
The straightforward thing to do is to set the need-op variable using .chanset.
Or you can make a tcl with "bind NEED". Such scripts are only a few lines and probably available at this site.

An example script (for a different net though, so you need to modify) is:

http://members.fortunecity.com/eggheadt ... op.tcl.txt

If you can't view that file either, let it know.
User avatar
blood_x
Halfop
Posts: 77
Joined: Tue Nov 20, 2001 8:00 pm
Location: KL, Malaysia
Contact:

Post by blood_x »

I can't download that file too.. :roll: When I enter ur website, the msg below appears;

We're sorry, but we can't supply the file you requested.

In order for us to continue to provide our members with the first-class service they expect, we don't allow people to link files from sites hosted with other providers.

Nevemind, u can paste ur script here :D . I have .chanset #mychan need-op putserv "PRIVMSG X op mybotnick" but it doesn't work effectively.. (Long time to wait for mybot to request op again if using .chanset need-op..) Then, i decide to combine Umodex.tcl (written by you) and ucsx.tcl (written by Don norske, update by MC_8), and it work fine.. but i dun know the impact of using 2 TCL login script for 1 IRC server.. hehe 8)
Thank you for your support and commitments.

Sincerely,
fzAy®
http://www.iNTRACyber.com
(We Chat, We Share & We Learn)
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

blood_x wrote:I can't download that file too.. :roll: When I enter ur website, the msg below appears;

We're sorry, but we can't supply the file you requested.

In order for us to continue to provide our members with the first-class service they expect, we don't allow people to link files from sites hosted with other providers.

Nevemind, u can paste ur script here :D . I have .chanset #mychan need-op putserv "PRIVMSG X op mybotnick" but it doesn't work effectively.. (Long time to wait for mybot to request op again if using .chanset need-op..) Then, i decide to combine Umodex.tcl (written by you) and ucsx.tcl (written by Don norske, update by MC_8), and it work fine.. but i dun know the impact of using 2 TCL login script for 1 IRC server.. hehe 8)
Hmm.. thats a weird error message you get from fortunecity. It seems it is time to move my scripts somewhere else again.
You should be able to copy and paste the url and get the page.

That script there is simply a "bind NEED" which has the same effect as setting the need-op setting, which, I think, checks every minute for the @ status of the bot and upon a deop it directly executes the need-op and the "bind NEED".

You can check more often, like every 5 seconds, but under lagged conditions, this can lead to your bot flooding X with operator requests. And undernet would be very right of setting a gline in such case 8)

If the ucsx tcl also logs in into X, you should be able to modify it to send out a "MODE $botnick +x" at the appropriate occasion. Then there is no need for the undernetmodex.tcl :)
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

After just checking the ucsx tcl script as available on this site, I would advise to use the need-op setting or a "bind NEED" script.

The dalnet example, which is more comment than code, I've pasted below. You'll need to edit it for use on undernet.

Code: Select all

#---------------------------------------------------------------------
# dalnetneedop.tcl
# TCL script for IRC bot eggdrop
#
# This scripts attempts to keep the bot opped on the dalnet channels
# the bot monitors.
# The bot must be able to get operator status on each channel
# through chanserv. 
#
# v0: 15-May-2002
#---------------------------------------------------------------------

package require eggdrop 1.6.9

#---------------------------------------------------------------------
# Bindings
#---------------------------------------------------------------------

bind need - * dalnetneedop

#---------------------------------------------------------------------
# Procedure triggered by need binding 
#---------------------------------------------------------------------

proc dalnetneedop { channel type } {

   global botnick
   global dalnetneedopstamp

   # check the need type...

   if { $type != "op" } { return }

   # Use timestamp to avoid too many requests for +o in case of
   # "mode -ooo botnick botnick botnick".
   # Possibly eggdrop's queue system removes the identical 
   # requests send to chanserv anyway.

   if {![info exists dalnetneedopstamp]} { set dalnetneedopstamp 0 }

   set chantime "$channel [unixtime]"

   if { $chantime == $dalnetneedopstamp } { return }

   set chanserv chanserv@services.dal.net

   putserv "PRIVMSG $chanserv :OP $channel $botnick"

   set dalnetneedopstamp $chantime

}

putlog "Dalnet needop version 0 loaded."
Locked