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 

Script To Open a File on Remote Bot

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
mrscruple
Voice


Joined: 04 May 2006
Posts: 4

PostPosted: Thu May 04, 2006 11:44 pm    Post subject: Script To Open a File on Remote Bot Reply with quote

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
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sat May 06, 2006 8:18 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
sKy
Op


Joined: 14 Apr 2005
Posts: 194
Location: Germany

PostPosted: Sat May 06, 2006 2:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
mrscruple
Voice


Joined: 04 May 2006
Posts: 4

PostPosted: Sun May 07, 2006 6:58 pm    Post subject: THanks Reply with quote

Thanks you so much for your help i have Been Racking My Brain trying to Find a Solution to That Question!! Very Happy
Back to top
View user's profile Send private message
mrscruple
Voice


Joined: 04 May 2006
Posts: 4

PostPosted: Sun May 07, 2006 8:20 pm    Post subject: Almost There Reply with quote

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 Cool
Back to top
View user's profile Send private message
Jcb
Voice


Joined: 07 May 2006
Posts: 4
Location: Netherlands

PostPosted: Mon May 08, 2006 3:37 am    Post subject: Reply with quote

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
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Mon May 08, 2006 5:22 am    Post subject: Reply with quote

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? Very Happy 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
View user's profile Send private message MSN Messenger
sKy
Op


Joined: 14 Apr 2005
Posts: 194
Location: Germany

PostPosted: Wed May 10, 2006 3:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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