Page 3 of 3 FirstFirst 123
Results 51 to 64 of 64

Thread: Updated antirandom solvers

  1. #51
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by Ashaman88 View Post
    I'm confused as to why you don't just work on/change the OSR include, as a dev they would let you on there to change things + other people could help. Or are you making the same kind of huge changes like there were from srl5-6?

    From what I understand the osr include should be able to do everything you need it to (apart from randoms) ie I think I fixed all of the broken stuff.
    It's a project I've been working on for quite some time actually. I've made it for many reasons, but the simplest to explain here would be that AeroLib contains my own style which I don't want to force upon the official SRL-OSR. I've made it as up-to-date as possible, it's better organized, and many neat ideas that have been suggested on the forums I've placed in the library. It's intended to be an upgraded version of SRL-OSR, as much difference as SRL-5 to SRL-6.

    A good portion of SRL-OSR is still used in AeroLib but the majority of it was written from scratch. It's far too different to apply my changes to the current SRL-OSR include because many of the files are dependent upon one another; how I've personally wanted it to be all along. I've many projects I want to bring to AeroLib that are far from the traditional SRL format. Even if SRL-OSR could support them it'd raise a lot of questions with the other developers and I really prefer to avoid that. This way I don't have to limit my ideas and how I present them, as I'm also much more open to other people's suggestions on development.

    Quote Originally Posted by warpie View Post
    That would be a big drawback, so I really hope not.

    Ashaman88, SRL-OSR is not utilizing the capabilities of Lape, so a new include is better (if u ask me).
    Lape indeed. Although I feel like I've only utilized such a tiny amount of Lape's potential, but it's been fun learning so far.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  2. #52
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    ...
    I demand that you GitHub it ASAP.
    !No priv. messages please

  3. #53
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by warpie View Post
    I demand that you GitHub it ASAP.
    I'd like to get a lot more finished before I start uploading to GitHub.

    Edit:
    The Pinball random solver worked wonderfully. It finished a game smoothly in 80-90 seconds.
    Last edited by Flight; 02-08-2014 at 12:59 PM.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  4. #54
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    The box.simba random solver now encounters an error, if you are still working on this (which I don't think you are?)
    Simba Code:
    Error: Out Of Range at line 417
    Solar from RiD.

  5. #55
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by Solar View Post
    The box.simba random solver now encounters an error, if you are still working on this (which I don't think you are?)
    Simba Code:
    Error: Out Of Range at line 417
    Not for SRL-OSR, no.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  6. #56
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Made a Molly Solver

    Code:
    program R_MollySolve;
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR/SRL/misc/al_functions.simba}
    {$I SRL-OSR/SRL/Reflection/Reflection.simba}
    
    VAR
      Molly: TNPC;
      Fakes:  array of TNPC;
      StartArea, RandomArea: TBox;
      PlayerLoc, CraneLoc, DoorLoc, mousetile: TPoint;
      i: Integer;
      Twin,t: TNPC;
    
    Function InMollyRoom: Boolean;
    begin
      if (R_FindNPC('Molly', Molly)) then
      begin
        writeln('found molly: ' + inttostr(Molly.NPCId));
        Result := true;
      end;
    end;
    
    Procedure WalkOutDoor;
    var DoorLoc, Coord: TPoint;
    
    begin
       DoorLoc := Point((R_GetTileGlobal.x + 2), R_GetTileGlobal.y);
       R_OpenDoor(DoorLoc, 'E');
       repeat
          wait(100);
       until(FindNPCChatText('Molly', Nothing));
       clicktoContinue;
       ChatWait;
       ChatWait;
       if FindNPCChatText('Select', Nothing) then
       begin
        FindNPCChatText('know', ClickLeft);
        ChatWait;
        ChatWait;
        ClickToContinue;
        ChatWait;
        ChatWait;
        ClickToContinue;
        wait(2000);
       end;
    end;
    
    Function GoToControls: Boolean;
    var ControlBoxLoc, BoxCoords: TPoint;
    begin
      MakeCompass('E');
       ControlBoxLoc := Point((R_getTileGlobal.x + 5), (R_getTileGlobal.y - 2));
       BoxCoords := R_TileToMS(ControlBoxLoc);
       MMouse(BoxCoords.x, BoxCoords.y, 3, 3);
       wait(200+random(200));
       if (IsUpText('panel')) then
       begin
        clickmouse2(Mouse_left);
       end;
    end;
    
    Function OnControls: Boolean;
    var x, y: Integer;
    begin
      result := findcolortolerance(x,y,39423,665,212,723,257,1);
    end;
    
    Function findEvilTwin: TNPC;
    var tempTNPCArray: TNPCArray;
        tmp: TNPC;
        i, loc, lowestID: integer;
    begin
       tempTNPCArray := R_GetAllNPCs;
        lowestID := 10000000;
       for i := 0 to high(tempTNPCArray) do
       begin
         if (tempTNPCArray[i].Index < lowestID) then
         begin
           lowestId := tempTNPCArray[i].index;
           loc := i;
         end;
       end;
       result := tempTNPCArray[loc];
    
    end;
    
    Procedure ControlArm(dir: String; var Coord: Tpoint);
    begin
      case dir of
          'u': begin
                  Mouse(640, 290, 1, 1, Mouse_left);
                  dec(Coord.y);
                  wait(300+random(500))
               end;
          'd': begin
                  Mouse(639, 385, 1, 1, Mouse_left);
                  inc(Coord.y);
                  wait(300+random(500))
               end;
          'l': begin
                  Mouse(593, 333, 1, 1, Mouse_left);
                  inc(Coord.x);
                  wait(300+random(500))
               end;
          'r': begin
                  Mouse(693, 330, 1, 1, Mouse_left);
                  dec(Coord.x);
                  wait(300+random(500))
               end;
       end;
    end;
    
    Function overFake: boolean;
    begin
      R_FindNPC(t.NPCID, Twin);
      Result:= ((CraneLoc.x = Twin.Tile.x) and (CraneLoc.y = Twin.Tile.y))
    end;
    
    
    Function GoUp:Boolean;
    begin
      R_FindNPC(t.NPCID, Twin);
      Result := (CraneLoc.y > Twin.tile.y);
    end;
    
    Function GoDown: Boolean;
    begin
      R_FindNPC(t.NPCID, Twin);
      Result := (CraneLoc.y < Twin.tile.y);
    end;
    
    Function GoRight: Boolean;
    begin
      R_FindNPC(t.NPCID, Twin);
      Result := (CraneLoc.x > Twin.tile.x);
    end;
    
    Function GoLeft: Boolean;
    begin
      R_FindNPC(t.NPCID, Twin);
      Result := (CraneLoc.x < Twin.tile.x);
    end;
    
    Function WaitForControl:boolean;
    begin
      repeat
        wait(100);
      until(GetColor(699, 234) =  39423)
      result := true;
    end;
    
    
    Function CatchTheFake:Boolean;
    var xStart: Tpoint;
        dir: String;
        i, yDis, xDis:Integer;
    begin
    
      CraneLoc.x := R_GetTileGlobal.x;
      CraneLoc.y := R_GetTileGlobal.y - 4;
      repeat
        R_FindNPC(t.NPCID, Twin);
        begin
          if (overFake) then
          begin
            Mouse(699,423,2,2,Mouse_left);
            continue;
          end;
          if GoUp then
          begin
          R_FindNPC(t.NPCID, Twin);
            ControlArm('u',CraneLoc);
            continue;
          end;
          if GoDown then
          begin
            R_FindNPC(t.NPCID, Twin);
            ControlArm('d',CraneLoc);
            continue;
          end;
          if GoLeft then
          begin
            R_FindNPC(t.NPCID, Twin);
            ControlArm('l',CraneLoc);
            continue;
          end else
          if GoRight then
          begin
            R_FindNPC(t.NPCID, Twin);
            ControlArm('r',CraneLoc);
            continue;
          end;
    
        end;
      until(FindBlackChatMessage('Evil'));
    end;
    
    Procedure BackToDoor;
    begin
      doorLoc.x:= R_GetTileGlobal.x - 5;
      doorLoc.y:= R_GetTileGlobal.y + 1;
      R_OpenDoor(doorLoc,'W');
    end;
    
    Procedure WaitTilInRoom;
    var PlayerLoc: TPoint;
    begin
      repeat
        wait(100);
      until(R_FindNPC('Molly',Molly));
      PlayerLoc := R_TileToMS(Molly.Tile)
      Mouse(playerLoc.x, PlayerLoc.Y, 1, 1, Mouse_Left);
    end;
    
    begin
      SetupSRL;
      SetupReflection;
      ActivateClient;
      if InMollyRoom then
      begin
        MakeCompass('N');
        WalkOutDoor;
        GoToControls;
        WaitForControl;
        t:= findEvilTwin;
        CatchTheFake;
        repeat
          wait(100);
        until(FindNPCCHatText('Molly',nothing));
        ClickToContinue;
        ChatWait;
        ClickToContinue;
        makeCompass('w');
        doorLoc.x:= R_GetTileGlobal.x - 5;
        doorLoc.y:= R_GetTileGlobal.y + 1;
        mousetile := R_TileToMS(doorLoc);
        Mouse(mouseTile.x, Mousetile.y, 1, 1, Mouse_left)
        wait(4000);
        R_OpenDoor(R_GetTileGlobal,'W');
        waitTilInRoom;
        wait(1000);
        clicktoContinue;
        ChatWait;
        ChatWait;
        ClickToContinue;
        ChatWait;
        ChatWait;
        ClickToContinue;
      end;
    
    
    
    
    end.

  7. #57
    Join Date
    Feb 2006
    Location
    Australia
    Posts
    628
    Mentioned
    15 Post(s)
    Quoted
    105 Post(s)

    Default

    Quote Originally Posted by jhildy View Post
    Made a Molly Solver
    Well done for contributing mate, looks like it works, but are you sure that the evil twin's index is always the lowest? How many times have you tested this solver?
    You could also post this in the reflection thread, since this thread related to the SRL-OSR include's colour random solvers. Thanks for posting anyways

  8. #58
    Join Date
    Aug 2007
    Posts
    539
    Mentioned
    20 Post(s)
    Quoted
    266 Post(s)

    Default

    Quote Originally Posted by jhildy View Post
    Made a Molly Solver

    Code:
    program R_MollySolve;
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR/SRL/misc/al_functions.simba}
    {$I SRL-OSR/SRL/Reflection/Reflection.simba}
    
    VAR
      Molly: TNPC;
      Fakes:  array of TNPC;
      StartArea, RandomArea: TBox;
      PlayerLoc, CraneLoc, DoorLoc, mousetile: TPoint;
      i: Integer;
      Twin,t: TNPC;
    
    Function InMollyRoom: Boolean;
    begin
      if (R_FindNPC('Molly', Molly)) then
      begin
        writeln('found molly: ' + inttostr(Molly.NPCId));
        Result := true;
      end;
    end;
    
    Procedure WalkOutDoor;
    var DoorLoc, Coord: TPoint;
    
    begin
       DoorLoc := Point((R_GetTileGlobal.x + 2), R_GetTileGlobal.y);
       R_OpenDoor(DoorLoc, 'E');
       repeat
          wait(100);
       until(FindNPCChatText('Molly', Nothing));
       clicktoContinue;
       ChatWait;
       ChatWait;
       if FindNPCChatText('Select', Nothing) then
       begin
        FindNPCChatText('know', ClickLeft);
        ChatWait;
        ChatWait;
        ClickToContinue;
        ChatWait;
        ChatWait;
        ClickToContinue;
        wait(2000);
       end;
    end;
    
    Function GoToControls: Boolean;
    var ControlBoxLoc, BoxCoords: TPoint;
    begin
      MakeCompass('E');
       ControlBoxLoc := Point((R_getTileGlobal.x + 5), (R_getTileGlobal.y - 2));
       BoxCoords := R_TileToMS(ControlBoxLoc);
       MMouse(BoxCoords.x, BoxCoords.y, 3, 3);
       wait(200+random(200));
       if (IsUpText('panel')) then
       begin
        clickmouse2(Mouse_left);
       end;
    end;
    
    Function OnControls: Boolean;
    var x, y: Integer;
    begin
      result := findcolortolerance(x,y,39423,665,212,723,257,1);
    end;
    
    Function findEvilTwin: TNPC;
    var tempTNPCArray: TNPCArray;
        tmp: TNPC;
        i, loc, lowestID: integer;
    begin
       tempTNPCArray := R_GetAllNPCs;
        lowestID := 10000000;
       for i := 0 to high(tempTNPCArray) do
       begin
         if (tempTNPCArray[i].Index < lowestID) then
         begin
           lowestId := tempTNPCArray[i].index;
           loc := i;
         end;
       end;
       result := tempTNPCArray[loc];
    
    end;
    
    Procedure ControlArm(dir: String; var Coord: Tpoint);
    begin
      case dir of
          'u': begin
                  Mouse(640, 290, 1, 1, Mouse_left);
                  dec(Coord.y);
                  wait(300+random(500))
               end;
          'd': begin
                  Mouse(639, 385, 1, 1, Mouse_left);
                  inc(Coord.y);
                  wait(300+random(500))
               end;
          'l': begin
                  Mouse(593, 333, 1, 1, Mouse_left);
                  inc(Coord.x);
                  wait(300+random(500))
               end;
          'r': begin
                  Mouse(693, 330, 1, 1, Mouse_left);
                  dec(Coord.x);
                  wait(300+random(500))
               end;
       end;
    end;
    
    Function overFake: boolean;
    begin
      R_FindNPC(t.NPCID, Twin);
      Result:= ((CraneLoc.x = Twin.Tile.x) and (CraneLoc.y = Twin.Tile.y))
    end;
    
    
    Function GoUp:Boolean;
    begin
      R_FindNPC(t.NPCID, Twin);
      Result := (CraneLoc.y > Twin.tile.y);
    end;
    
    Function GoDown: Boolean;
    begin
      R_FindNPC(t.NPCID, Twin);
      Result := (CraneLoc.y < Twin.tile.y);
    end;
    
    Function GoRight: Boolean;
    begin
      R_FindNPC(t.NPCID, Twin);
      Result := (CraneLoc.x > Twin.tile.x);
    end;
    
    Function GoLeft: Boolean;
    begin
      R_FindNPC(t.NPCID, Twin);
      Result := (CraneLoc.x < Twin.tile.x);
    end;
    
    Function WaitForControl:boolean;
    begin
      repeat
        wait(100);
      until(GetColor(699, 234) =  39423)
      result := true;
    end;
    
    
    Function CatchTheFake:Boolean;
    var xStart: Tpoint;
        dir: String;
        i, yDis, xDis:Integer;
    begin
    
      CraneLoc.x := R_GetTileGlobal.x;
      CraneLoc.y := R_GetTileGlobal.y - 4;
      repeat
        R_FindNPC(t.NPCID, Twin);
        begin
          if (overFake) then
          begin
            Mouse(699,423,2,2,Mouse_left);
            continue;
          end;
          if GoUp then
          begin
          R_FindNPC(t.NPCID, Twin);
            ControlArm('u',CraneLoc);
            continue;
          end;
          if GoDown then
          begin
            R_FindNPC(t.NPCID, Twin);
            ControlArm('d',CraneLoc);
            continue;
          end;
          if GoLeft then
          begin
            R_FindNPC(t.NPCID, Twin);
            ControlArm('l',CraneLoc);
            continue;
          end else
          if GoRight then
          begin
            R_FindNPC(t.NPCID, Twin);
            ControlArm('r',CraneLoc);
            continue;
          end;
    
        end;
      until(FindBlackChatMessage('Evil'));
    end;
    
    Procedure BackToDoor;
    begin
      doorLoc.x:= R_GetTileGlobal.x - 5;
      doorLoc.y:= R_GetTileGlobal.y + 1;
      R_OpenDoor(doorLoc,'W');
    end;
    
    Procedure WaitTilInRoom;
    var PlayerLoc: TPoint;
    begin
      repeat
        wait(100);
      until(R_FindNPC('Molly',Molly));
      PlayerLoc := R_TileToMS(Molly.Tile)
      Mouse(playerLoc.x, PlayerLoc.Y, 1, 1, Mouse_Left);
    end;
    
    begin
      SetupSRL;
      SetupReflection;
      ActivateClient;
      if InMollyRoom then
      begin
        MakeCompass('N');
        WalkOutDoor;
        GoToControls;
        WaitForControl;
        t:= findEvilTwin;
        CatchTheFake;
        repeat
          wait(100);
        until(FindNPCCHatText('Molly',nothing));
        ClickToContinue;
        ChatWait;
        ClickToContinue;
        makeCompass('w');
        doorLoc.x:= R_GetTileGlobal.x - 5;
        doorLoc.y:= R_GetTileGlobal.y + 1;
        mousetile := R_TileToMS(doorLoc);
        Mouse(mouseTile.x, Mousetile.y, 1, 1, Mouse_left)
        wait(4000);
        R_OpenDoor(R_GetTileGlobal,'W');
        waitTilInRoom;
        wait(1000);
        clicktoContinue;
        ChatWait;
        ChatWait;
        ClickToContinue;
        ChatWait;
        ChatWait;
        ClickToContinue;
      end;
    
    
    
    
    end.
    Quote Originally Posted by Krazy_Meerkat View Post
    Well done for contributing mate, looks like it works, but are you sure that the evil twin's index is always the lowest? How many times have you tested this solver?
    You could also post this in the reflection thread, since this thread related to the SRL-OSR include's colour random solvers. Thanks for posting anyways
    The molly ID is not always the lowest NpcID. You can get the correct suspect NPC by getting the original molly ModelIDs, then checking the suspect's ModelIDs if it equals the original molly's.

  9. #59
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    nah it was the index that was the lowest but apparently that was just a coincidence so nvm lol. Gonna have to test some more times when i get the random. Everything else works though. How do you check model ID?

  10. #60
    Join Date
    Aug 2007
    Posts
    539
    Mentioned
    20 Post(s)
    Quoted
    266 Post(s)

    Default

    Quote Originally Posted by jhildy View Post
    nah it was the index that was the lowest but apparently that was just a coincidence so nvm lol. Gonna have to test some more times when i get the random. Everything else works though. How do you check model ID?
    Simba Code:
    function R_GetRSNPCModelIDs(NPC_Comp:Integer):TIntegerArray;
    var i, j, _count, _id : integer;
    begin
      _Count := SmartGetFieldArraySize(SmartCurrentTarget, NPC_Comp, NPCComposite_getModelIDs, 0);
      for i:=0 to _Count do begin
        _id := SmartGetFieldArrayInt(SmartCurrentTarget, NPC_Comp, NPCComposite_getModelIDs, i);
        if(_id <= 0)then
          continue;
        inc(j);
        SetLength(Result, j);
        result[j-1] := _id;
      end;
    end;
    The hook and multiplier being 'l'.

  11. #61
    Join Date
    Feb 2006
    Location
    Australia
    Posts
    628
    Mentioned
    15 Post(s)
    Quoted
    105 Post(s)

    Default

    Quote Originally Posted by ineedbot View Post
    The molly ID is not always the lowest NpcID. You can get the correct suspect NPC by getting the original molly ModelIDs, then checking the suspect's ModelIDs if it equals the original molly's.
    I know you're trying to help, but I was already aware of this my friend. I was just asking if jhildy had tested his method because it's very easy to underestimate reflection antirandom solvers when you first start working on them.. I did my best to suggest the problem without demeaning jhildy's efforts.

  12. #62
    Join Date
    Sep 2013
    Posts
    90
    Mentioned
    1 Post(s)
    Quoted
    44 Post(s)

    Default

    now there is f2p wouldn't it be easier to get accounts that are in randoms? it would be nice if i could see a color random solver for all sometime soon, but that is an almost impossible task with only a few devs, and I'm just an amateur.

  13. #63
    Join Date
    Feb 2006
    Location
    Australia
    Posts
    628
    Mentioned
    15 Post(s)
    Quoted
    105 Post(s)

    Default

    Quote Originally Posted by Qw4rt6yu9 View Post
    now there is f2p wouldn't it be easier to get accounts that are in randoms? it would be nice if i could see a color random solver for all sometime soon, but that is an almost impossible task with only a few devs, and I'm just an amateur.
    There is no active development of the OSR include.. The community helps maintain it.
    Last edited by Krazy_Meerkat; 08-19-2014 at 03:52 PM.

  14. #64
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Yeah i made this very quickly and only tested it in one instance of the random. There should be a few more failsafes in it and if you can get the model ID added in it does work. The reason the door opening function and controls function were kind of messy was because the tiles are different in every instance of the random. But the claw works perfectly as long as it has the right npc targeted.

    Edit: tested it in one instance several times after logging out so the npcs and tiles were different every time.

Page 3 of 3 FirstFirst 123

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
  •