Results 1 to 5 of 5

Thread: XP Reward Update Layout

  1. #1
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default XP Reward Update Layout

    So I've updated the RD_SolveXP function for the new XP Reward layout that was updated today. I updated the Grid and slot numbers for each skill. I tested it on 4 lamps, and it worked perfectly.

    I've sent a pull request through Git.

    Here's an image of the new grid:


    Here's the code I used to find the correct grid and slot numbers:
    Simba Code:
    program new;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i srl/srl/misc/paintsmart.simba}

    var
      b : TBox;

    begin
      Smart_Server := 10;
      Smart_Members := True;
      Smart_Signed := True;
      SetupSRL();
      SMART_ClearCanvas();
      SMART_DrawBoxes(false, Grid(7, 4, 40, 40, 65, 57, point(64, 104)), clYellow);
      b := gridBox(23, 7, 4, 40, 40, 65, 57, point(64, 104));
      mouseBox(b.x1, b.y1, b.x2, b.y2, mouse_move);
    end.

    Here's the debug from the above code:
    Progress Report:
    SRL Compiled in 0 msec
    SMART Initialized.
    Loaded: Server 10, Members: True, Signed: True, Super Detail: False.
    RD_SolveLamp: Found experience lamp
    RD_SolveXP: Clicked XP reward
    RD_SolveXP: Solved experience reward
    Successfully executed.


    For those of you who know how to update the include, the following code goes into the /Simba/Includes/SRL/SRL/core/antirandoms/rewards.simba file. Just overwrite the existing function:
    Simba Code:
    function RD_SolveXP(x, y: integer; uptext: string): boolean;
    var
      slot, skill: integer;
      b: TBox;
    begin
      mmouse(x, y, 3, 3);
      if (waitUptext(uptext, 300)) then
      begin
        getmousePos(x, y);
        mouse(x, y, 0, 0, mouse_Left);
        addToSRLLog('RD_SolveXP: Clicked XP reward');

        // the color of the background (i.e. scroll color)
        if (not waitFindColor(x, y, 10803447, MSX1, MSY1, MSX2, MSY2, 5, 5000)) then
        begin
          addToSRLLog('RD_SolveXP: XP reward didn''t open');
          exit;
        end;

        // in case of runtime out of range
        if (length(players) <= 0) then
          skill := SKILL_MINING
        else
          skill := players[currentPlayer].lampSkill;

        // slot returned by gridBox below
        case skill of
          SKILL_ATTACK              : slot := 1;
          SKILL_DEFENCE             : slot := 15;
          SKILL_STRENGTH            : slot := 8;
          SKILL_HITPointS, SKILL_HP : slot := 22;
          SKILL_RANGE               : slot := 9;
          SKILL_PRAYER              : slot := 16;
          SKILL_MAGIC               : slot := 2;
          SKILL_COOKING             : slot := 24;
          SKILL_WOODCUTTING         : slot := 4;
          SKILL_FLETCHING           : slot := 6;
          SKILL_FISHING             : slot := 17;
          SKILL_FIREMAKING          : slot := 11;
          SKILL_CRAFTING            : slot := 18;
          SKILL_SMITHING            : slot := 10;
          SKILL_MINING              : slot := 3;
          SKILL_HERBLORE            : slot := 12;
          SKILL_AGILITY             : slot := 5;
          SKILL_THIEVING            : slot := 7;
          SKILL_SLAYER              : slot := 13;
          SKILL_FARMING             : slot := 19;
          SKILL_RUNECRAFTING        : slot := 25;
          SKILL_HUNTER              : slot := 20;
          SKILL_CONSTRUCTION        : slot := 14;
          SKILL_SUMMONING           : slot := 21;
          SKILL_DUNGEONEERING       : slot := 23;

          else
            slot := 3; // Mining
        end;

        b := gridBox(slot, 7, 4, 40, 40, 65, 57, point(64, 104));
        mouseBox(b.x1, b.y1, b.x2, b.y2, mouse_Left); // click skill

        wait(500 + random(500));
        mouse(387, 263, 20, 5, mouse_Left); // click confirm

        addToSRLLog('RD_SolveXP: Solved experience reward');
        wait(2000 + random(500));
        clickContinue(true, true);
        result := true;
      end;
    end;
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  2. #2
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Nice work. I like that layout much better than the old one.

    I'll merge this as soon as I can.

  3. #3
    Join Date
    Aug 2006
    Location
    USA
    Posts
    354
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice update I hated the old layout this one is easier to see

  4. #4
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Well done. And this new update is cool.
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  5. #5
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Thanks for sending a pull request. Merged.

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
  •