View previous topic :: View next topic |
Author |
Message |
Arnold_X-P Op

Joined: 30 Oct 2006 Posts: 166 Location: DALnet - Trinidad - Beni - Bolivia
|
Posted: Tue Jan 10, 2017 1:38 am Post subject: help in tcl ping for FlyBoyUSA |
|
|
good morning to all
I extended a very good tcl and it me works very well
Code: | ########### PiNG THiNGiE 1.0 ############
# designed and programmed by FlyBoyUSA #
# for original use in #emuroms Undernet #
#########################################
# Bug reports and ideas goto flyboyus@modex.com
# I love comments, complaints, death threats, and suggestions :-)
set pingscommands "!ping .ping ”ping ping !pingme .pingme ”pingme pingme !lag .lag ”lag lag !lagme .lagme ”lagme lagme"
foreach pingsnicks [split $pingscommands] { bind pub - $pingsnicks ping_me }
bind ctcr - PING ping_me_reply
proc ping_me {nick uhost hand chan arg} {
global pingchan pingwho
set arg [string toupper $arg]
if {$arg == "ME" } {
putserv "PRIVMSG $nick :\001PING [clock clicks -milliseconds]\001"
set pingwho 0
set pingchan $chan
return 1
} else {
if {$arg == "" } {
putserv "PRIVMSG $nick :\001PING [clock clicks -milliseconds]\001"
set pingwho 0
set pingchan $chan
return 1
} else {
putserv "PRIVMSG $arg :\001PING [clock clicks -milliseconds]\001"
set pingwho 1
set pingchan $chan
return 0
}
}
}
proc ping_me_reply {nick uhost hand dest key arg} {
global pingchan pingwho
set lagg [expr {abs([clock clicks -milliseconds] - $arg) / 1000.0}]
if {$pingwho == 0} {
puthelp "PRIVMSG $pingchan :PiNG THiNGiE - $nick your ping is $lagg"
return 0
} elseif {$pingwho == 1} {
puthelp "PRIVMSG $pingchan :PiNG THiNGiE - looking at the ping of $nick is $lagg"
return 0
}
}
bind raw - 401 no:such:nick
proc no:such:nick {from keyword arg} {
global pingchan
if {[info exists pingchan]} {
set nickspingnosuch [lindex [split $arg] 1]
foreach pichans $pingchan {
putserv "PRIVMSG $pichans :10$nickspingnosuch No such nick"
unset -nocomplain -- pingchan pichans ; break
} } }
putlog "PiNG THiNGiE 1.0 by FlyBoyUSA Loaded" |
it works very well
my question is it will be that the tcl also could recognize also the orders in actions
help me please _________________
thanks to that they help, that others learn  |
|
Back to top |
|
 |
Arnold_X-P Op

Joined: 30 Oct 2006 Posts: 166 Location: DALnet - Trinidad - Beni - Bolivia
|
Posted: Wed Feb 08, 2017 10:30 pm Post subject: Re: help in tcl ping for FlyBoyUSA |
|
|
some help please...  _________________
thanks to that they help, that others learn  |
|
Back to top |
|
 |
willyw Owner
Joined: 15 Jan 2009 Posts: 957
|
Posted: Thu Feb 09, 2017 11:30 am Post subject: Re: help in tcl ping for FlyBoyUSA |
|
|
# Code: | ########### PiNG THiNGiE 1.0 ############
# designed and programmed by FlyBoyUSA #
# for original use in #emuroms Undernet #
#########################################
# Bug reports and ideas goto flyboyus@modex.com
# I love comments, complaints, death threats, and suggestions :-)
set pingscommands "!ping .ping ”ping ping !pingme .pingme ”pingme pingme !lag .lag ”lag lag !lagme .lagme ”lagme lagme"
foreach pingsnicks [split $pingscommands] { bind pub - $pingsnicks ping_me }
bind ctcr - PING ping_me_reply
##########################
bind ctcp - "ACTION" ctcp_pingscript_proc
proc ctcp_pingscript_proc {nick uhost hand dest keyword text} {
if {$keyword eq "ACTION" && [lindex [split $text] 0] eq ".ping" } {
ping_me $nick $uhost $hand $dest [lrange [split $text] 1 end ]
}
}
################
proc ping_me {nick uhost hand chan arg} {
global pingchan pingwho
set arg [string toupper $arg]
if {$arg == "ME" } {
putserv "PRIVMSG $nick :\001PING [clock clicks -milliseconds]\001"
set pingwho 0
set pingchan $chan
return 1
} else {
if {$arg == "" } {
putserv "PRIVMSG $nick :\001PING [clock clicks -milliseconds]\001"
set pingwho 0
set pingchan $chan
return 1
} else {
putserv "PRIVMSG $arg :\001PING [clock clicks -milliseconds]\001"
set pingwho 1
set pingchan $chan
return 0
}
}
}
proc ping_me_reply {nick uhost hand dest key arg} {
global pingchan pingwho
set lagg [expr {abs([clock clicks -milliseconds] - $arg) / 1000.0}]
if {$pingwho == 0} {
puthelp "PRIVMSG $pingchan :PiNG THiNGiE - $nick your ping is $lagg"
return 0
} elseif {$pingwho == 1} {
puthelp "PRIVMSG $pingchan :PiNG THiNGiE - looking at the ping of $nick is $lagg"
return 0
}
}
bind raw - 401 no:such:nick
proc no:such:nick {from keyword arg} {
global pingchan
if {[info exists pingchan]} {
set nickspingnosuch [lindex [split $arg] 1]
foreach pichans $pingchan {
putserv "PRIVMSG $pichans :10$nickspingnosuch No such nick"
unset -nocomplain -- pingchan pichans ; break
} } }
putlog "PiNG THiNGiE 1.0 by FlyBoyUSA Loaded"
|
Try this.
You can see the edits/additions with #### above and below them.
This is untested. Sorry.
Additions will only work with the command:
.ping
I hope this helps. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
Back to top |
|
 |
