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.

change say bot

Help for those learning Tcl or writing their own scripts.
Post Reply
p
pilouuu
Halfop
Posts: 82
Joined: Mon Dec 26, 2005 8:03 pm

change say bot

Post by pilouuu »

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
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

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.
p
pilouuu
Halfop
Posts: 82
Joined: Mon Dec 26, 2005 8:03 pm

Post by pilouuu »

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
p
pilouuu
Halfop
Posts: 82
Joined: Mon Dec 26, 2005 8:03 pm

Post by pilouuu »

not possible? :/
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Your code doesn't make sense and your question has already been answered: http://forum.egghelp.org/viewtopic.php?t=12948

(i miss the post merge button :()
Have you ever read "The Manual"?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
Post Reply