SRL Archive - OSR Help

How to log data in Real-Time outside of Simba?


Mister Snow

2012-05-23 01:05:37

I assume it is possible, I just do not know how.

What I would like to know how to do:

Take data that my script finds in game, and then export that data to a website in real-time while the bot runs?

Thank you ahead of time Villavu!

Runaway

2012-05-23 01:09:57

I don't have the time to go in-depth with this, but it's fairly simple as long as you have some PHP knowledge.

Use PostHTTPPage() to send information to a .php page on your website, and have the .php do whatever you want with the data (like storing it in a db to be displayed somewhere else).

'Toxin

2012-05-23 01:25:45

From: Runaway
I don't have the time to go in-depth with this, but it's fairly simple as long as you have some PHP knowledge.

Use PostHTTPPage() to send information to a .php page on your website, and have the .php do whatever you want with the data (like storing it in a db to be displayed somewhere else).


Interesting, I'm going to dig a little deeper myself heh… :stirthepot:

Dgby714

2012-05-23 01:58:31

From: Runaway
I don't have the time to go in-depth with this, but it's fairly simple as long as you have some PHP knowledge.

Use PostHTTPPage() to send information to a .php page on your website, and have the .php do whatever you want with the data (like storing it in a db to be displayed somewhere else).


Doesn't need to be a php page… >..>

You could also use sockets to connect to any kind of server not just an httpd

Sex

2012-05-23 03:27:11

From: Dgby714
Doesn't need to be a php page… >..>

You could also use sockets to connect to any kind of server not just an httpd


This ;).

Subliment

2012-05-23 11:59:19

Isn't real-time continuous data upload? I'm pretty sure PHP can't do that.. (or can it?) Actually, don't you need multi-threading to do this?

Mister Snow

2012-05-23 14:40:46

Awesome!

I will toy around with this, and no doubt come back with some more questions regarding this.

Also, from what I know, you can have real-time streams updating on php.

Thanks a lot for that command.

Runaway

2012-05-23 14:41:44

From: Subliment
Isn't real-time continuous data upload? I'm pretty sure PHP can't do that.. (or can it?) Actually, don't you need multi-threading to do this?


if you're using the .php method, you can call PostHTTPPage() as much as you'd like and it will update the db info every time you call it in Simba. Since Simba can't multi-thread (afaik) that's the second best. Or third best if sockets are better, but I have no clue :p

Main

2012-05-23 15:38:16

If you want to send your proggie, it'd be best if you only do it once a while. Because constantly sending/doing stuff on simba is WAYY to slow.

I had a script that were scanning the entire screen for a specific object and aswell doing some calculation each time. Usually the task takes about 1.5 seconds, but if I added Writln every time I am moving to the next variable, it slows to 15 seconds.

Subliment

2012-05-23 16:28:16

From: Runaway
if you're using the .php method, you can call PostHTTPPage() as much as you'd like and it will update the db info every time you call it in Simba. Since Simba can't multi-thread (afaik) that's the second best. Or third best if sockets are better, but I have no clue :p


I guess you're right if you put it that way. I took continuous as in logging/committing something thing using a continuous data stream to a database, be it local or remote; hence mentioning the multi-threading.

putonajonny

2012-05-23 16:34:06

In my scripts I have:
AddOnTerminate('FinalProggy');
then
Procedure FinalProggy;
begin

if(GetTimeRunning > 600000)then //if it has been going more than 10 minutes (no point in collecting proggys less than that)
//SubmitProggyGoesHere

end;

That way you only get the final proggy, if you wanted it more often you could use a time from mark thing to do it more often

Kyle Undefined

2012-05-23 16:39:15

From: Subliment
I guess you're right if you put it that way. I took continuous as in logging/committing something thing using a continuous data stream to a database, be it local or remote; hence mentioning the multi-threading.


I would either use sockets, or the SQLLite functionality in Simba, for local databases. Constantly sending data to a webpage would take a lot of resources.