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.

Autonick changer + some futures

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Arkadietz
Halfop
Posts: 67
Joined: Fri Jul 14, 2006 11:43 am
Location: cat /dev/zero > /dev/null;

Autonick changer + some futures

Post by Arkadietz »

To has a list where i can put my nicks
To has a timer ( can be set ) how long the bot stay in channel/s
To has a timer ( can be set ) how long the bot stay out of channel/s before join again ( change nick before join )

Example:

[12:00:00] * nick (ident@somehost.com) has joined #chan
[12:45:00] * nick (ident@somehost.com) has left #chan
[13:00:00] * nick2 (ident@somehost.com) has joined #chan
On a unix system everything is a file ; if something is not a file , it is a proccess.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Maybe something like this...

Code: Select all

set tnks(nicks) {}   ;# a list of nicks to use  (set to {} to disable this script) #

set tnks(inchan) "5"   ;# how long the bot stays in channel/s  (in minutes) #

set tnks(gone) "15"   ;# how long the bot stays out of channel/s  (in seconds) #
                      ;# before joining again ( change nick before join ) #


## end settings ##

if {$tnks(nicks) eq ""} {  return  }
set tnks(nicks) [split $tnks(nicks)]
set tnks(next) 0

if {![info exists tnks(timer)]} {
  set tnks(timer) [timer $tnks(inchan) [list tnks:part]]
}

proc tnks:join {chans} {  global tnks nick altnick
 if {$tnks(nicks) eq ""} {  return  }
 set nick [lindex $tnks(nicks) $tnks(next)]
 incr tnks(next)
 if {$tnks(next)==[llength $tnks(nicks)]} {  set tnks(next) 0  }
 set altnick [lindex $tnks(nicks) $tnks(next)]
 foreach ch $chans {  channel set $ch -inactive  }
 set tnks(timer) [timer $tnks(inchan) [list tnks:part]]
}

proc tnks:part {} {  global tnks botnick
 if {$tnks(nicks) eq ""} {  return  }
 if {$botnick ne $nick} {  incr tnks(next)  }
 if {$tnks(next)==[llength $tnks(nicks)]} {  set tnks(next) 0  }
 set pchans ""
 foreach ch [channels] {
  if {[botonchan $ch]} {  lappend pchans $ch  ;  channel set $ch +inactive  }
 }
 set tnks(timer) [utimer $tnks(gone) [list tnks:join $pchans]]
}
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Arkadietz
Halfop
Posts: 67
Joined: Fri Jul 14, 2006 11:43 am
Location: cat /dev/zero > /dev/null;

Post by Arkadietz »

There is an error on 31 row. how it should be filled aliases?

http://paste.tclhelp.net/?id=bkn

Line 31: ERROR: Unknown variable "nick"
On a unix system everything is a file ; if something is not a file , it is a proccess.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

oops.

Post by SpiKe^^ »

sounds like a missing global:)

Code: Select all

set tnks(nicks) {}   ;# a list of nicks to use  (set to {} to disable this script) # 

set tnks(inchan) "5"   ;# how long the bot stays in channel/s  (in minutes) # 

set tnks(gone) "15"   ;# how long the bot stays out of channel/s  (in seconds) # 
                      ;# before joining again ( change nick before join ) # 


## end settings ## 

if {$tnks(nicks) eq ""} {  return  } 
set tnks(nicks) [split $tnks(nicks)] 
set tnks(next) 0 

if {![info exists tnks(timer)]} { 
  set tnks(timer) [timer $tnks(inchan) [list tnks:part]] 
} 

proc tnks:join {chans} {  global tnks nick altnick 
 if {$tnks(nicks) eq ""} {  return  } 
 set nick [lindex $tnks(nicks) $tnks(next)] 
 incr tnks(next) 
 if {$tnks(next)==[llength $tnks(nicks)]} {  set tnks(next) 0  } 
 set altnick [lindex $tnks(nicks) $tnks(next)] 
 foreach ch $chans {  channel set $ch -inactive  } 
 set tnks(timer) [timer $tnks(inchan) [list tnks:part]] 
} 

