Results 1 to 14 of 14

Thread: FightMode (rev 33) doesn't work

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

    Default FightMode (rev 33) doesn't work

    SCAR Code:
    writeln('FightMode = '+inttostr(m+1));
             SetFightMode(m+1);

    In the debug i get:
    Code:
      FightMode = 1
    but it won't change fightmode, just moves the mouse to the upper left corner
    -_-'

  2. #2
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Drag the crosshair on the client.
    Restart scar, if you use smart, restart smart.
    ~Hermen

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

    Default

    Quote Originally Posted by Hermen View Post
    Drag the crosshair on the client.
    Restart scar, if you use smart, restart smart.
    ehm, yes i did that a hundred times and it doesnt work.
    SetFightMode('attack') works correctly.

    was this even tested with integers?

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

    Default

    Ive had trouble with it too since #33
    Ce ne sont que des gueux


  5. #5
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Oh ok my bad. I guess I should have tested before commiting. Anyway fix is up in the Dev SVN. Or here's the fixed procedure:

    SCAR Code:
    {*******************************************************************************
    function SetFightMode(oFightMode: Integer): Boolean;
    By: Nielsie95, Quickmarch, Timer, and Nava2
    Description: Sets fight mode.  Returns false if failed to set desired mode.
    *******************************************************************************}


    function SetFightMode(oFightMode: Variant): Boolean;
    var
      i, x, y, r: Integer;
      b: TBox;
      cmbBoxes: array of TBox;
      strs: array of array of String;
    begin
      Result := False;
      if not(Loggedin)then Exit;
      GameTab(1);
      Wait(200 + Random(777));

      cmbBoxes := [IntToBox(575, 255, 630, 290), IntToBox(660, 255, 710, 290), IntToBox(575, 310, 630, 345), IntToBox(660, 310, 710, 345)];
      strs := [TStringArray(['attack', 'att']), TStringArray(['strength', 'str']), TStringArray(['controlled', 'control', 'ctrl', 'multi']), TStringArray(['defence', 'def', 'defense'])];
      case VarType(oFightMode) of
        3: begin b := cmbBoxes[Integer(oFightMode) - 1]; r := oFightMode; end;
        256: for x := 0 to 3 do
             begin
               i := High(strs[x]);
               for y := 0 to i do
                 if Lowercase(oFightMode) = strs[x][y] then
                 begin
                   b := cmbBoxes[x];
                   r := x + 1;
                   Break;
                 end;
               if b.x1 <> 0 then Break;
             end;
      end;
      i := 0;
      while (i < 4) do
      begin
        Result := FindColorTolerance(x, y, 1777020, b.x1, b.y1, b.x2, b.y2, 2);
        if (Result) then Exit;
        Mouse(RandomRange(b.x1, b.x2), RandomRange(b.y1, b.y2), 0, 0, True);
        Wait(500 + Random(300));
        Inc(i);
      end;
      if (not Result) and (r = 4) then
        SetFightMode(3);
    end;

  6. #6
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Only problem I don't like with that function is it uses high trust that all weapons have that setup (att, str, con, def) when they don't. Good thing its Boolean now tho.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  7. #7
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    Only problem I don't like with that function is it uses high trust that all weapons have that setup (att, str, con, def) when they don't. Good thing its Boolean now tho.
    You can always go back to using integers if strings don't suit its purpose.

  8. #8
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Hmm, I think I might just remove this..

    All it should do is just pick the color, a variant is useless and inaccurate.

    We ahve SetCombatType for this..

    Redundant, yes?
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  9. #9
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    The old one had a fail safe for Range, and weapons with only 3 options.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  10. #10
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by noidea View Post
    The old one had a fail safe for Range, and weapons with only 3 options.
    I think I'm going to revert tbh.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  11. #11
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Well I'm going to figure something out for this. I know I had a nice one that u put in SRL I've heard some problems with it but maybe thats just me. I want to get a fool proof one somehow.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  12. #12
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Can you not use the the I made Nava2?

  13. #13
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Narcle View Post
    Well I'm going to figure something out for this. I know I had a nice one that u put in SRL I've heard some problems with it but maybe thats just me. I want to get a fool proof one somehow.
    We should create a function that will I identify the layout, then just use that to create the boxes.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  14. #14
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Nava2 View Post
    We should create a function that will I identify the layout, then just use that to create the boxes.
    That's what I was thinking. I haven't logged into RS in awhile but once I do I'll look and maybe figure it out.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

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
  •