Arnold_X-P Op

Joined: 30 Oct 2006 Posts: 166 Location: DALnet - Trinidad - Beni - Bolivia
|
Posted: Thu Feb 09, 2017 10:13 pm Post subject: Re: help in tcl ping for FlyBoyUSA |
|
|
thanks willyw thank you very much
I will try to extract the global variant to use all the commands.. _________________
thanks to that they help, that others learn  |
|
Back to top |
|
 |
Arnold_X-P Op

Joined: 30 Oct 2006 Posts: 166 Location: DALnet - Trinidad - Beni - Bolivia
|
Posted: Thu Feb 09, 2017 10:25 pm Post subject: Re: help in tcl ping for FlyBoyUSA |
|
|
I achieved it extracted the variant for that he looks and it me works of marvel
now he recognizes all the commands ping & lag (for nicks)
Code: | ########### PiNG THiNGiE 1.0 ############
# designed and programmed by FlyBoyUSA #
# for original use in #emuroms Undernet #
#########################################
# Bug reports and ideas goto flyboyus@modex.com
# I love comments, complaints, death threats, and suggestions :-)
# updated for Arnold_X-P email urquizoandrade@hotmail.com /server irc.dal.net channel #tcls my nick's Arnold_X-P & sedition 09/FEB/2017
# thanks to willyw, for the variant in action (/me ping or /me ping nickname)
# this tcl recognizes commands in public and also privately and actions.
set pingscommands "!ping .ping ”ping ping !pingme .pingme ”pingme pingme !lag .lag ”lag lag !lagme .lagme ”lagme lagme"
foreach pingsnicks [split $pingscommands] { bind pub - $pingsnicks ping_me }
foreach pingmsge [split $pingscommands] { bind msg - $pingmsge msg_ping }
proc msg_ping {nick uhost hand arg} {
ping_me $nick $uhost $hand $nick $arg
}
bind ctcp - "ACTION" ctcp_pingscript_proc
proc ctcp_pingscript_proc {nick uhost hand dest keyword text} {
if {[string match -nocase "*ping*" $text] || [string match -nocase "*lag*" $text]} {
ping_me $nick $uhost $hand $dest [lrange [split $text] 1 end ]
}
}
proc ping_me {nick uhost hand chan arg} {
global pingchan pingwho
set arg [string toupper $arg]
if {$arg == "ME" } {
putserv "PRIVMSG $nick :\001PING [clock clicks -milliseconds]\001"
set pingwho 0
set pingchan $chan
return 1
} else {
if {$arg == "" } {
putserv "PRIVMSG $nick :\001PING [clock clicks -milliseconds]\001"
set pingwho 0
set pingchan $chan
return 1
} else {
putserv "PRIVMSG $arg :\001PING [clock clicks -milliseconds]\001"
set pingwho 1
set pingchan $chan
return 0
}
}
}
bind ctcr - PING ping_me_reply
proc ping_me_reply {nick uhost hand dest key arg} {
global pingchan pingwho
set pingtarget [lindex $arg 0]
set lagg [expr {abs([clock clicks -milliseconds] - $pingtarget) / 1000.0}]
if {$pingwho == 0} {
puthelp "PRIVMSG $pingchan :PiNG THiNGiE - $nick your ping is $lagg"
return 0
} elseif {$pingwho == 1} {
puthelp "PRIVMSG $pingchan :PiNG THiNGiE - looking at the ping of $nick is $lagg"
return 0
}
}
bind raw - 401 no:such:nick
proc no:such:nick {from keyword arg} {
global pingchan
if {[info exists pingchan]} {
set nickspingnosuch [lindex [split $arg] 1]
putserv "PRIVMSG $pingchan :10$nickspingnosuch No such nick."
unset pingchan ;
} }
putlog "PiNG THiNGiE 1.0 by FlyBoyUSA - updated for Arnold_X-P Loaded" |
thanks willyw _________________
thanks to that they help, that others learn  |
|
Back to top |
|
 |
