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 

regsubing $s

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
llama
Voice


Joined: 09 Feb 2006
Posts: 3

PostPosted: Thu Feb 09, 2006 2:23 pm    Post subject: regsubing $s Reply with quote

I've made a quote script but I'm having a little trouble with it. If someone does the trigger to show a quote, and the quote has a $ in it, I get an error... say if the line was "blah blah $700 blah blah" ... it would error out on the partyline with "[12:08] can't read "700": no such variable" .. I've tried regsub -all {$} line "\\\$" line .. and I've tried regsub -all {\$} line "\\\$" line, but neither seem to work.. anyone have any suggestions?
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Feb 09, 2006 7:35 pm    Post subject: Reply with quote

regsub manual page
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Feb 09, 2006 8:38 pm    Post subject: Reply with quote

I don't think you need regsub, you probably have a string/list issue in your script. Or the quote has been added inside the Tcl script without skipping $.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
llama
Voice


Joined: 09 Feb 2006
Posts: 3

PostPosted: Fri Feb 10, 2006 1:41 am    Post subject: Reply with quote

Its read to a list so I can lindex the author/date added.. I didn't think that would cause a problem but apparently it does.. should I string map it instead?
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Feb 10, 2006 10:40 am    Post subject: Reply with quote

Code:
set list {
 "bla bla $blo bli bla"
 "foo $bar fee moo"
}

# and use:

foreach bla $list {
 # using $bla will work perfectly
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
llama
Voice


Joined: 09 Feb 2006
Posts: 3

PostPosted: Fri Feb 10, 2006 4:39 pm    Post subject: Reply with quote

I'll try it, thanks !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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