| View previous topic :: View next topic |
| Author |
Message |
mrscruple Voice
Joined: 04 May 2006 Posts: 4
|
Posted: Thu May 04, 2006 11:44 pm Post subject: Script To Open a File on Remote Bot |
|
|
I am the owner of a bot and i want to run be able to run a program remotely on my bots system by entering a command to my bot via IRC. Like Winamp or VNC. How do i do this? thanks for anybodys help.
Mr Scruple |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Sat May 06, 2006 8:18 am Post subject: |
|
|
you mean something like that?
| Code: | set winamp "/cygdrive/c/program files/winamp/winamp.exe"
bind pub n !winamp start:winamp
proc start:winamp {nick uhost hand chan text} {
exec $::winamp
return 1
} |
if you get an error like "couldn't duplicate input handle: bad file number ", refer forum.egghelp.org/viewtopic.php?t=11665.
Note: use this script only on files that switch into "background" like winamp does (you return to prompt after running it in command line). You cannot spawn an independant thread from TCL, only a child. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Sat May 06, 2006 2:28 pm Post subject: |
|
|
| Quote: | | You cannot spawn an independant thread from TCL, only a child. |
I am not sure if i got you right.
1. Tcl (and eggdrop aswell too) supports tcl threads.
2. You could run any programm into the backround http://wiki.tcl.tk/12704
Or just search the tcl`ers wiki for bgExec. There is a standalone exec and a run exe package aswell too.
The restrictions tcl has is.
- You can not read from some kind of programms (such as unix vi, top).
- You can not open a programm pipeline for opening and reading at the same time.
- You can not interact with windows based applications (such as taskmanager, editor). You can only start them.
Correct me if i am wrong! _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
mrscruple Voice
Joined: 04 May 2006 Posts: 4
|
Posted: Sun May 07, 2006 6:58 pm Post subject: THanks |
|
|
Thanks you so much for your help i have Been Racking My Brain trying to Find a Solution to That Question!!  |
|
| Back to top |
|
 |
mrscruple Voice
Joined: 04 May 2006 Posts: 4
|
Posted: Sun May 07, 2006 8:20 pm Post subject: Almost There |
|
|
I have Posted the Script in Eggdrop.conf now what do i need to type in irc to Start the program. i have tried to use .tcl exec (and the file name) but it comes up with TCL error: couldn't duplicate input handle: bad file number. any suggestions would be great  |
|
| Back to top |
|
 |
Jcb Voice
Joined: 07 May 2006 Posts: 4 Location: Netherlands
|
Posted: Mon May 08, 2006 3:37 am Post subject: |
|
|
Well, De Kus said it...
| Quote: | | if you get an error like "couldn't duplicate input handle: bad file number ", refer forum.egghelp.org/viewtopic.php?t=11665. |
|
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Mon May 08, 2006 5:22 am Post subject: |
|
|
| sKy wrote: | | Correct me if i am wrong! |
well, the restriction are about fine, but bgexec simply spawns an asyncron socket/child via 'open |'. And eggdrop doesnt support TCL threading for reasons that has been discussed in other threads.
| mrscruple wrote: | | I have Posted the Script in Eggdrop.conf now what do i need to type in irc to Start the program. i have tried to use .tcl exec (and the file name) |
1st: you added the code directly into the conf? you usually paste code into a file and load that file via the config (add the end are some examples).
2nd: do you want to launch them via IRC or DCC/telnet now? basicly .tcl exec should work (just refer to the 2 solutions that are mentioned in the linked post). _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Wed May 10, 2006 3:51 pm Post subject: |
|
|
| De Kus wrote: | | And eggdrop doesnt support TCL threading for reasons that has been discussed in other threads. |
Eggdrop just doesn`t support it by standad (and i know a bit about the reasons). I am using mkThreads1.2. Eggdrop (and Windrop aswell too) are working fine with threads.
You just need tcl 8.4.12 (+) (it must be compiled with --enable-threads) and eggdrop 1.6.18 (+) (i compiled it with --enable-threads aswell to but don`t know if this was really necessary). _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
|