Okay I'm new to this so please don't shoot me down in flames.
So I have been trying to create a script which allows my character on a 2d game to meditate. On the game you meditate by pressing arrow keys which are randomly being chosen and displayed above your characters head.
So while looking for a way to create something that would do it for me I came across the findcolor() in SCAR and saw that you could define a box to check for a certain colour and I thought this was perfect.(btw the coordinates or what ever for the top left and bottom right of the box keep having to be changed when I check if there covering where they should be, any reason why that should be happening?)
If anybody could give it a quick glance and tell me with is wrong/needs changing I would be much appreciated.
So I have been trying to create a script which allows my character on a 2d game to meditate. On the game you meditate by pressing arrow keys which are randomly being chosen and displayed above your characters head.
So while looking for a way to create something that would do it for me I came across the findcolor() in SCAR and saw that you could define a box to check for a certain colour and I thought this was perfect.(btw the coordinates or what ever for the top left and bottom right of the box keep having to be changed when I check if there covering where they should be, any reason why that should be happening?)
If anybody could give it a quick glance and tell me with is wrong/needs changing I would be much appreciated.
Code:
program test;
var
x, y : Integer;
begin
wait(50)
Writeln('Started');
If(FindColor(x, y, 2831800, 268, 227, 274, 233)=true)then
Writeln('NORTH');
KeyDown(24);
wait(20)
KeyUp(24);
If(FindColor(x, y, 2831800, 267, 243, 274,247)=true)then
Writeln('SOUTH');
KeyDown(25);
wait(20)
KeyUp(25);
If(FindColor(x, y, 2831800, 276, 233, 280, 240)=true)then
Writeln('EAST');
KeyDown(26);
wait(20)
KeyUp(26);
If(FindColor(x, y, 2831800, 260, 232, 266, 241)=true)then
Writeln('WEST');
KeyDown(27);
wait(20)
KeyUp(27);
end.


