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 

strange putserv question

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


Joined: 24 Jan 2004
Posts: 53

PostPosted: Mon Sep 03, 2007 11:21 am    Post subject: strange putserv question Reply with quote

Hi,

I have five variables I want to output in one line (each variable consists of one number). But when I do
Code:
 putserv "PRIVMSG $chan :O: $today_open H: $today_high L: $today_low C: $today_close Change: $today_change"

I get this output in the irc-chan:
Quote:
<MyEggdrop>O: 1461.50

That's all Rolling Eyes

When I do
Code:
  putserv "PRIVMSG $chan :Open: $today_open"
  putserv "PRIVMSG $chan :High: $today_high"
  putserv "PRIVMSG $chan :Low: $today_low"
  putserv "PRIVMSG $chan :Close: $today_close"
  putserv "PRIVMSG $chan :Change: $today_change"

I get each variable/number correct in the irc chan (but every number in a new line and I want it in one line).

Thanks
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Sep 03, 2007 12:20 pm    Post subject: Reply with quote

Have you double-checked that there is no newlines at the end of any of those variables?
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Jagg
Halfop


Joined: 24 Jan 2004
Posts: 53

PostPosted: Mon Sep 03, 2007 12:47 pm    Post subject: Reply with quote

ahh, there are \n in the source file so that could be the reason. How can I get rid of these \n?

(info: really backslash and n in the code, not meant as physical newlines)
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Sep 03, 2007 12:52 pm    Post subject: Reply with quote

Remove the \n from the sourcefile?
You could also use something like this if you really need the newlines within the variable contents:
Code:
puthelp "PRIVMSG $chan :O: [string trim $today_high "\n"] L: [string trim $today_low "\n"]....."

_________________
NML_375, idling at #eggdrop@IrcNET
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