Results 1 to 18 of 18

Thread: Simba + Evony

  1. #1
    Join Date
    Oct 2010
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Post Simba + Evony

    I've been learning Simba and playing Evony and after being told that there was NO WAY to create a bot with zero setup, I created a simple "proof of concept" to show how the Rally Spot, Barracks, and Feasting Hall (or Inn -- it can't pick between the two yet) screen coords could be tested for independent of browser and monitor attributes for each city.

    While it's not a bot, and probably not complete, I'm hoping it will jumpstart a discussion on getting Simba to work on Evony.

    -- EGM

  2. #2
    Join Date
    Dec 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I used to play this game a bit, I thought it was a bit pointless. But a bot for it...? I'll look at what you have done.

  3. #3
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Could you post in tags please.
    I never trust attachments

  4. #4
    Join Date
    Dec 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    Could you post in tags please.
    I never trust attachments
    It's perfectly safe.

  5. #5
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Building DDTMs.simba -
    pascal Code:
    function SetBlueDDTM: Integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..1] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 18;
      dtmMainPoint.y := 24;
      dtmMainPoint.AreaSize := 2;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 10223633;
      dtmMainPoint.Tolerance := 2;

      dtmSubPoints[0].x := 18;
      dtmSubPoints[0].y := 24;
      dtmSubPoints[0].AreaSize := 2;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 10223633;
      dtmSubPoints[0].Tolerance := 2;

      dtmSubPoints[1].x := 21;
      dtmSubPoints[1].y := 22;
      dtmSubPoints[1].AreaSize := 2;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 16777215;
      dtmSubPoints[1].Tolerance := 2;

      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
      Result := AddSDTM(TempTDTM);
    end;

    function SetRedDDTM: Integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..1] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 14;
      dtmMainPoint.y := 7;
      dtmMainPoint.AreaSize := 2;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 229;
      dtmMainPoint.Tolerance := 2;

      dtmSubPoints[0].x := 14;
      dtmSubPoints[0].y := 7;
      dtmSubPoints[0].AreaSize := 2;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 229;
      dtmSubPoints[0].Tolerance := 2;

      dtmSubPoints[1].x := 12;
      dtmSubPoints[1].y := 10;
      dtmSubPoints[1].AreaSize := 2;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 16777215;
      dtmSubPoints[1].Tolerance := 2;

      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
      Result := AddSDTM(TempTDTM);
    end;

    function SetGreenDDTM: Integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..1] of TDTMPointDef;
      TempTDTM: TDTM;
    begin
      dtmMainPoint.x := 17;
      dtmMainPoint.y := 15;
      dtmMainPoint.AreaSize := 2;
      dtmMainPoint.AreaShape := 0;
      dtmMainPoint.Color := 102217;
      dtmMainPoint.Tolerance := 2;

      dtmSubPoints[0].x := 17;
      dtmSubPoints[0].y := 15;
      dtmSubPoints[0].AreaSize := 2;
      dtmSubPoints[0].AreaShape := 0;
      dtmSubPoints[0].Color := 102217;
      dtmSubPoints[0].Tolerance := 2;

      dtmSubPoints[1].x := 17;
      dtmSubPoints[1].y := 17;
      dtmSubPoints[1].AreaSize := 2;
      dtmSubPoints[1].AreaShape := 0;
      dtmSubPoints[1].Color := 16777215;
      dtmSubPoints[1].Tolerance := 2;

      TempTDTM.MainPoint := dtmMainPoint;
      TempTDTM.SubPoints := dtmSubPoints;
      Result := AddSDTM(TempTDTM);
    end;

    FindBuildingsTest_v2.simba -
    pascal Code:
    program FindBuildingsTest;
    {-------------------------------------------------------------------------------
    FindBuildingsTest v2 -- "proof of concept" example to locate Feasting Hall,
    Rally Spot, and Barracks buildings using Dynamic Deformable Template Models (or
    DDTM's)

    Instructions:
    1. Drag the target icon from the button bar above onto the flash player client
    in your browser.

    2. Select 'Town' in Evony.

    3. Make sure the building levels are showing and no windows are open.

    What is it doing? Searches within a box for a DTM, which is a point described by
    a color a certain distance from another point also described by a color. DTMs
    can have as many points as necessary. Each point was given a tolerance of 2 for
    both size and color, giving a bit of flexability to the model.

    Tested on Google Chrome browser with a client size of 1215 x 709 px.

    Next step is to modify DDTM routines to use percentages. (All three were created
    using DDTM_editor and left as-is, which comes with the SRL resource library
    download and is also available seperately.)

    Changes:
     v2
      + Added a loop to look for Feasting Hall/Inn, Rally Spot, and Barracks in all
      cities instead of just the one on the screen. Selects each city starting at the
      top, and stops when encounters a blank tile.

      ! Moved point conversion and DTM functions to seperate files as includes to make
      the main block easier to read.

      + Added a compiler instruction to make turning on/off debugging simple.

      + Added additional comments throughout for readability.

      + Added a section for constants to allow tweaking when necessary.
    -------------------------------------------------------------------------------}


    //Compiler instructions
    //{$define debug} //Uncomment for add'l debugging info to be added to output

    //Global constants
    const
      LOAD_WAIT = 2000; //Pause in mS for city to switch and image to reload.

      //City Test
      CT_COLOR = 10209771;
      CT_TOLERANCE = 2;
      CT_THRESHOLD = 1;

    //Global types
    type
      TDTMPointDef = TSDTMPointDef;
      TDTMPointDefArray = TSDTMPointDefArray;
      TDTM = TSDTM;

    //Global variables
    var
      cw, ch : integer;   //Client width and height
      TownBox : TBox;     //Town search bounds
      CitiesBox : TBox;   //Cities selector area
      BlueDDTM, RedDDTM, GreenDDTM : integer; //Template to search for
      fx, fy : integer;   //Results
      i, xs, ys, xe, ye : integer;

    {$I Point Conversions.simba}
    {$I Building DDTMs.simba}

    procedure Init;
      begin
        GetClientDimensions(cw, ch);
        with TownBox do
          begin
            X1 := PercentToScreenX(5.26748971193416);
            Y1 := PercentToScreenY(17.636684303351);
            X2 := PercentToScreenX(65.3497942386831);
            Y2 := PercentToScreenY(70.8289241622575);
          end;
        with CitiesBox do
          begin
            X1 := PercentToScreenX(73.1687242798353);
            Y1 := PercentToScreenY(36.8253968253968);
            X2 := PercentToScreenX(79.2592592592592);
            Y2 := PercentToScreenY(98.342151675485);
          end;
        BlueDDTM := SetBlueDDTM;
        RedDDTM := SetRedDDTM;
        GreenDDTM := SetGreenDDTM;
        i := 0;
      end;

    begin
      Init;           //Run initialization procedure above
      ClearDebug;     //Clear old from debug window below
      ActivateClient; //Make client window active window
      with CitiesBox do
        begin
          xs := X1 + 10;
          xe := X2 - 10;
          ys := Y1 + ((Y2 - Y1) / 10 * i) + 10;
          ye := ys + ((Y2 - Y1) / 10) - 10;
          while CountColorTolerance(CT_COLOR, xs, ys, xe, ye, CT_TOLERANCE) < CT_THRESHOLD do
            begin
              {$ifdef debug}
                writeln(format('Search box = (%d, %d, %d, %d), Result = %d',
                  [xs, ys, xe, ye,
                  CountColorTolerance(CT_COLOR, xs, ys, xe, ye, CT_TOLERANCE)]));
              {$endif}
              MoveMouse(xs, ys);
              ClickMouse(xs, ys, Mouse_Left);
              Sleep(LOAD_WAIT);

              //Write # of city, starting at the top.
              writeln(format('-+ City #%2d', [i + 1]));

              //Search the town for Feasting Hall, Rally Spot, and Barracks
              // if successful, return the screen coordinates
              // otherwise so something else
              with TownBox do
                begin
                  //Line below is how it would look without 'with TownBox' statement
                  //if FindDTM(BlueDDTM, fx, fy, TownBox.X1, TownBox.Y1, TownBox.X2, TownBox.Y2) then
                  if FindDTM(BlueDDTM, fx, fy, X1, Y1, X2, Y2) then
                    writeln(format(' +- Feasting Hall (or perhaps Inn) found at (%d, %d)', [fx, fy]))
                  else
                    writeln(' +- No result for Feasting Hall(or Inn).');

                  if FindDTM(RedDDTM, fx, fy, X1, Y1, X2, Y2) then
                    writeln(format(' +- Rally Spot found at (%d, %d)', [fx, fy]))
                  else
                    writeln(' +- No result for Rally Spot.');

                  if FindDTM(GreenDDTM, fx, fy, X1, Y1, X2, Y2) then
                    writeln(format(' +- Barracks found at (%d, %d)', [fx, fy]))
                  else
                    writeln(' +- No result for Barracks.');
                end; //with TownBox block

              //Increment the counter and set box to next city to test
              Inc(i);
              xs := X1 + 10;
              xe := X2 - 10;
              ys := Y1 + ((Y2 - Y1) / 10 * i) + 10;
              ye := ys + ((Y2 - Y1) / 10) - 10;

            end; //while..do loop block
        end; //with CitiesBox block

      //Free everything
      FreeDTM(BlueDDTM);
      FreeDTM(RedDDTM);
      FreeDTM(GreenDDTM);
    end.

    Point Conversions.simba
    pascal Code:
    function PercentToScreenX(const p: Variant): integer;
    begin
      Result := (p * cw / 100);
    end;

    function PercentToScreenY(const p: Variant): integer;
    begin
      Result := (cw * 7 * p / 1200);
    end;

    function ScreenToPercentX(const s: Variant): Variant;
    begin
      Result := (s * 100.0 / cw);
    end;

    function ScreenToPercentY(const s: Variant): Variant;
    begin
      Result := (s * 100.0)/(cw * 7.0 / 12.0);
    end;

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

    Default

    tbh, there are so many "Clickbots" and packet sending bots out there for evony, it's not even worth it making one for simba.

    PS quit now, shit sucks.

  7. #7
    Join Date
    Oct 2010
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by TomTuff View Post
    tbh, there are so many "Clickbots" and packet sending bots out there for evony, it's not even worth it making one for simba.

    PS quit now, shit sucks.
    While I agree that there are more click-bots than Tinos has pizza-rolls, I started pursuing this for a number of reasons.

    1. I was unhappy that I couldn't find any click-bot to date that effectively had a "no click" setup.
    2. I enjoy Simba and it's one of the best platforms to code in.
    3. I was told that what this code does couldn't be done.
    4. I think I enjoy programming bots more than I enjoy playing! (But can't quit playing...)


    Tom, to which "shit" are you referring: Evony, Simba, or my code?

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

    Default

    Evony. My step-mom practically left my dad because of it. We both used to play, I don't anymore but he still does (though not as much, but he still has the once-a-week all-night binge).

  9. #9
    Join Date
    Oct 2010
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by TomTuff View Post
    Evony. My step-mom practically left my dad because of it. We both used to play, I don't anymore but he still does (though not as much, but he still has the once-a-week all-night binge).
    Okay, can't disagree with that... especially since I've had to cut WAAAY back since coming close to losing things myself because of that infernal game.

    Nowadays it's more of a social thing for me, talking to people, friends I've made. Unfortunately, daily minimum maintenance time is still required and I would like to make that as small and unobtrusive aspect as possible.

    "Free Forever"? That's a nice catchphrase, while they try to suck every penny out of you they can. I simply refuse. Nor will I spend a dime on a bot for the same reasons.

    But like I said before, in the end I'll enjoy the programming and wind up with something I can be truly happy with.

  10. #10
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    As much as I agree the game is probably garbage (you can base this pretty much on how sleazy they made their banner advertisements, lol), that is irrelevant for this thread.

    Looks really nice so far! Keep up the good work.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  11. #11
    Join Date
    Sep 2010
    Location
    Northern Kentuckeh
    Posts
    759
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Never heard of this game. What is it similar to?

  12. #12
    Join Date
    Nov 2010
    Location
    Australia
    Posts
    1,472
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Its a game where you build your army, get as many towns/villages, kill people etc. Its like Ikariam or travian or KoB, if you've ever heard of em.

  13. #13
    Join Date
    Sep 2010
    Location
    Northern Kentuckeh
    Posts
    759
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Is it fun?

  14. #14
    Join Date
    Nov 2010
    Location
    Australia
    Posts
    1,472
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    If you're willing to spend hours(make that hours and hours and hours) of your time managing some village full of troops, then I guess it is.

  15. #15
    Join Date
    Oct 2010
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by kongking View Post
    If you're willing to spend hours(make that hours and hours and hours) of your time managing some village full of troops, then I guess it is.
    That about sums it up.

    Best to leave the simple management and daily maintenance to automation and leave time for socializing in chats or actively fighting. Its basically flawed in many ways, and contains blatant ads and numerous specials to part you with your money. I can say that without feeling badly since most people who actively play are too addicted to care, like myself.

  16. #16
    Join Date
    Sep 2010
    Location
    Northern Kentuckeh
    Posts
    759
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Lol I'm scared to play now, sounds like I have to sell my soul. I just got it back after I found SRL ^_^

  17. #17
    Join Date
    Oct 2010
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Are you implying there's a mmorpg that doesn't require a lil soul selling?

  18. #18
    Join Date
    Sep 2010
    Location
    Northern Kentuckeh
    Posts
    759
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by EGM View Post
    Are you implying there's a mmorpg that doesn't require a lil soul selling?
    I don't mind selling parts of it

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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