Results 1 to 7 of 7

Thread: Damien random

  1. #1
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default Damien random

    It solves the puzzle beautifully, but after getting teleported away it thinks it failed. I believe the InRandom loop fails somehow.

    I think this should fix it:
    Simba Code:
    {*******************************************************************************
    function SolveDemon: Boolean;
    by: Sumilion
    Description: Main solving procedure.
    *******************************************************************************}


    function SolveDemon: Boolean;
    var
      Task: string;
      JogIndex, StarIndex, SitIndex, PushIndex, t: Integer;
    begin
      Result := false;
      TakeScreen('Found Demon');
      ClickContinue(True, True);
      SetAngle(true);
      MarkTime(t);
      MakeCompass('N');
      repeat;
        Task := demon_GetTask;
        Writeln(Task);

        if (not(GetSigns(JogIndex, StarIndex, SitIndex, PushIndex))) then
        begin
          WriteLn('Could not identify demon signs.');
          LogOut;
          Exit;
        end;

        case Task of
          'Jog': Result := PerformTask(JogIndex);
          'Star': Result := PerformTask(StarIndex);
          'Sit': Result := PerformTask(SitIndex);
          'Push': Result := PerformTask(PushIndex);
        end;

        if (not (Result)) then
          Exit;

        Wait(100 + Random(200));

        if FindNPCChatText('Wrong exercise', Nothing) then
          Writeln('Wrong exercise.');

      until FindNPCChatText('actually', Nothing) or (TimeFromMark(t) > 10 * 60 * 1000);

      if (TimeFromMark(t) > 10 * 60 * 1000) then
      begin
        Writeln('We''ve been in the demon random for 10 minutes. It failed.');
        LogOut;
        Exit;
      end;

      Wait(10000);
      while (ClickContinue(True, True)) do
        Wait(500 + Random(500));
      Writeln('Waiting 10 seconds now');
      Wait(10000);
      Result := (not(Demon_InRandom));
      if (Result) then
        Writeln('Demon random solved!');

    end;

  2. #2
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    I don't actually think it's failed on me so far :/
    Ce ne sont que des gueux


  3. #3
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    This:
    Simba Code:
    Wait(10000);
      while (ClickContinue(True, True)) do
        Wait(500 + Random(500));
      Writeln('Waiting 10 seconds now');
      Wait(10000);
      Result := (not(Demon_InRandom));
      if (Result) then
        Writeln('Demon random solved!');

    Wouldnt it be better to wait until not Demon_InRandom of TimeFromMark instead of wait(10000) once out of the demon?

    Ow, and it has failed me on several occasions, in the same way marpis concludes.
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  4. #4
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default

    Quote Originally Posted by WT-Fakawi View Post
    This:
    Simba Code:
    Wait(10000);
      while (ClickContinue(True, True)) do
        Wait(500 + Random(500));
      Writeln('Waiting 10 seconds now');
      Wait(10000);
      Result := (not(Demon_InRandom));
      if (Result) then
        Writeln('Demon random solved!');

    Wouldnt it be better to wait until not Demon_InRandom of TimeFromMark instead of wait(10000) once out of the demon?

    Ow, and it has failed me on several occasions, in the same way marpis concludes.

    Simba Code:
    function Demon_Successful: Boolean;
    var
      T: Integer;
    begin
      while ClickContinue(True, True) do
        Wait(800 + Random(400));
      T := GetSystemTime + 15000;
      while (GetSystemTime < T) and not(Result) do
      begin
        Result := not(Demon_InRandom);
        if Result then
          Break;
        Wait(200 + Random(100));
      end;
      if Result then
        Writeln('Demon random solved!');
    end;

  5. #5
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by TomTuff View Post
    Simba Code:
    function Demon_Successful: Boolean;
    var
      T: Integer;
    begin
      while ClickContinue(True, True) do
        Wait(800 + Random(400));
      T := GetSystemTime + 15000;
      while (GetSystemTime < T) and not(Result) do
      begin
        Result := not(Demon_InRandom);
        if Result then
          Break;
        Wait(200 + Random(100));
      end;
      if Result then
        Writeln('Demon random solved!');
    end;
    Not trying to butt in here, but...
    Simba Code:
    function Demon_Successful: Boolean;
    var
      T: Integer;
    begin
      while ClickContinue(True, True) do
        Wait(800 + Random(400));
      T := GetSystemTime + 15000;
      while (not (Result)) and (GetSystemTime < T) do
      begin
        Wait(200 + Random(100));
        Result := not(Demon_InRandom);
      end;
      if Result then
        Writeln('Demon random solved!');
    end;

    Doesn't make much difference but makes more sense logically, IMO anyways.

  6. #6
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    Not trying to butt in here, but...
    Simba Code:
    function Demon_Successful: Boolean;
    var
      T: Integer;
    begin
      while ClickContinue(True, True) do
        Wait(800 + Random(400));
      T := GetSystemTime + 15000;
      while (not (Result)) and (GetSystemTime < T) do
      begin
        Wait(200 + Random(100));
        Result := not(Demon_InRandom);
      end;
      if Result then
        Writeln('Demon random solved!');
    end;

    Doesn't make much difference but makes more sense logically, IMO anyways.
    It does save 2 lines but it makes more sense to perform the "Result := ..." before waiting some more, yes? It's minute, though, let's not argue over it

  7. #7
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by TomTuff View Post
    It does save 2 lines but it makes more sense to perform the "Result := ..." before waiting some more, yes? It's minute, though, let's not argue over it
    the if result then break is useless in a while not(result) loop....
    worry about waiting 200..300 ms is pretty overrated

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •