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.

My own Dal.net services need minor help ALMOST DONE!!!!

Old posts that have not been replied to for several years.
Locked
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

My own Dal.net services need minor help ALMOST DONE!!!!

Post by Gothic-Angel »

Code: Select all

set nickpass "password"
set channame "#channel"
set nickserv "nickserv@services.dal.net"
set chanserv "chanserv@services.dal.net"

bind time - "10 * *" services_check
bind notc - "*You do not have access to op people*" services_ident 
bind notc - "*Password accepted*" services_accept

proc services_check {nick uhost hand chan args} {
 global botnick chanserv channame
if {![botisop $channame]} {
putlog "Uhhhh im not oped trying to op"
putserv "PRIVMSG $chanserv :OP $channame $botnick" }
}
proc services_ident { nick uhost hand args } {
 global botnick nickpass nickserv
putlog "Services: Trying to identify with nickserv"
putserv "PRIVMSG $nickserv :identify $nickpass"

proc services_accept { nick uhost hand args } {
 global botnick chanserv channame
putlog "Trying to op myself"
putserv "PRIVMSG $chanserv :OP $channame $botnick" } 
}
putlog "DALnetServices Version 1.0 loaded by Kyle@DALnet & ^JustinTime^@DALnet"
The line where he idents to chanserv
if {![botisop $channame]}


We want to make him ping chaserv and if chanserv returns with the message Error then to go ahead and send the command to op meaning chanserv isn't down/lagged.

The problem with other scripts is they don't check to see if chanserv is lagged and if its lagged the script hammers the hell out of chanserv.

Me and Kyle are new to tcl and we did this together, were sooo close to being finished. It works now as is, but I'd really like to add in those "protections".

I appreciate all help

I figured I should explain more hence this edit, when you ping just "chanserv" without the extension like "chanserv@services.dal.net" you get an an error like ChanServ- Error! "/msg ChanServ" is no longer supported. Use "/msg chanserv@services.dal.net" or "/chanserv" instead.

or I could actually ping chanserv@services.dal.net and get a ping reply.

So either make him only execute the command to ophimself when you get that "error" or when you get an actual ping reply from chanserv, it doesnt matter each will say that chanserv is a alive and kicking. If he doesnt get that reply we would like him to just not do anything until the next time check, once were done he will check say every 10 mins.
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

Code: Select all

set nickpass "pass"
set channame "chan"
set nickserv "nickserv@services.dal.net"
set chanserv "chanserv@services.dal.net"

bind notc - "*This nick is owned by someone else*" services_ident
bind notc - "*Password accepted*" services_ping
bind notc - "*Error*" services_op

bind time - "5 * *" services_check
bind time - "10 * *" services_check
bind time - "15 * *" services_check
bind time - "20 * *" services_check
bind time - "25 * *" services_check
bind time - "30 * *" services_check
bind time - "35 * *" services_check
bind time - "40 * *" services_check
bind time - "45 * *" services_check
bind time - "50 * *" services_check
bind time - "55 * *" services_check
bind time - "00 * *" services_check



proc services_ident { nick uhost hand args } {
 global botnick nickpass nickserv
putlog "Services: Trying to identify with nickserv"
putserv "PRIVMSG $nickserv :identify $nickpass"
}

proc services_ping {nick uhost hand args} {
putlog "PING: Trying to ping chanserv"
putserv "PRIVMSG chanserv :\001PING chanserv"
}

proc services_op {nick uhost hand args} {
global botnick chanserv channame
putlog "Trying to op myself"
putserv "PRIVMSG $chanserv :OP $channame $botnick"
}

proc services_check {nick uhost hand chan args} {
 global botnick chanserv channame
putlog "Lost ops trying to opmyself."
if {![botisop $channame] && [putserv "PRIVMSG $chanserv :\001PING $nick"] == < 25}  {
putserv "PRIVMSG $chanserv :OP $channame $botnick" }
}
that one line where I ping chanserv

Code: Select all

