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.

simple tcl request: partyline bold script

Old posts that have not been replied to for several years.
User avatar
FIDe`
Voice
Posts: 32
Joined: Fri Feb 21, 2003 5:41 am
Location: Naples, Italy

simple tcl request: partyline bold script

Post by FIDe` »

Hi all, I was wondering how to write a simple script that transforms all phrases said by people in partyline to bold; but my tcl knowledge is too small, I really don't know what bind to use, and if there's the possibility to write it. Anyone could help? thank you :)
"An atom-blaster is a good weapon, but it can point both ways." - Salvor Hardin
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Try this...

Post by user »

Code: Select all

bind filt - * chatBold
proc chatBold {i t} {
  if {![string match .* $t] && ![catch {getchan $i}]} {set t \002$t\002} {set t}
}
Have you ever read "The Manual"?
User avatar
FIDe`
Voice
Posts: 32
Joined: Fri Feb 21, 2003 5:41 am
Location: Naples, Italy

Post by FIDe` »

mm no, it doesn't work :)

[03:14] Tcl error [chatBold]: invalid command name "set t"
<gianfi> we

tnx however :)
"An atom-blaster is a good weapon, but it can point both ways." - Salvor Hardin
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

FIDe` wrote:invalid command name "set t"
Then you probably inserted a line break {set t \002$t\002} here {set t} ...which is not a good idea :)
Have you ever read "The Manual"?
User avatar
FIDe`
Voice
Posts: 32
Joined: Fri Feb 21, 2003 5:41 am
Location: Naples, Italy

Post by FIDe` »

right, I removed the line break :)
now there isn't any error..
but It doesn't bold anything :) partyline chat is still not bolded.
yes, I'm +h.
<gianfi> funziona questo cazzo di bold?
however, no error is a good starting point, got workin' on it. :D
"An atom-blaster is a good weapon, but it can point both ways." - Salvor Hardin
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Your client might be filtering control chars. How did you test it? Do you have .echo on or did you watch from another bot?
Have you ever read "The Manual"?
User avatar
FIDe`
Voice
Posts: 32
Joined: Fri Feb 21, 2003 5:41 am
Location: Naples, Italy

Post by FIDe` »

No, my client (xchat) doesn't filter bold char, since if I write with bold in partyline, I see my written text in bold. With echo on I see it without bold, and from another bot it's the same. Did you tried yourself that script?I tryed it with a 1.6.15 eggie. tnx :)
"An atom-blaster is a good weapon, but it can point both ways." - Salvor Hardin
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Did you try to send bold text from your client with echo on (or watching from another linked bot)? You realize that the script on the bot can't change how your client renders your local echo, right? :P

EDIT: I tried the script now and it works fine on my 1.6.13
Have you ever read "The Manual"?
User avatar
FIDe`
Voice
Posts: 32
Joined: Fri Feb 21, 2003 5:41 am
Location: Naples, Italy

Post by FIDe` »

Did you try to send bold text from your client with echo on (or watching from another linked bot)?
Maybe there's a misunderstood:
I want to type NO BOLD text in partyline, and I want that all text written in partyline will be displayed as BOLD to other users in partyline; sorry if my english is no good :)
You realize that the script on the bot can't change how your client renders your local echo, right?
Yes, I know, infact I look from remote bots:
<Odessa> <gianfi> niente bold?
<gianfi@Odessa> niente bold?

Hoping that I've been more comprensible :) tnx again for your interest.[/i]
"An atom-blaster is a good weapon, but it can point both ways." - Salvor Hardin
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

FIDe` wrote:I want to type NO BOLD text in partyline, and I want that all text written in partyline will be displayed as BOLD to other users in partyline; sorry if my english is no good :)
That's what the script does on my eggdrop 1.6.13. Now I've also tested it on a 1.6.15, and it worked there too. This script will add \002 to the start and end of every message sent FROM the bot the script is loaded on. So it won't touch text typed by users on other bots. Is that what you want maybe?
PS: your english is fine :)
Have you ever read "The Manual"?
User avatar
FIDe`
Voice
Posts: 32
Joined: Fri Feb 21, 2003 5:41 am
Location: Naples, Italy

Post by FIDe` »

are we talking about the same script?

Code: Select all

bind filt - * chatBold 
proc chatBold {i t} { 
  if {![string match .* $t] && ![catch {getchan $i}]} {set t \002$t\002} {set t} 
}
is it this?
I really can't understand why isn't working :-? , I don't get any error.
if I do a
.tcl dccbroadcast \002prova\002
I see broadcasted the word prova in bold, from all bots. but If I load your script on botA and I type on botA, I see the text without bold on all bots.
Now, I try unloading all scripts loaded (netbots,etc) and retry..
really don't know.. however, thank you again
"An atom-blaster is a good weapon, but it can point both ways." - Salvor Hardin
User avatar
FIDe`
Voice
Posts: 32
Joined: Fri Feb 21, 2003 5:41 am
Location: Naples, Italy

Post by FIDe` »

ok, I found the problem: if I don't load netbots your script works. I really don't know what to do :o In my very little tcl knowledge, in netbots.tcl there are some bind filt * like your script, I think they create some problems..? there's a way to solve this problem (without unloading netbots? :) ) thank you again :)
"An atom-blaster is a good weapon, but it can point both ways." - Salvor Hardin
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Find the other proc triggered by a filt bind with the same mask (*) and paste it here.

PS: what happens if you load my script before/after netbots?
Have you ever read "The Manual"?
User avatar
FIDe`
Voice
Posts: 32
Joined: Fri Feb 21, 2003 5:41 am
Location: Naples, Italy

Post by FIDe` »

ok: if I load your script before netbots, and then I load netbots, it magically works !
if I load the bots with source netbots/netbots.tcl and source/bold.tcl , it magically doesn't work.

this is the netbots.tcl interesting code:

Code: Select all

bind filt - * nb_cmdcast
if {!$nb_cmdcast} {
  unbind filt - * nb_cmdcast
  rename nb_cmdcast ""
}
<snip>
proc nb_cmdcast {idx text} {
  global nb_castfilter
  set hand [idx2hand $idx] ; set cmd [string tolower [lindex [split $text] 0]]
  if {![catch {getchan $idx} chan]} {
    if {$chan == -1} {
      set cmd .[string trimleft $cmd "."]
    } elseif {![string match ".*" $cmd]} {
      return $text
    }
    if {[lsearch -exact $nb_castfilter $cmd] != -1} {
      nb_sendcmd * rbroadcast "#$hand# [string trimleft [lindex [split $text] 0] "."] .."
    } else {
      nb_sendcmd * rbroadcast "#$hand# [string trimleft [string range $text 0 399] "."]"
    }
  }
  return $text
}
I tryed to put your script too in proc nb_cmdcast before return $text, without results.
"An atom-blaster is a good weapon, but it can point both ways." - Salvor Hardin
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

insert my proc and bind in that first 'if' below the rename line/before the close brace, then add \002 around the '$text' of the first 'return $text' inside the netbots proc.
Have you ever read "The Manual"?
Locked