SRL Archive - Help and Support

Guitar Hero style game - problems.


R0b0t1

2007-12-11 16:06:28

Well, the game here: http://www.kongregate.com/games/Shinki/super-crazy-guitar-maniac-deluxe-2 is giving me problems when I try to make a script for it. Help? Completing a semi-working script would help alot too.

(If you run it without finding the letters, it doesn't hit the arrows right. It also hits them to much)


program New;
var
PlayLettters: TIntegerArray;
I, x, y: Integer;

procedure Start;
begin
ClickMouse(510, 230, True);
end;

procedure PressArrows;
var
ArrowColors: TIntegerArray;
ArrowNumber: TIntegerArray;
I, x, y: Integer;
begin
(*Up Right //Screen split, top only on top half, viseversa
Left Down*)
ArrowColors:= [3958193, 52479, 13408614, 10040217];
ArrowNumber:= [38, 39, 37, 40];
For I:= 0 to 3 do
If FindColor(x, y, ArrowColors[I], 80, 25, 120, 170) then
begin
KeyDown(ArrowNumber[I]);
Wait(1);
KeyUp(ArrowNumber[I]);
end;
end;

procedure HoldLetters;
var
I, x, y: Integer;
begin
(*
* Need help finding the Letters and holding them.
*)
end;

begin
repeat
until(False) //It doesn't take control of your mouse, just exit from
end. //the CDE

danrox2004

2007-12-11 19:43:20

Here you go, doesn't work very well but it's a start:
program New;
var
x, y: Integer;
keysDown: array[0..2] of boolean;

procedure Start;
begin
ClickMouse(510, 230, True);
end;

procedure PressArrows;
var
ArrowColors: TIntegerArray;
ArrowNumber: TIntegerArray;
I, x, y: Integer;
begin
(*Up Right //Screen split, top only on top half, viseversa
Left Down*)
ArrowColors:= [3958193, 52479, 13408614, 10040217];
ArrowNumber:= [38, 37, 39, 40];
For I:= 0 to 3 do
If FindColor(x, y, ArrowColors[i], 80, 25, 120, 170) then
begin
KeyDown(ArrowNumber[i]);
Wait(1);
KeyUp(ArrowNumber[i]);
end;
end;

procedure HoldLetters;
var
lettersLoc: array of integer;
lettersKey: array of integer;
x, y: integer;
i: integer;
begin
lettersLoc := [37, 110, 163];
lettersKey := [65, 83, 68];
for i := 0 to 2 do
begin
if(keysDown[i]) then
continue;
if(findColor(x, y, 3368550, 60, lettersLoc[i], 120, lettersLoc[i] + 1)) then
begin
keysDown[i] := true;
keyDown(lettersKey[i]);
//writeln('Key ' + intToStr(i) + ' is held');
end;
end;
end;

procedure releaseLetters;
var
col: integer;
i: integer;
loc: array of integer;
lettersKey: array of integer;
begin
loc := [25, 100, 175];
lettersKey := [65, 83, 68];
for i := 0 to 2 do
begin
if(keysDown[i]) then
begin
if(findColor(x, y, 10546393, 97, loc[i] - 7, 27, loc[i] + 6)) or (findColor(x, y, 3381657, 60, loc[i] - 5, 120, loc[i] - 4)) then
continue;
//writeln('Unheld ' + intToStr(i));
keyUp(lettersKey[i]);
keysDown[i] := false;
end;
end;
end;

begin
repeat
wait(1);
pressArrows;
holdLetters;
releaseLetters;
until(False) //It doesn't take control of your mouse, just exit from
end. //the CDE

R0b0t1

2007-12-11 20:01:46

Thanks. I just realized I'll have to do the form thread trick to get it to work though :p Or just press 'asd' by myself.

danrox2004

2007-12-11 21:36:50

From: R0b0t1
Thanks. I just realized I'll have to do the form thread trick to get it to work though :p Or just press 'asd' by myself.


Really? Why? If it is for pressing multiple letters at once, the thing I posted does that…

R0b0t1

2007-12-11 21:51:47

Oh wait, I'm stupid… :p


Do you think you could help me AGAIN and make it work with bitmaps? Because on one level the blue of the powerups gets in the way of an arrow, and on Pro the GODLY!!! color is the same as the yellow arrows. I can make the bitmaps..?


Or explain to me what I could POSSIBLY be doing wrong with bitmap masks


HELP:

program New;
var
x, y: Integer;
ArrowColors: TIntegerArray;

procedure Start;
begin
ClickMouse(510, 230, True);
end;

procedure PressArrows;
var
ArrowColors: TIntegerArray;
ArrowNumber: TIntegerArray;
I, x, y, Maskcolor: Integer;
begin
Maskcolor:= 0;
(*Up Right //Screen split, top only on top half, viseversa
Left Down*) { U R L D }
ArrowNumber:= [38, 37, 39, 40];
For I:= 0 to 3 do
If FindBitmapMaskTolerance(ArrowColors[i], x, y, 80, 25, 120, 170, 20, 20) then
begin
KeyDown(ArrowNumber[i]);
Wait(85);
KeyUp(ArrowNumber[i]);
end;
end;

begin
ArrowColors:= [BitmapFromString(30, 30, 'beNrt1bsJADAQw1Dvv7TThnCQ' +
'ryGF3gBqZZe0yWt0JJSdxnUtVy7jeieU7eMCAPwn/RTKlMdyAyA9G' +
'/M='),BitmapFromString(33, 29, 'beNrt1sEJADAIQ9Hsv3R681Io' +
'VYwg5A2Qf7MlH5DUtVOooNtA4g5BZiARFYgNJMzMbPsx3/6wqr8H/' +
'KberyWY1LN/AO8eM9s='),BitmapFromString(27, 34, 'beNrt1kENADAMw8DyJ52NwRot' +
'6qPyAfDb0lUOvZQpHgQAAIvNr0h8ltym2uLBZlOm3+ABeBFXtw=='),BitmapFromString(33, 25, 'beNr7/x8IGKgH/uMAo1YQYwXD' +
'KBgFo2AUDFZA6zKK1sUgrUtaWhfmtK4y6FAr0bpu/Y8X0Np8ym3Ba' +
'SgApRQY9g==')];
repeat
Wait(1);
PressArrows;
until(False) //It doesn't take control of your mouse, just exit from
end. //the CDE

Help me fix it.

danrox2004

2007-12-11 23:04:18

Well the runtime error is caused because arrowColors is declared twice, once globally and once in the procedure pressArrows. In pressArrows you have not set the length of it so it causes a runtime error. To fix remove the local var arrowColors.

I am going away for a few days and will be unable to answer any more questions… cya!

Narcle

2007-12-12 01:36:19

All I did was change the wait time on holding the keys down and added tolerance of 10 (never know) this works perfect for arrows:

Edit:
Changed the box it looks in and the blue color it looks for and removed the Tol
Pushed asd myself and got 9999 points on Truth or Dare by Garden State lol

Edit2:
ROFL, Just updated the yellow color for it.
Tried Big Blue (F-Zero) by NESkimos
Got 13305 points and Gold star, I got a perfect (I think). Just hit ASD myself again.

Edit3:
Run'n'Gun by Ravicious
Gold star
39,878 score

procedure PressArrows;
var
ArrowColors: TIntegerArray;
ArrowNumber: TIntegerArray;
I, x, y: Integer;
begin
ArrowColors:= [3958193, 34214, 6697728, 10040217];
ArrowNumber:= [38, 37, 39, 40];
For I:= 0 to 3 do
If FindColor(x, y, ArrowColors[i], 91, 27, 108, 172) then
begin
KeyDown(ArrowNumber[i]);
Wait(85);
KeyUp(ArrowNumber[i]);
end;
end;

I tested it only on a easy one… Didn't miss one arrow though.

nielsie95

2007-12-12 14:36:15

My version:


program New;
{
up: 3958193
down: 10040217
left: 52479
right: 13408614
a: 3368550
s: 3368550
d: 3368550
(97, 27) (102, 97)
(97, 102) (102, 172)
}

var
x, y, key: Integer;
key1, key2: String;
Up, Middle, Down: String;
S, sCount: Integer;
begin
S := BitmapFromString(2, 16, 'beNo7nNnfb7TzcGZamvGClSASjjo7jTMzjWfONJ46FUTCEVAcSAIVlJYaI6ufNMlo4oxooNTNNwvg5E4A2rkq/Q==');

key := -1;
if (GetColor(497, 275) <> 3958193) then
if (GetColor(512, 202) = 10546393) then
ClickMouseSpline(512, 202, 3, 3, True);
Wait(200);
repeat
if FindColor(x, y, 3958193, 139, 27, 140, 97) then
key1 := 'up'
else
if FindColor(x, y, 10040217, 139, 27, 140, 97) then
key1 := 'down'
else
if FindColor(x, y, 52479, 139, 27, 140, 97) then
key1 := 'left'
else
if FindColor(x, y, 13408614, 139, 27, 140, 97) then
key1 := 'right'
else
if (key1 <> '') then
begin
case key1 of
'up' : key := vk_Up;
'down' : key := vk_Down;
'left' : key := vk_Left;
'right' : key := vk_Right;
end;
KeyDown(key);
Wait(60);
KeyUp(key);
WriteLn('Send: '+key1);
key1 := '';
key := -1;
end;

if FindColor(x, y, 3958193, 139, 102, 140, 172) then
key2 := 'up'
else
if FindColor(x, y, 10040217, 139, 102, 140, 172) then
key2 := 'down'
else
if FindColor(x, y, 52479, 139, 102, 140, 172) then
key2 := 'left'
else
if FindColor(x, y, 13408614, 139, 102, 140, 172) then
key2 := 'right'
else
if (key2 <> '') then
begin
case key2 of
'up' : key := vk_Up;
'down' : key := vk_Down;
'left' : key := vk_Left;
'right' : key := vk_Right;
end;
KeyDown(key);
Wait(60);
KeyUp(key);
WriteLn('Send: '+key2);
key2 := '';
key := -1;
end;

if (Up <> '') then
begin
if (GetColor(100, 24) = 3381657) then
begin
case Up of
'a': KeyUp(65);
's': KeyUp(83);
'd': KeyUp(68);
end;
WriteLn('Up KeyUp: '+Up);
Up := '';
end;
end else
if (GetColor(128, 20) = 3381657) then
begin
up := 'a';
if (Up <> '') then
begin
case Up of
'a': KeyDown(65);
's': KeyDown(83);
'd': KeyDown(68);
end;
WriteLn('Up KeyDown: '+Up);
end;
end;

if (Middle <> '') then
begin
if (GetColor(99, 99) = 3368550) and (sCount > 30) then
begin
case Middle of
'a': KeyUp(65);
's': KeyUp(83);
'd': KeyUp(68);
end;
WriteLn('Middle KeyUp: '+Middle);
WriteLn(IntToStr(sCount));
Middle := '';
sCount := 0;
end else
Inc(sCount);
end else
if (CountColor(3381657, 80, 77, 120, 125) > 50) then
begin
if FindBitmapIn(S, x, y, 80, 77, 120, 125) then
Middle := 's'
else
Middle := '';
if (Middle <> '') then
begin
case Middle of
'a': KeyDown(65);
's': KeyDown(83);
'd': KeyDown(68);
end;
WriteLn('Middle KeyDown: '+Middle);
end;
end;

if (Down <> '') then
begin
if (GetColor(100, 170) = 3381657) then
begin
case Down of
'a': KeyUp(65);
's': KeyUp(83);
'd': KeyUp(68);
end;
WriteLn('Down KeyUp: '+Up);
Down := '';
end;
end else
if (GetColor(100, 176) = 10546393) then
begin
Down := 'd';
if (Down <> '') then
begin
case Down of
'a': KeyDown(65);
's': KeyDown(83);
'd': KeyDown(68);
end;
WriteLn('Down KeyDown: '+Up);
end;
end;

Wait(15);
until (GetColor(497, 275) <> 3958193);
end.

Doesn't work too well, but it also checks for asd..

:)