proc tnks:part {} {  global tnks nick botnick 
 if {$tnks(nicks) eq ""} {  return  } 
 if {$botnick ne $nick} {  incr tnks(next)  } 
 if {$tnks(next)==[llength $tnks(nicks)]} {  set tnks(next) 0  } 
 set pchans "" 
 foreach ch [channels] { 
  if {[botonchan $ch]} {  lappend pchans $ch  ;  channel set $ch +inactive  } 
 } 
 set tnks(timer) [utimer $tnks(gone) [list tnks:join $pchans]] 
} 
 
 
 
 
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Arkadietz
Halfop
Posts: 67
Joined: Fri Jul 14, 2006 11:43 am
Location: cat /dev/zero > /dev/null;

Post by Arkadietz »

okay, can you fix it where i can describe the nicks in a list from a type:

set tnks(nicks) {
{nick}
{nick1}
{nick2}
}

also the timer is not sharp.
On a unix system everything is a file ; if something is not a file , it is a proccess.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Next!

Post by SpiKe^^ »

Maybe do the nicks something like this...

Code: Select all

# set a list of nicks to use  (set to {} to disable this script) # 
set tnks(nicks) {

nick1
nick2
anothernick
etc

} ;# end of set nicks #

# how long the bot stays in channel/s  (in minutes) #
set tnks(inchan) "5"


# how long the bot stays out of channel/s  (in seconds) before joining again ( change nick before join ) # 
set tnks(gone) "15"


## end of settings ## 

set tnks(tmls) [split [string trim $tnks(nicks)] "\n"]
set tnks(nicks) ""
foreach tnks(tmit) $tnks(tmls) {
  set tnks(tmit) [string trim $tnks(tmit)]
  if {$tnks(tmit) ne ""} {  lappend tnks(nicks) $tnks(tmit)  }
}
unset tnks(tmls) tnks(tmit)

if {$tnks(nicks) eq ""} {  return  } 
set tnks(next) 0 

if {![info exists tnks(timer)]} { 
  set tnks(timer) [timer $tnks(inchan) [list tnks:part]] 
} 

proc tnks:join {chans} {  global tnks nick altnick 
 if {$tnks(nicks) eq ""} {  return  } 
 set nick [lindex $tnks(nicks) $tnks(next)] 
 incr tnks(next) 
 if {$tnks(next)==[llength $tnks(nicks)]} {  set tnks(next) 0  } 
 set altnick [lindex $tnks(nicks) $tnks(next)] 
 foreach ch $chans {  channel set $ch -inactive  } 
 set tnks(timer) [timer $tnks(inchan) [list tnks:part]] 
} 

proc tnks:part {} {  global tnks nick botnick 
 if {$tnks(nicks) eq ""} {  return  } 
 if {$botnick ne $nick} {  incr tnks(next)  } 
 if {$tnks(next)==[llength $tnks(nicks)]} {  set tnks(next) 0  } 
 set pchans "" 
 foreach ch [channels] { 
  if {[botonchan $ch]} {  lappend pchans $ch  ;  channel set $ch +inactive  } 
 } 
 set tnks(timer) [utimer $tnks(gone) [list tnks:join $pchans]] 
} 

putlog "Nick-o-rama v1.1 Loaded."
  
And the timers are very sharp. Maybe it's the bot or network that isn't.:)
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Arkadietz
Halfop
Posts: 67
Joined: Fri Jul 14, 2006 11:43 am
Location: cat /dev/zero > /dev/null;

Post by Arkadietz »

[03:15:31] * nick (~ident@192.168.1.1) has joined #chan
[03:15:33] * nick is now known as CIA
[03:27:05] * CIA (~nick@192.168.1.1) has left #chan
[03:27:33] * nick2 (~nick@192.168.1.1) has joined #chan
On a unix system everything is a file ; if something is not a file , it is a proccess.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

See if this helps.

