Old 05-20-2003, 08:38 AM   #16
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

U can either use the tcl extension for eggdrop, which is the clean way to do it, but the way i don't like myself because of the complicatedeness of installing that extension...

Or u can just do a http::geturl on a webpage (php for example) that will do the sql query for u and echo the result, and ur bot just has to echo that result back on irc.

Or maybe you could call my pretime.exe directly from the eggdrop tcl... Hum... It would probably work. U'll need to run your egg in -nt mode though.
Mouton is offline   Reply With Quote
Old 06-24-2003, 05:22 PM   #17
Zalio
Junior Member
 
Join Date: Nov 2002
Posts: 8
Default

wonderful script mounton.. i started editing your c++ file, i wanted to change the table names because it is better when i want to add more functions to it.

but i have one problem.. you are using column timestamp and i use date_time. In the last part of the .cpp file it says this:

Code:
		Result::iterator i;
		int j = 1;
		time_t timestamp;
		struct tm *datetime;
		for (i = res.begin(); i != res.end(); i++) {
			row = *i;
			timestamp = (time_t)row["timestamp"];
			datetime = localtime(&timestamp);
			printf("%02i. %i-%02i-%02i %02i:%02i:%02i -> ",j++,datetime->tm_year+1900,datetime->tm_mon,datetime->tm_mday,datetime->tm_hour,datetime->tm_min,datetime->tm_sec);
			cout << row["name"] << endl;
		}
		cout << "*--[/PRETiME]----------------------------------------------------*\n";
i changed it in this:

Code:
			timestamp = (time_t)row["date_time"];
			datetime = localtime(&timestamp);
is this good or do i also need to change the (&timestamp) in (&date_time) ? :P

very thnx if you can help me

Greetz Zalio
Zalio is offline   Reply With Quote
Old 06-25-2003, 02:24 PM   #18
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

You C logic is fine, but I don't know it your date_time field contains a unix timestamp as my 'timestamp' field does.

I'm using a unix timestamp because it's easy to play with that in C then. If you're using a mysql datetime type field, u'll probably need to find the function that returns the unix timestamp in the sql line...

select datetimetounix(date_time) from pretimes...
or something similar... I don't know the exact function name, but I think it exist.
Mouton is offline   Reply With Quote
Old 07-01-2003, 12:24 AM   #19
404error
Junior Member
 
Join Date: May 2003
Posts: 4
Default

The SQL function you're looking for is UNIX_TIMESTAMP(any sql time column).

So SELECT UNIX_TIMESTAMP(timestamp) AS timestamp FROM table; or whatever you need.

Using mysqltcl really isn't difficult (at least on *ix, I have little experience with using it on a Windrop, though I execpt it's as easy as dropping a dll in the windrop dir and loading it from the script with the 'load' command. It *should* be possible to use this module in a .itcl as well, and it might even let u use persistent connections. It's availiable here: http://www.xdobry.de/mysqltcl/ Windows binaries here: http://www.xdobry.de/mysqltcl/windows.html

Oh and whoever wanted to import data from a text file, look into the LOAD DATA INFILE SQL command: http://www.mysql.com/doc/en/LOAD_DATA.html
404error is offline   Reply With Quote
Old 12-26-2003, 03:46 PM   #20
MrManc
Junior Member
ioFTPD Registered User
 
Join Date: Aug 2003
Posts: 15
Default

Been using this script for a while, with ioftp v 5.2.x and v 5.3.x.
Works great in them versions, but get a starnge error with ioftpd 5.4.2 and 5.4.3.

[L] site pretime Dying_-_The_Truth_is_Inside-2003-FERiCE
[L] 200-Error: Can't create TCP/IP socket (10106)
[L] 200 Command successful.

I haven't messed with any firewall settings, and if i now go back to 5.3.9 it works.

Anyone else having this problem?
I think it uses the same code as the pretime features of iobanana, anyone having similar probs with that?
MrManc is offline   Reply With Quote
Old 12-27-2003, 10:24 PM   #21
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

I guess it's a bug in newest io...
external script can't create sockets or something similar...
does imdb on nfo upload works ? it opens a socket too.
Mouton is offline   Reply With Quote
Old 12-28-2003, 07:19 AM   #22
Harm
Too much time...
Ultimate Scripter
 