R0b0t1

2007-12-12 16:55:30

Well, I am capable of pressing ASD, but I was having trouble on the point multipliers.

'Cause the blue arrow color was used for the 3x point mult, and the yellow color is used on Pro for the 10x points. Thus I wanted bitmaps… I have the perfect wait for the keys, around 80ms.

Narcle

2007-12-13 01:33:17

Robot you try my version? I have 5 perfects in pro now because of it.

I even got a fairly good full working version. Still tweaking it.

edit:
If you look I changed the colors so it doesn't see the color multiplier "blips". Works perfect with those colors.

Narcle

2007-12-13 11:50:54

Yes I have done the 2 scar script thing with ASD on one and arrows on the other. I used that way to get 2 of my 5 perfects in pro.

And Trevor…. You score is 0 because your script isn't working right :p
If it clicks to many times, or hits a button in wrong spot then it reduces your score even though you keep your multiplier. Basically if a button is push in the right area the multiplier won't go down, but if it clicks it wrong then it will. Usually ASD does this more often then not.

So far I have only used colors and have 5 perfects in pro. But I think I might have to give in and do bitmaps/dtm for the ASD buttons.

R0b0t1

2007-12-13 17:01:18

NVM!

I think how the color was changed worked… Perfect on almost all tracks.

Narcle

2007-12-13 17:20:19

From: R0b0t1
NVM!

I think how the color was changed worked… Perfect on almost all tracks.


Told you! (my doing :p)

Narcle

2007-12-13 18:58:35

Aight Robot we both on high scores and can't do any better.

Whats the next game? lol

Bobarkinator

2007-12-13 19:56:53

The Last Stand?

R0b0t1

2007-12-13 20:31:49

I got all perfect now, and I got the impossible badge for that game. Lol.

I'm making a new thread, much the same theme though.

Narcle

2007-12-14 13:57:47

Perhaps make a request for a "other" scar script section in members? Or am I just blind and there is one?

R0b0t1

2007-12-14 23:23:12

I dunno. Do I get the job of PMing an admin?