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.

script to capture ip addresses and return with command

Help for those learning Tcl or writing their own scripts.
Post Reply
l
luishfer
Voice
Posts: 1
Joined: Sun Oct 03, 2010 11:40 pm

script to capture ip addresses and return with command

Post by luishfer »

I have this script in .mrc language

Code: Select all

on *:TEXT:*189.*:#: {
  set %ipset $1-
  set %ipnick $nick
  set %iptime $time
}
on *:TEXT:*200.*:#: {
  set %ipset $1-
  set %ipnick $nick
  set %iptime $time
}
on *:TEXT:*201.*:#: {
  set %ipset $1-
  set %ipnick $nick
  set %iptime $time
}
on *:TEXT:*187.*:#: {
  set %ipset $1-
  set %ipnick $nick
  set %iptime $time
}
on *:TEXT:!mix:#: {
  set %timer $remove($time,:)
  if %timer > 235959 {
    set %timer $calc(%timer - 235959)
  }
  if $calc(%timer2 - %timer) > 15 {
    set %timer2 000000
  }
  if %timer > %timer2 {
    set %timer2 $calc(%timer + 15)
    if %timer2 > 235959 {
      set %timer2 $calc(%timer2 - 235959)
    }
    /msg $chan 7,1Ultimo mix enviado: %ipset   1,8[ 5Enviado por10,8 %ipnick 5,8às10,8 %iptime 1,8]
  }
  else {
    set %left $calc(%timer2 - (%timer + 1))
    /notice $nick O canal $chan limita o uso do comando !mix. Aguarde %left segundo(s) para poder usa-lo.  
  }
}
the objective of this script is capture the last message with containing some ip address and return the ip address when someone say !mix (public command), the command !mix can be used only once every 15 seconds, otherwise returns a message informing how much time remains to complete 15 seconds

would look like in tcl?
Post Reply