SRL Archive - Help

Type mismatch at line 5


IsoMorphic

2013-01-02 05:29:08

So on the social group Rubik's Cubers or something someone provided this script, im just seeming to get this error :/

program new;
{$i srl/srl.simba}
var T : Integer;
begin
IsKeyDown('a'); IsKeyDown('l');
while not (IsKeyDown('a') and IsKeyDown('l')) do
Wait(1);
IsKeyDown('a'); IsKeyDown('l');
while (IsKeyDown('a') and IsKeyDown('l')) do
Wait(1);
T := GetSystemTime;
IsKeyDown(' ');
while not IsKeyDown(' ') do
Wait(1);
WriteLn('It took you ' + IntToStr(Round((GetSystemTime - T) / 1000)) + ' seconds to solve the rubix. (' + IntToStr(GetSystemTime - T) + 'msec)');
end.

Any ideas?

Justin

2013-01-02 05:32:44

'IsKeyDown' needs a 'Word' not a string and will return a boolean if the key is down

eg replace 'a' with vk_a and l with vk_l

IsoMorphic

2013-01-02 05:33:51

Ok thanks mate