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.

Script To Open a File on Remote Bot

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
m
mrscruple
Voice
Posts: 4
Joined: Thu May 04, 2006 11:40 pm

Script To Open a File on Remote Bot

Post by mrscruple »

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
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

you mean something like that?

Code: Select all

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...
User avatar
sKy
Op
Posts: 194
Joined: Thu Apr 14, 2005 5:58 pm
Location: Germany

Post by sKy »

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.
m
mrscruple
Voice
Posts: 4
Joined: Thu May 04, 2006 11:40 pm

THanks

Post by mrscruple »

Thanks you so much for your help i have Been Racking My Brain trying to Find a Solution to That Question!! :D
m
mrscruple
Voice
Posts: 4
Joined: Thu May 04, 2006 11:40 pm

Almost There

Post by mrscruple »

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 8)
J
Jcb
Voice
Posts: 4
Joined: Sun May 07, 2006 3:05 pm
Location: Netherlands

Post by Jcb »

Well, De Kus said it...
if you get an error like "couldn't duplicate input handle: bad file number ", refer forum.egghelp.org/viewtopic.php?t=11665.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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? :D 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...
User avatar
sKy
Op
Posts: 194
Joined: Thu Apr 14, 2005 5:58 pm
Location: Germany

Post by sKy »

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.
Post Reply