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.

Adding Nick@Host to this line

Help for those learning Tcl or writing their own scripts.
Post Reply
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Adding Nick@Host to this line

Post by cache »

Ok I need help with this line..

Code: Select all

set text [lrange [split $arg] 0 end]
I'm trying to get it to save Nick@Hostmask with file as well...

I did this:

Code: Select all

set text ($uhost)[lrange [split $arg set by $uhost] 0 end]

That worked but it won't let me space ($uhost)<SPACE>)[lrange [split $arg set by $uhost] 0 end] otherwise it saves as Nick@HostText here.

I know uhost isn't what I want either, trying to make it say Nick@Host but when I use $nick@$host it does Nck@host@host .. 1 host would be enough.

Thanks
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

If your meaning you want Nickname!ident@some.tld.com

Code: Select all

$nick!$uhost
If your meaning Nickname@some.tld.com

Code: Select all

$nick@[lindex [split $uhost @] 1]
Otherwise please state more clearly what you mean.
r0t3n @ #r0t3n @ Quakenet
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

That worked...

But

Code: Select all

set text $nick@[lindex [split $uhost @] 1][lrange [split $arg] 0 end]
 
anyway to make it space?

set text $nick@[lindex [split $uhost @] 1]SPACE-HERE[lrange [split $arg] 0 end]

I tried making it:

Code: Select all

set text $nick@[lindex [split $uhost @] 1] [lrange [split $arg] 0 end]
 
with a space and I get error:
[19:36] Tcl error [addgreet]: wrong # args: should be "set varName ?newValue?"
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

You have two parts for the variable, you need to make it into one string by putting the contents on the variables into ""

Code: Select all

set text "$nick@[lindex [split $uhost @] 1] [lrange [split $arg] 0 end]"
r0t3n @ #r0t3n @ Quakenet
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

oh thanks, works now.
Post Reply