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 

Autonick changer + some futures

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Arkadietz
Halfop


Joined: 14 Jul 2006
Posts: 67
Location: cat /dev/zero > /dev/null;

PostPosted: Mon Aug 13, 2012 7:00 am    Post subject: Autonick changer + some futures Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Fri Aug 24, 2012 7:32 pm    Post subject: Reply with quote

Maybe something like this...
Code:

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
.
Back to top
View user's profile Send private message Visit poster's website
Arkadietz
Halfop


Joined: 14 Jul 2006
Posts: 67
Location: cat /dev/zero > /dev/null;

PostPosted: Mon Aug 27, 2012 7:06 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Mon Aug 27, 2012 8:09 am    Post subject: oops. Reply with quote

sounds like a missing global:)

Code:

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
.
Back to top
View user's profile Send private message Visit poster's website
Arkadietz
Halfop


Joined: 14 Jul 2006
Posts: 67
Location: cat /dev/zero > /dev/null;

PostPosted: Tue Aug 28, 2012 12:21 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Tue Aug 28, 2012 7:50 pm    Post subject: Next! Reply with quote

Maybe do the nicks something like this...

Code:

# 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.Smile
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
Arkadietz
Halfop


Joined: 14 Jul 2006
Posts: 67
Location: cat /dev/zero > /dev/null;

PostPosted: Tue Aug 28, 2012 10:23 pm    Post subject: Reply with quote

[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.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Tue Aug 28, 2012 11:43 pm    Post subject: Reply with quote

See if this helps.

Code:

# 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
.
Back to top
View user's profile Send private message Visit poster's website
Arkadietz
Halfop


Joined: 14 Jul 2006
Posts: 67
Location: cat /dev/zero > /dev/null;

PostPosted: Sat Sep 01, 2012 2:58 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sat Sep 01, 2012 4:28 pm    Post subject: Reply with quote

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

Code:

# 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
.
Back to top
View user's profile Send private message Visit poster's website
Arkadietz
Halfop


Joined: 14 Jul 2006
Posts: 67
Location: cat /dev/zero > /dev/null;

PostPosted: Sat Sep 01, 2012 5:17 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sat Sep 01, 2012 5:25 pm    Post subject: Reply with quote

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
.
Back to top
View user's profile Send private message Visit poster's website
Arkadietz
Halfop


Joined: 14 Jul 2006
Posts: 67
Location: cat /dev/zero > /dev/null;

PostPosted: Sat Sep 01, 2012 5:30 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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