SRL Archive - Reflection Development

R_DemonDoCommand


Bad Boy JH

2010-11-30 19:36:28

This would be a far neater solution to the 4 procedures (R_Jog etc) that are in the demon solver,

procedure R_DemonDoCommand(Action: string);
var
SignID: Integer;
P1, P2: TPoint;
CarpetTile: TTile;
begin
case Action of
'jumps': SignID := 1;
'push ups': SignID := 2;
'sit ups': SignID := 3;
'jog': SignID := 4;
end;
if (g_R_Demon_sign1 = SignID) then
CarpetTile := Tile(3160, 4820) else
if (g_R_Demon_sign2 = SignID) then
CarpetTile := Tile(3162, 4820) else
if (g_R_Demon_sign3 = SignID) then
CarpetTile := Tile(3164, 4820) else
if (g_R_Demon_sign4 = SignID) then
CarpetTile := Tile(3166, 4820);
if not TileOnMS(CarpetTile, 0) then
WalkToTile(CarpetTile, 0, 0);
P1 := TileToMSEx(CarpetTile, 0, 1, 0);
P2 := TileToMSEx(Tile(CarpetTile.x, CarpetTile.y - 1) , 1, 0, 0);
MouseBox(P1.x, P1.y, P2.x, P2.x, 0);
if R_IsUpText('use') then
begin
ClickMouse2(True);
Result := True;
end else begin
ClickMouse2(False);
Result := R_ChooseOption('use');
end;
end;

Cstrike

2010-11-30 19:51:54

If you can get yourself in an account, send it our way and we will add in the procedure to test it. If it solves perfectly, added :)