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.

Startup another bot.

Help for those learning Tcl or writing their own scripts.
Post Reply
S
StaleJoke
Voice
Posts: 10
Joined: Tue Nov 29, 2005 8:04 pm

Startup another bot.

Post by StaleJoke »

I searched already, didnt find so posting

I need to know how can i make one bot startup another one which is in a different directory.

Please dont tell me to use contrab because i do not want the contrab to check it every some minutes and then start. I want to start another bot only as a result of some specific action.

I have tried this,

Code: Select all

catch {exec /home/otherbot/scripts/botchk >/dev/null 2>&1}
It does not work.

Any suggestions ?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try encolse the command within quotes "".
S
StaleJoke
Voice
Posts: 10
Joined: Tue Nov 29, 2005 8:04 pm

Post by StaleJoke »

This way ?

Code: Select all

proc sother {} {
   catch {exec "./home/otherbot/scripts/botchk >/dev/null 2>&1"}
}
Does not work.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

The first '.' (dot) after the quote is for? I only said quotes.
S
StaleJoke
Voice
Posts: 10
Joined: Tue Nov 29, 2005 8:04 pm

Post by StaleJoke »

With or without the '.' Either ways it does not work.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

[exec] is not your Unix shell, it doesn't support redirection in the form of 2>&1 (it supports redir, but its syntax/semantics is a bit different)

so either try without it, or exec bash and pass the command with redir to it
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
S
StaleJoke
Voice
Posts: 10
Joined: Tue Nov 29, 2005 8:04 pm

Post by StaleJoke »

You lost me there.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

if [exec] is rocket science to you, give up on it and try something easier

I wonder what exactly is it that you didn't understand
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Why don't you just create a shell script and call it via exec as demond sugested?
Once the game is over, the king and the pawn go back in the same box.
Post Reply