Join Date: Jul 2003
Posts: 1,430
Default

Imdb on nfo upload works fine with ioFTPD 5.4.3r.
I will try the pretime db things this afternoon.
Harm is offline   Reply With Quote
Old 12-28-2003, 07:43 AM   #23
MrManc
Junior Member
ioFTPD Registered User
 
Join Date: Aug 2003
Posts: 15
Default

Yep imdb on nfo works fine for me too
MrManc is offline   Reply With Quote
Old 03-14-2004, 12:24 PM   #24
[Rastaman]
Junior Member
 
Join Date: Nov 2003
Posts: 4
Default Damn !

Works perfect in command line but when it's called from within site command :

[L] 200-Error: Can't create TCP/IP socket (10106)
[L] 200 Command successful.

Mouton said it was prolly a bug in newest io releases... no one succeed to get rid of that by any chance ? :>
[Rastaman] is offline   Reply With Quote
Old 03-14-2004, 12:38 PM   #25
_rage_ thegod
Member
 
Join Date: Jan 2004
Posts: 40
Default

just an idea, i havent and cant test this since i dont have the script nor do i intend to, but anyway, try this:

take the

pretime = EXEC ..\scripts\iopretime\iopretime.exe arg

line, create a batch file like this:

Code:
@echo off
set SystemRoot=c:\WINNT
c:\ioftpd\scripts\iopretime\iopretime.exe arg
exit 0
and replace

pretime = EXEC ..\scripts\iopretime\iopretime.exe arg
with
pretime = EXEC ..\scripts\path\to\where\you\put\the\batchfile.cmd

again, i have no clue if this works, but try if you want.
_rage_ thegod is offline   Reply With Quote
Old 03-14-2004, 12:56 PM   #26
MrManc
Junior Member
ioFTPD Registered User
 
Join Date: Aug 2003
Posts: 15
Default

try adding these to ioftpd.env

SYSTEMROOT=%[environment(SYSTEMROOT)]
SYSTEMPATH=%[$path]

fixed my problem
MrManc is offline   Reply With Quote
Old 03-15-2004, 10:23 AM   #27
[Rastaman]
Junior Member
 
Join Date: Nov 2003
Posts: 4
Default Finally got it working :)

First: Thanx to MrManc & _rage_ thegod :>

SYSTEMPATH=%[$path] was already in my ioftpd.env
so i just added SYSTEMROOT=%[environment(SYSTEMROOT)] as MrManc suggested... but it seems that it didn't helped.

So, i tried the batch file solution, and finally it works
Except there was some errors in the syntax, here is what to fix :
- The SITE PRETIME syntax was wrong :
Quote:
pretime = EXEC ..\scripts\path\to\where\you\put\the\batchfile.cmd
Here is the fixed syntax :
pretime = %EXEC ..\scripts\iopretime\iopretime.cmd

- The batch file syntax was wrong :
Quote:
c:\ioftpd\scripts\iopretime\iopretime.exe arg
Here is the fixed syntax :
C:\ioFTPD\scripts\pretime.exe %1
(just add %2 %3 %4 %5... etc if needed)

and finally it works
[Rastaman] is offline   Reply With Quote
Old 03-15-2004, 11:06 AM   #28
_rage_ thegod
Member
 
Join Date: Jan 2004
Posts: 40
Default

true, didnt think of the arg as %1, hehe well
_rage_ thegod is offline   Reply With Quote
Old 03-15-2004, 05:36 PM   #29
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default Re: Finally got it working :)

Quote:
Originally posted by [Rastaman]
Here is the fixed syntax :
pretime = %EXEC ..\scripts\iopretime\iopretime.cmd
the % there is not needed unless ur using cookies on that line. From what u showed, u're not, so it's not needed.
Mouton is offline   Reply With Quote
Old 03-30-2005, 10:54 AM   #30
[anais]
Junior Member
 
Join Date: Mar 2005
Posts: 1
Default

Any link for download it please ?
[anais] is offline   Reply With Quote
Reply

Tags
200-|, results, returns, timestamp, [122103]

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
GuildFTPd command set (import) Jesper Custom Commands 4 07-29-2011 12:41 AM


All times are GMT -5. The time now is 04:07 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)