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.
Help for those learning Tcl or writing their own scripts.
pilouuu
Halfop
Posts: 82 Joined: Mon Dec 26, 2005 8:03 pm
Post
by pilouuu » Sat Jan 13, 2007 7:42 am
Code: Select all
proc gf_fg {nick uhost hand chan text} {
if { [userlist |amnovf $chan] == "" } {
foreach user [userlist B|] {
set usersnick [hand2nick $user]
if { $usersnick == "" } {
putserv "NOTICE $nick :1Nickname: $usersnick"
} else {
putserv "NOTICE $nick :1Nickname: $usersnick"
}
}
putserv "NOTICE $nick :1Fthe end"
}
}
Hi
the bot say:
nickname: bla
nickname: bla2
nickname: bla3
possible to change for
nickname: bla bla2 bla3
max 5 user by line
thx for help
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Sat Jan 13, 2007 1:31 pm
Indent your code properly next time or I won't even bother opening topics created by you.
Also, this code doesn't make much sense to me, it only executes if there is NO-ONE in the userlist for the channel, and then it proceeds to list an imaginary flag.
pilouuu
Halfop
Posts: 82 Joined: Mon Dec 26, 2005 8:03 pm
Post
by pilouuu » Sun Jan 14, 2007 11:11 am
Code: Select all
bind pub -|- "\!list" gf_fg
proc gf_fg {nick uhost hand chan text} {
if { [userlist |amnovf $chan] == "" } {
foreach user [userlist B|] {
set usersnick [hand2nick $user]
if { $usersnick == "" } {
putserv "NOTICE $nick :1Nickname: $usersnick"
} else {
putserv "NOTICE $nick :1Nickname: $usersnick"
}
}
putserv "NOTICE $nick :The end"
}
}
code complete...
the bot say only list user whit flags B ( expl: Admin or Botlist )
the code functions.
Just change say : <bot> nicklist1
<bot> nicklist2 etc etc
By
<bot> nicklist 1 nicklist 2 nicklist 3 etc etc (5 by line)
thx
pilouuu
Halfop
Posts: 82 Joined: Mon Dec 26, 2005 8:03 pm
Post
by pilouuu » Mon Jan 15, 2007 7:17 pm
not possible? :/
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Mon Jan 15, 2007 7:48 pm
To split it to 5 nicks a line, store the output from the [userlist] to a temporary variable, run a for-loop, and use lrange to extract 5 list items from the variable. Rest would be pretty much like the code in the other thread...
NML_375