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 

Help with tcl -> sh

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


Joined: 20 Oct 2007
Posts: 1

PostPosted: Sat Oct 20, 2007 8:54 am    Post subject: Help with tcl -> sh Reply with quote

Ok.. I'm kinda new to tcl scripting

I know you can run a .sh script from tcl using "exec"
And to run a tcl file from sh u can use "tclsh"

So my bot's script, runs a .sh file, and when the .sh file is done it then runs a new .tcl file. But that new .tcl file is not "connected" to the eggdrop so commands like "putmsg $chan" does not work.

Is there any way to make them "connect" ?
Or another solution would be to make the tcl script wait until the .sh script was done, and then go on, but dont know how to do that either Razz
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Mon Oct 22, 2007 9:22 am    Post subject: Reply with quote

Whats the .sh file used for? If its written in tcl you can just change it so eggdrop can use it which pretty much means # mv file.sh file.tcl
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Oct 22, 2007 10:40 am    Post subject: Reply with quote

Simply put, using exec spawns a new child-process, where the only connection inbetween the processes is the stdout and stderr pipe from the child, which is returned to the tcl environment as return-value of exec once the child is terminated.

As such, any script or command run as or by the child will be completely unaware of the eggdrop environment. There is no simple way of "connecting" them as you describe. You could relay data inbetween the processes using sockets, although you'd have to create an API for that.

One question though, if you need eggdrop functionability in your secondary tcl-script, why don't you run it directly from eggdrop's tcl-environment?
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
BeBoo
Halfop


Joined: 26 Sep 2007
Posts: 42

PostPosted: Tue Oct 23, 2007 10:58 am    Post subject: Reply with quote

Is the sh script called from an already existing tcl script via the bot? If so, you would probably want the sh script to move the tcl to your scripts folder and have it modify your eggdrop.conf file. Once it's complete, have your tcl script you called originally to rehash your bot.
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