if {![botisop $channame] && [putserv "PRIVMSG $chanserv :\001PING $nick"] == < 25}  {

is a test to see if that works since I can't figure out how to make it finish the proc since I can't see that to == 1


So any idea's of how to make the bot finish the proc if the ping returns??


The reply's I get from chanserv say its 5:00 I get

<CustomerServ|ce> [05:00] CTCP reply PING: 00 from ChanServ (service@dal.net) to CustomerServ|ce
if its 5:05 the reply will be 05 and so on

Ok well I seem to have fixed the reply. This is now the reply

<CustomerServ|ce> [06:20] CTCP reply PING: chanserv@services.dal.net from ChanServ (service@dal.net) to CustomerServ|ce

How do I make that trigger the proc to go forward??

I have tried if {![botisop $channame] && [putserv "PRIVMSG $chanserv :\001PING $nick"] == :\001PING} {
no go
if {![botisop $channame] && [putserv "PRIVMSG $chanserv :\001PING $nick"] == PING} {
if {![botisop $channame] && [putserv "PRIVMSG $chanserv :\001PING $nick"] == 1} {
still no go agh, im sooo close.
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

So far I'v come to realize, the proc im using doesn't ask for a return value, so that's when I searched the forum for "ping". I found a script by PPSlim, that uses ctcr, which is the reply. I'v added onto the script to add public commands since the bot is +R if we can't dcc it and it needs a quick op to make it identify then op, thats about all. However im still using the "error" as the way since I can't return the ping. If you ping just "chanserv" instead of "chanserv@services.dal.net" you get an error. I used that error to say chanserv is alive. I'd really like to remove this "duct tape" and make him op when a ping reply is returned.. Thats where I need the help on how to return a ping reply and if that ping reply then trigger the proc.. Here is the tcl as of now.

Code: Select all

set nickpass "mychan"
set channame "mychan"
set nickserv "nickserv@services.dal.net"
set chanserv "chanserv@services.dal.net"
set blah "!"
set error "Error! /msg ChanServ is no longer supported. Use /msg chanserv@services.dal.net or /chanserv instead"

bind notc - "*This nick is owned by someone else*" services_ident
bind notc - "*Password accepted*" services_ping
bind notc - "*Error*" services_op
bind notc - "*You do not have access to op people*" services_ident

bind time - "5 * *" services_check
bind time - "10 * *" services_check
bind time - "15 * *" services_check
bind time - "20 * *" services_check
bind time - "25 * *" services_check
bind time - "30 * *" services_check
bind time - "35 * *" services_check
bind time - "40 * *" services_check
bind time - "45 * *" services_check
bind time - "50 * *" services_check
bind time - "55 * *" services_check
bind time - "00 * *" services_check
bind pub n|n ${blah}identfiy pub:ident
bind pub n|n ${blah}op pub:op


proc services_ident { nick uhost hand args } {
global botnick nickpass nickserv
putlog "Services: Trying to identify with nickserv"
putserv "PRIVMSG $nickserv :identify $nickpass"
}

proc services_ping {nick uhost hand args} {
putlog "PING: Trying to ping chanserv"
putserv "PRIVMSG chanserv :\001PING chanserv"
}

proc services_op {nick uhost hand args} {
global botnick chanserv channame
putlog "Trying to op myself"
putserv "PRIVMSG $chanserv :OP $channame $botnick"
}

proc services_check {nick uhost hand chan args} {
global botnick channame chanserv error
if {![botisop $channame] && [putserv "PRIVMSG chanserv :\001PING chanserv"] == $error } {
putlog "Lost ops trying to opmyself."
putserv "PRIVMSG $chanserv :OP $channame $botnick" }
}

proc pub:ident {nick host hand chan text} {
global botnick nickpass nickserv
putserv "PRIVMSG $nickserv :identify $nickpass"
}

proc pub:op {nick host hand chan text} {
global botnick chanserv channame
putserv "PRIVMSG $chanserv :OP $channame $botnick"
}
I have tried quite a few things but now im totally lost as to how to return that reply. If I could find an example of a script that pings someone then if the ping reply returns the script does "blah" then I'd be good to go..

Could really use some help.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

bind ctcr - "*error*" services_op

^^ you tried that?
Elen sila lúmenn' omentielvo
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

bind ctcr - "PING" chanserv:returnping
The best way to do things.

Setup a timer, that will activate after 30 seconds. The timer command returns a timer ID string, you will need to store this for simplicity.

Now, create a list, with all the lines you wish to send to the server, if chanserv is alive.

Place both the items above, in a global variable, so they can be read later.

If a ping is returned in under 30 seconds, the code that exacutes, should kill the timer, with the stored timer ID, and then send the details to the server.

If the ping times out, make the command the timer calls, delete the stored details, so that you are not sending stale messages later.

There are many ways to go abotu doing the various tasks, the one above, is the most versitile, as it can be used to send other information to chanserv, like invite requests, unban requests and so on, while checking to see if chanserv is there first.
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

hmm I tried adding a whole proc to ctcr, so ctcr, is just that the reply?

so life bind ctcr to my op command will make trigger the op command on the reply?

Ill give that a go.
Locked