View Single Post
Old 03-02-2006, 03:08 AM  
LordM
Senior Member
 
LordM's Avatar
 
Join Date: Jul 2005
Location: Germany
Posts: 138
Default

You don't need to start your sitebot as a service. You could crate a batch file, that is executed OnServerStart, OnFTPLogin, or whenever you like. It checks, if sitebot is running and starts it, if not.

I quote from the Knowledge Base:

Quote:
A: Create yourself a batch file that will check if the windrop is running and if not, will restart it.

Execute it each time someone logs in to make sure the bot is checked often. Do that by adding this OnFtpLogin event in your ioFTPD.ini:
[Events]
OnFtpLogIn = EXEC D:\ioFTPD\windrop\HideRun.exe D:\ioFTPD\windrop\botchk.bat

You can optionnaly add a SITE command to do the same:
[FTP_Custom_Commands]
SITEBOT = EXEC D:\ioFTPD\windrop\HideRun.exe D:\ioFTPD\windrop\botchk.bat

You need TaskIsRunning.exe (available in ioFTPD Forums) in your windrop directory. Also, HideRun.exe (available here) allows the script to run without hanging the current FTP session. Alternatives to both exe can be used (pslist.exe, hidden32.exe, hidewnd.exe, etc.) if you can modify the .bat file to fit your favorite tool.

For eggdrop.exe to be able to start, you need to add those lines in your ioFTPD\etc\ioftpd.env file (and restart ioFTPD):
SYSTEMROOT=%[environment(SYSTEMROOT)]
WINDIR=%[environment(WINDIR)]

If you have problems starting the sitebot from ioFTPD, but it runs fine from a command prompt, remove all references to hiderun.exe from .bat and ioFTPD lines related to your sitebot and try again. You should see an error appear when u try to execute SITE SITEBOT

Here's an example botchk.bat file:
@echo off
D:
cd "D:\ioFTPD\windrop"

rem Change this to the name of your bot's config:
set botscript=eggdrop.conf

rem Change this to the handle/botnet-nick of your bot:
set botname=SomeBot

rem Change this to the name of your bot's userfile:
set userfile=Bot.user

rem You probably don't need to change anything below here....
if exist .share* del .share*
if exist *.stackdump del *.stackdump
if exist *.tmp del *.tmp
if not exist %botscript% echo Config file (%botscript%) missing.
if not exist %botscript% goto cantload
if exist %userfile% goto checkrunning
if exist %userfile%~new ren %userfile%~new %userfile%
if exist %userfile% echo Missing userfile... Using the last saved one..
if exist %userfile% goto checkrunning
if exist %userfile%~bak ren %userfile%~bak %userfile%
if exist %userfile% echo Missing userfile... Using the last backed up one..
if exist %userfile% goto checkrunning
if not exist %userfile% echo Userfile missing. No backup/last saved userfile either. =/
goto cantload

:checkrunning
taskisrunning eggdrop.exe
if errorlevel 2 goto end
if errorlevel 1 goto end
if errorlevel 0 goto restart
goto end

:restart
set result=
if not exist eggdrop.exe echo eggdrop.exe not found!
if not exist eggdrop.exe goto cantload
echo Restarting Eggdrop...
HideRun.exe eggdrop.exe -nt
if errorlevel 8 echo Possibly Missing .dll File(s)? (tcl8*.dll, cygwin1.dll)
if errorlevel 8 goto cantload
goto success

:cantload
echo Could not reload the bot. =(
goto end

:success
echo Successfully Started Eggdrop (%botname% - %botscript%).

:end
Have fun with it

LordM
__________________
I'm using:

ioFTPD 7.7.2
ioNiNJA BETA Stable v0.8.9.6
LordM is offline   Reply With Quote