SRL Archive - SRL Archives

NotesOn & SwitchNote ~ Bank.scar


Rich

2009-05-09 20:12:27

These are two functions that I created whilst making my Steel Plate Alcher.

The first (NotesOn) checks whether or not something will be a note when you withdraw something from your bank.
//function NotesOn : Boolean;
//Made by R1ch
//Example: if NotesOn then

function NotesOn : Boolean;
var
X, Y, NoteOn : Integer;

begin
NoteOn := DTMFromString('78DA6314666060E06100032E08C510166207A' +
'61981F83F10308A0019CC0C6880118904D2A240829B801A212021' +
'44400DC82DC204D43013610E480D3B01359C408285801A01C27E0' +
'7005ED005E1');
Result:= False;
if BankScreen then
begin
if FindDTM(NoteOn, X, Y, MSX1, MSY1, MSX2, MSY2) then
Result:= True;
end;
FreeDTM(NoteOn);
end;
The second (SwitchNote) switches whether or not the items are withdrawn as notes.
//function SwitchNote(on_or_off : string) : Boolean;
//Made by R1ch
//Example: if SwitchNote('off') then

function SwitchNote(on_or_off : string) : Boolean;
var
X, Y : Integer;

begin
NoteOn := DTMFromString('78DA6314666060E06100032E08C510166207A' +
'61981F83F10308A0019CC0C6880118904D2A240829B801A212021' +
'44400DC82DC204D43013610E480D3B01359C408285801A01C27E0' +
'7005ED005E1');
Result:= False;
if BankScreen then
begin
if (on_or_off = 'on') then
begin
if FindDTM(NoteOn, X, Y, MSX1, MSY1, MSX2, MSY2) then
Result:= True;
end else
begin
if FindDTM(NoteOn, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(X, Y, 5, 5, True);
Result:= True;
end;
end;
end;
FreeDTM(NoteOn);
end;

Does anyone have any comments?

EDIT: Added the DTMs…Oops!

Naum

2009-05-09 20:18:52

Umm why not just use co-ords instead + get color.

Also there's no DTM..

Rich

2009-05-09 20:24:11

Lol, oops. I just copied it from my script. My bad. Also, I <3 DTMs, that's why I don't want to use co-ords and colour.

EDIT: Added the DTMs.

Sir R. M8gic1an

2009-05-09 21:06:44

it's a good idea as a function, however as Nauman mentioned, not the most efficient way.

~RM

lordsaturn

2009-05-09 21:46:24

Why not
function SwitchNote(On: Boolean) : Boolean;

Getting static colors would be much quicker than using DTMs btw.

Rich

2009-05-09 21:51:06

Ok then, I'll change it a bit later on.

lordsaturn

2009-05-09 22:29:57

Commited
procedure Notes(SwitchOn: Boolean);

Thanks for the idea.

Rich

2009-05-09 23:28:46

From: lordsaturn
Thanks for the idea.


You're stealing my idea? Sorry if I misunderstood.

lordsaturn

2009-05-09 23:50:08

From: R1ch
You're stealing my idea? Sorry if I misunderstood.


The idea for the procedure. :p Check Bank.scar in the latest developer revision.

Rich

2009-05-10 00:46:22

Do I get credits?

Naike

2009-05-10 01:20:45

R1ch, Credit for comming up with the idea? Lol.

Rich

2009-05-10 13:36:55

Have a look through the SRL includes. There are some credits given out for the ideas.

Shuttleu

2009-05-10 14:01:19

for SwitchNote use a boolean instead of a string
and use xor

~shut

Naum

2009-05-10 14:09:28

U read my mind shut, I was going to say exactly that. Using Xor like they use in SetRun :)

Shuttleu

2009-05-10 14:10:27

{*******************************************************************************
procedure SwitchNote(on : boolean);
By: Shuttleu
Description: Switches Notes on or off on the bank screen
*******************************************************************************}

procedure SwitchNote(on : boolean);
begin
if BankScreen then
if (on xor (GetColor(251, 301)= 8033174)) then
Mouse(246, 300, 22, 17, True);
end;
:)
small compact and faster

~shut

EDIT: changed it a bit

ZephyrsFury

2009-05-10 14:54:50

In SRL:


{*******************************************************************************
procedure Notes(SwitchOn: Boolean);
By: lordsaturn, idea by R1ch
Description: Toggles note withdrawal on or off.
*******************************************************************************}
procedure Notes(SwitchOn: Boolean);
begin
if BankScreen then
if (GetColor(254, 306) = 5863290) xor SwitchOn then
Mouse(250, 300, 10, 10, True);
end;

Don't worry R1ch you get credit. ;)

EvilChicken!

2009-05-10 15:49:50

R2ch: If you're in this for credits, SRL isn't the place to be.
Here, everybody contributes to the community for the better of everybody, not for their own glory.

Shuttleu

2009-05-10 16:14:25

From: ZephyrsFury
In SRL:


{*******************************************************************************
procedure Notes(SwitchOn: Boolean);
By: lordsaturn, idea by R1ch
Description: Toggles note withdrawal on or off.
*******************************************************************************}
procedure Notes(SwitchOn: Boolean);
begin
if BankScreen then
if (GetColor(254, 306) = 5863290) xor SwitchOn then
Mouse(250, 300, 10, 10, True);
end;

Don't worry R1ch you get credit. ;)


what! nooo…
i made that
look up

~shut

ZephyrsFury

2009-05-10 16:38:02

From: Shuttleu
what! nooo…
i made that
look up

~shut


lordsaturn commited that last night.

Shuttleu

2009-05-10 16:54:28

From: ZephyrsFury
lordsaturn commited that last night.


awww… okay then :(

~shut

Sir R. M8gic1an

2009-05-10 16:54:49

From: Shuttleu
what! nooo…
i made that
look up

~shut


saturn and i did that this morning >.> plus, you use On, which is already a command in scar.

~RM

Rich

2009-05-11 21:12:19

From: EvilChicken!
R2ch: If you're in this for credits, SRL isn't the place to be.
Here, everybody contributes to the community for the better of everybody, not for their own glory.


Sorry if I sounded a bit self-conscience then, I didn't mean to. I was just asking if I would get credit, since I came up with the idea.

Apologies,
Richard