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 

help in tcl ping for FlyBoyUSA

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Arnold_X-P
Op


Joined: 30 Oct 2006
Posts: 140
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Tue Jan 10, 2017 1:38 am    Post subject: help in tcl ping for FlyBoyUSA Reply with quote

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
_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Arnold_X-P
Op


Joined: 30 Oct 2006
Posts: 140
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Wed Feb 08, 2017 10:30 pm    Post subject: Re: help in tcl ping for FlyBoyUSA Reply with quote

some help please... Crying or Very sad Crying or Very sad Crying or Very sad Crying or Very sad
_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
willyw
Owner


Joined: 15 Jan 2009
Posts: 921

PostPosted: Thu Feb 09, 2017 11:30 am    Post subject: Re: help in tcl ping for FlyBoyUSA Reply with quote

#
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
View user's profile Send private message
Arnold_X-P
Op


Joined: 30 Oct 2006
Posts: 140
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Thu Feb 09, 2017 10:13 pm    Post subject: Re: help in tcl ping for FlyBoyUSA Reply with quote

thanks willyw Smile thank you very much

I will try to extract the global variant to use all the commands..
_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Arnold_X-P
Op


Joined: 30 Oct 2006
Posts: 140
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Thu Feb 09, 2017 10:25 pm    Post subject: Re: help in tcl ping for FlyBoyUSA Reply with quote

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
_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Arnold_X-P
Op


Joined: 30 Oct 2006
Posts: 140
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Sat Sep 16, 2017 4:07 pm    Post subject: Re: help in tcl ping for FlyBoyUSA Reply with quote

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.
_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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