Arnold_X-P Op

Joined: 30 Oct 2006 Posts: 166 Location: DALnet - Trinidad - Beni - Bolivia
|
Posted: Sat Sep 16, 2017 4:07 pm Post subject: Re: help in tcl ping for FlyBoyUSA |
|
|
error in tcl:
the nickname goes out and goes out again... << in the channel
[19:45] * daniel77 (~daniel77@190.186.242.22) Quit (Quit: )
[20:08] <@Kantuta> daniel77 No such nick. _________________
thanks to that they help, that others learn  |
|
Back to top |
|
 |
Arnold_X-P Op

Joined: 30 Oct 2006 Posts: 166 Location: DALnet - Trinidad - Beni - Bolivia
|
Posted: Sun Oct 29, 2017 7:45 pm Post subject: Re: help in tcl ping for FlyBoyUSA |
|
|
final code and working very well..
Code: | ########### PiNG THiNGiE 1.0 ############
# designed and programmed by FlyBoyUSA #
# for original use in #emuroms Undernet #
#########################################
# Bug reports and ideas goto flyboyus@modex.com
# I love comments, complaints, death threats, and suggestions :-)
# updated for Arnold_X-P email urquizoandrade@hotmail.com /server irc.dal.net channel #tcls my nick's Arnold_X-P & sedition 09/FEB/2017
# thanks to willyw, for the variant in action (/me ping or /me ping nickname)
# tambien estoy en irc.chatzona.org canal #eggdrop.conf mi correo urquizoandrade@hotmail.com mis nicks Arnold_X-P y sedition
# this tcl recognizes commands in public and also privately and actions.
set pingscommands "!ping .ping ”ping ping !pingme .pingme ”pingme pingme !lag .lag ”lag lag !lagme .lagme ”lagme lagme"
foreach pingsnicks [split $pingscommands] { bind pub - $pingsnicks ping_me }
foreach pingmsge [split $pingscommands] { bind msg - $pingmsge msg_ping }
proc msg_ping {nick uhost hand arg} {
ping_me $nick $uhost $hand $nick $arg
}
bind ctcp - "ACTION" ctcp_pingscript_proc
proc ctcp_pingscript_proc {nick uhost hand dest keyword text} {
if {[string match -nocase "*ping*" $text] || [string match -nocase "*lag*" $text]} {
ping_me $nick $uhost $hand $dest [lrange [split $text] 1 end ]
}
}
proc ping_me {nick uhost hand chan arg} {
global pingchan pingwho
if {[string equal -nocase "me" $arg] } {
putserv "PRIVMSG $nick :\001PING [clock clicks -milliseconds]\001"
set pingwho 0
set pingchan $chan
return 1
} else {
if {$arg == "" } {
putserv "PRIVMSG $nick :\001PING [clock clicks -milliseconds]\001"
set pingwho 0
set pingchan $chan
return 0
} else {
putserv "PRIVMSG $arg :\001PING [clock clicks -milliseconds]\001"
set pingwho 1
set pingchan $chan
return 1
}
}
}
bind ctcr - PING ping_me_reply
proc ping_me_reply {nick uhost hand dest keyword arg} {
global pingchan pingwho
set pingtarget [lindex $arg 0]
set lagg [expr {abs([clock clicks -milliseconds] - $pingtarget) / 1000.0}]
if {$pingwho == 0} {
puthelp "PRIVMSG $pingchan :PiNG THiNGiE - $nick your ping is $lagg"
return 0
} elseif {$pingwho == 1} {
puthelp "PRIVMSG $pingchan :PiNG THiNGiE - looking at the ping of $nick is $lagg"
unset pingchan
}
return 0
}
bind raw - 401 no:such:nick
proc no:such:nick {from keyword arguments} {
global pingchan
if {[info exists pingchan]} {
set nickspingnosuch [lindex [split $arguments] 1]
putserv "PRIVMSG $pingchan :10$nickspingnosuch No such nick."
unset pingchan ; } }
putlog "PiNG THiNGiE 1.0 by FlyBoyUSA - updated for Arnold_X-P Loaded" |
_________________
thanks to that they help, that others learn  |
|
Back to top |
|
 |
|