SRL Archive - Help and Support

Stock Market Script! Ohh Emm Gee!!!


Timer

2008-07-24 10:17:26

Me and my dad have been playing the stock market lately, making some good cash with the tool in scar i made, but I'm only going to post what i need help with… :D

Function TimeOver: Boolean;

Var
Hour, Mins, Sec, MSec,
Year, Month, Day: Word;
M, LT: String;
HO, MI, SE, MS,
MO, DA, T: Integer;

Begin
DecodeDate(Date, Year, Month, Day);
DecodeTime(Now, Hour, Mins, Sec, MSec);

T := OpenFile('C:\Documents and Settings\Joe\Desktop\Stocks\Time.txt', False);
ReadFileString(T, LT, FileSize(T));
CloseFile(T);

HO := Between('[HO]', '[/HO]', LT);
MI := Between('[MI]', '[/MI]', LT);
SE := Between('[SE]', '[/SE]', LT);
MS := Between('[MS]', '[/MS]', LT);
MO := Between('[MO]', '[/MO]', LT);
DA := Between('[DA]', '[/DA]', LT);

If (Day > DA) Then
Result := True;

If ((Month > MO) And (Not (Result))) Then
Result := True;

If (Result) Then
Result := (Hour - HO) < 1;

If (Result) Then
Result := (Mins - MI) < 1;

If (Result) Then
Result := (Sec - SE) < 1;

If (Result) Then
Result := (MSec - MS) < 1;

If (Result) Then
Begin
T := RewriteFile('C:\Documents and Settings\Joe\Desktop\Stocks\Time.txt', False);
WriteFileString(T, '[HO]' + Hour + '[/HO]' + '[MI]' + Mins + '[/MI]' + '[SE]' + Sec + '[/SE]' + '[MS]' + MSec + '[/MS]' + '[MO]' + Month + '[/MO]' + '[DA]' + Day + '[/DA]');
CloseFile(T);
End;
End;

Would That Time Out Work..? (24hrs)

And Whats The Proper Enter In NotePad? Its Not Chr(13) xD

Waddo

2008-07-24 10:22:42

chr13 is enter

as chr13 is what i sent when you press enter =]

Timer

2008-07-24 10:27:27

its not chr13

Waddo

2008-07-24 10:30:45

typesend('hello'+chr(13)+'see')

try that in note pad

Timer

2008-07-24 10:32:07

No no… -.-
I'm not that stupid…

  T := RewriteFile('C:\Documents and Settings\Joe\Desktop\Stocks\' + Sy + '\Today.txt', False);
WriteFileString(T, S + Chr(13));
CloseFile(T);

Harry

2008-07-24 11:10:16

SCAR's enter key codes are often strange in text based programs, as they were designed to be sent to the RuneScape client, and the Notepad programs see them differentially.

Try Chr(10) and if that doesn't work, you can always try TypeByte in SRL.

Timer

2008-07-24 15:37:17

From: Hy71194
SCAR's enter key codes are often strange in text based programs, as they were designed to be sent to the RuneScape client, and the Notepad programs see them differentially.

Try Chr(10) and if that doesn't work, you can always try TypeByte in SRL.


Nope…. :(

the scar noob

2008-07-24 17:23:24

Indeed! I also have that *bug* when I save a proggy in a txt file, there is a [] > square for each enter key xD

-Tsn.

Macrosoft

2008-07-24 23:24:48

Im not really sure what you want it to do. Maybe you could pre-enter a bunch of enters in the file and just move stuff in between them lol. Im not really sure how this stuff works.

BTW, My dad works at Lehman Brothers (a hedge fund)

R0b0t1

2008-07-25 02:35:23

I personally wouldn't help you if I knew you were making money off of my advice.


And, additionally, if you taught yourself, you would be better off in two or more ways.

Widget

2008-07-25 02:40:10

Newline in notepad is #13#10

Timer

2008-07-25 10:30:27

Them together? Chr(13) + Chr(10)
Or #13#10

Or ether one of them, widget..?

the scar noob

2008-07-25 12:42:16

From: Timer
Them together? Chr(13) + Chr(10)
Or #13#10

Or ether one of them, widget..?


Try it ?

Can you jsut tell me a little bit more about that script?:p

-Tsn.

Ransom

2008-07-26 01:38:21

You might be better served using visual basic for this project. It's pretty easy to find a copy (any college student taking a computer degree will most likely take a VB class). It handles files very well in windows and also can help you organize your data by displaying things in the program you write. A good book is "an intro to programming using Visual Basic 2005" by david schneider. It will walk you though step by step writing to a file reading and data organization.

However, with your script, chr13 should be the ascii code for enter, other than that i only know file writing with VB.

as for the rest of it, it seems pretty good. not exactly sure what you're doing with it though. it's like jeopardy, posting an answer but not giving us the question lol.

Keep us updated!

the scar noob

2008-07-26 06:31:11

From: Ransom

However, with your script, chr13 should be the ascii code for enter, other than that i only know file writing with VB.


Thank you!
VB owns, you made me think about it:)

Timer, try this: sendkeysvb('{ENTER}', false);;)

-Tsn.

Pyro

2008-07-26 18:13:27

Notepad is shit. If you open the file in wordpad after using the chr(13) it will work. Notepad has never worked. As in the SRL logs for say chat. You have to open them in wordpad not notepad.

Ofcourse when its opened in scar i believe it still reads them as that box thing. If you are opening in scar. What may be easier. Is to write the enter as a special character as in @ or % and then use a function in scar to make that as a new line when it opens it. If you get what i mean.

But like i say. If you only want it writing not opening. Then use char(13) and open the file with wordpad not notepad