Code: Select all

# set a list of nicks to use  (set to {} to disable this script) # 
set tnks(nicks) { 

nick1 
nick2 
anothernick 
etc 

} ;# end of set nicks # 


# how long the bot stays in channel/s  (in minutes) # 
set tnks(inchan) "5" 


# how long the bot stays out of channel/s  (in seconds) before joining again ( change nick before join ) # 
set tnks(gone) "15" 


## end of settings ## 

set tnks(tmls) [split [string trim $tnks(nicks)] "\n"] 
set tnks(nicks) "" 
foreach tnks(tmit) $tnks(tmls) { 
  set tnks(tmit) [string trim $tnks(tmit)] 
  if {$tnks(tmit) ne ""} {  lappend tnks(nicks) $tnks(tmit)  } 
} 
unset tnks(tmls) tnks(tmit) 

if {$tnks(nicks) eq ""} {  return  } 
set tnks(next) 0 

if {![info exists tnks(timer)]} { 
  set tnks(timer) [timer $tnks(inchan) [list tnks:part]] 
} 

proc tnks:join {chans} {  global tnks nick altnick 
 if {$tnks(nicks) eq ""} {  return  } 
 set nick [lindex $tnks(nicks) $tnks(next)] 
 incr tnks(next) 
 if {$tnks(next)==[llength $tnks(nicks)]} {  set tnks(next) 0  } 
 set altnick [lindex $tnks(nicks) $tnks(next)] 
 set tnks(timer) [utimer 4 [list tnks:dojoin $chans]] 
} 

proc tnks:dojoin {chans} {  global tnks 
 if {$tnks(nicks) eq ""} {  return  } 
 foreach ch $chans {  channel set $ch -inactive  ;  savechannels
  putserv "JOIN $ch"
 }
 set tnks(timer) [timer $tnks(inchan) [list tnks:part]] 
} 

proc tnks:part {} {  global tnks nick botnick 
 if {$tnks(nicks) eq ""} {  return  } 
 if {$botnick ne $nick} {  incr tnks(next)  } 
 if {$tnks(next)==[llength $tnks(nicks)]} {  set tnks(next) 0  } 
 set pchans "" 
 foreach ch [channels] { 
  if {[botonchan $ch]} {  lappend pchans $ch
    channel set $ch +inactive  ;  savechannels
    putserv "PART $ch :Leaving:)"
  } 
 } 
 set tnks(timer) [utimer $tnks(gone) [list tnks:join $pchans]] 
} 

putlog "Nick-o-rama v1.1 Loaded." 
  
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Arkadietz
Halfop
Posts: 67
Joined: Fri Jul 14, 2006 11:43 am
Location: cat /dev/zero > /dev/null;

Post by Arkadietz »

Possible problems:
1. Major reason for delaying is inactive. With part/join will be better.
2. After .rehash seems not working properly have to use .restart
3. Problems with rotating of nicks

A little cut how working actually tcl

[21:42:40] * CIA (~ident@10.1.1.1) has joined #housemusic
[21:44:04] * CIA (~ident@10.1.1.1) has left #housemusic
[21:45:05] * Nenasitnata (~ident@10.1.1.1) has joined #housemusic
[21:47:04] * Nenasitnata (~ident@10.1.1.1) has left #housemusic
[21:48:10] * Briunetkata (~ident@10.1.1.1) has joined #housemusic
[21:50:03] * Briunetkata (~ident@10.1.1.1) has left #housemusic
[21:51:09] * Neobvurzana (~ident@10.1.1.1) has joined #housemusic
[21:53:03] * Neobvurzana (~ident@10.1.1.1) has left #housemusic
[21:54:08] * tejat_mi_cicite (~ident@10.1.1.1) has joined #housemusic
[21:56:04] * tejat_mi_cicite (~ident@10.1.1.1) has left #housemusic
[21:57:09] * ofermeno_dupe (~ident@10.1.1.1) has joined #housemusic

TCL settings:

# how long the bot stays in channel/s (in minutes) #
set tnks(inchan) "2"

# how long the bot stays out of channel/s (in seconds) before joining again ( change nick before join ) #
set tnks(gone) "60"
On a unix system everything is a file ; if something is not a file , it is a proccess.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

So, you would like more accuracy. Let's adjust the code to this.

Code: Select all

# set a list of nicks to use  (set to {} to disable this script) #
set tnks(nicks) {

nick1
nick2
anothernick
etc

} ;# end of set nicks #


# how long the bot stays in channel/s  (in minutes) #
set tnks(inchan) "2"


# how long the bot stays out of channel/s  (in seconds) before joining again ( change nick before join ) #
set tnks(gone) "60"


## end of settings ##

set tnks(tmls) [split [string trim $tnks(nicks)] "\n"]
set tnks(nicks) ""
foreach tnks(tmit) $tnks(tmls) {
  set tnks(tmit) [string trim $tnks(tmit)]
  if {$tnks(tmit) ne ""} {  lappend tnks(nicks) $tnks(tmit)  }
}
unset tnks(tmls) tnks(tmit)

if {$tnks(nicks) eq ""} {  return  }

if {![info exists tnks(next)]} {  set tnks(next) 0  }
if {![info exists tnks(timer)]} {
  set tnks(timer) [timer $tnks(inchan) [list tnks:part]]
}

set tnks(inchan) [expr {($tnks(inchan)*60)-1}]
incr tnks(gone) -5
if {$tnks(gone)<"1"} {  set tnks(gone) 1  }
set tnks(realnk) $nick


proc tnks:part {} {  global tnks
 if {$tnks(nicks) eq ""} {  return  }
 set pchans ""
 foreach ch [channels] {
  if {[botonchan $ch]} {  lappend pchans $ch
    channel set $ch +inactive  ;  savechannels
    putserv "PART $ch :Leaving:)"
  }
 }
 set tnks(timer) [utimer $tnks(gone) [list tnks:chgnick $pchans]]
}


proc tnks:chgnick {chans} {  global tnks nick altnick
 if {$tnks(nicks) eq ""} {  return  }
 set nick [lindex $tnks(nicks) $tnks(next)]
 if {$tnks(realnk) ne ""} { set altnick $tnks(realnk) ; set tnks(realnk) "" }
 putserv "NICK $nick"
 incr tnks(next)
 if {$tnks(next)>=[llength $tnks(nicks)]} {  set tnks(next) 0  }
 set tnks(timer) [utimer 4 [list tnks:chknick $chans]]
}


proc tnks:chknick {chans} {  global tnks nick botnick
 if {$tnks(nicks) eq ""} {  return  }
 if {$botnick ne $nick} {  tnks:chgnick $chans
 } else {  tnks:join $chans  }
}


proc tnks:join {chans} {  global tnks
 if {$tnks(nicks) eq ""} {  return  }
 foreach ch $chans {  channel set $ch -inactive  ;  savechannels
  putserv "JOIN $ch"
 }
 set tnks(timer) [utimer $tnks(inchan) [list tnks:part]]
}

putlog "Nick-o-rama v1.1 Loaded."
  
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Arkadietz
Halfop
Posts: 67
Joined: Fri Jul 14, 2006 11:43 am
Location: cat /dev/zero > /dev/null;

Post by Arkadietz »

okay, one more thing.

after .restart bot still using the old settings, you need to use .restart to update new settings.
On a unix system everything is a file ; if something is not a file , it is a proccess.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

On a rehash, the existing timer will run out at the old timer settings, as it was already set & running.

Any new timers starting after the rehash will follow the new current settings, as the bot has no memory of the old settings.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
Arkadietz
Halfop
Posts: 67
Joined: Fri Jul 14, 2006 11:43 am
Location: cat /dev/zero > /dev/null;

Post by Arkadietz »

Spike, thank you for the great work! I really appreciate it!
On a unix system everything is a file ; if something is not a file , it is a proccess.
Post Reply