Results 1 to 10 of 10

Thread: FindLamp fix

  1. #1
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default FindLamp fix

    i noticed that FindLamp in AntiRandoms.scar had broken because the lamp had been updated and changed slightly so i decided to fix it
    SCAR Code:
    function FindLamp(skill: string): Boolean;
    var
      LampTime, x, y, i: Integer;
    begin
      GameTab(4);
      if FindColorTolerance(x, y, 1084300, MIX1, MIY1, MIX2, MIY2, 40) then
        if (FindBitmapToleranceIn(Lamp, x, y, MIX1, MIY1, MIX2, MIY2, 40)) then
        begin
          Result := True;
          Mouse(x, y, 1, 1, True);
          Wait(1500 + Random(500));
          MarkTime(LampTime);
          for i:= 1 to 4 do
          begin
            case (LowerCase(Skill)) of
              'attack': Mouse(61, 90, 35, 35, True);
              'strength': Mouse(125, 97, 35, 35, True);
              'ranged': Mouse(184, 97, 35, 35, True);
              'magic': Mouse(241, 97, 35, 35, True);
              'defence': Mouse(302, 95, 35, 5, True);
              'crafting', 'craft': Mouse(358, 95, 35, 35, True);
              'hitpoints', 'hp': Mouse(419, 95, 35, 35, True);
              'prayer', 'pray': Mouse(60, 150, 35, 35, True);
              'agility': Mouse(125, 150, 35, 35, True);
              'herblore': Mouse(177, 150, 35, 35, True);
              'thieving', 'thief': Mouse(237, 150, 35, 35, True);
              'fishing', 'fish': Mouse(303, 150, 35, 35, True);
              'runecraft', 'runecrafting': Mouse(356, 150, 35, 35, True);
              'slayer', 'slay': Mouse(421, 150, 35, 35, True);
              'farming', 'farm': Mouse(63, 205, 35, 35, True);
              'mining', 'mine': Mouse(120, 205, 35, 35, True);
              'smithing', 'smith': Mouse(180, 205, 35, 35, True);
              'hunting', 'hunt', 'hunter': Mouse(241, 205, 35, 35, True);
              'cooking', 'cook': Mouse(303, 205, 35, 35, True);
              'firemaking', 'fire': Mouse(360, 205, 35, 35, True);
              'woodcutting', 'wc': Mouse(428, 205, 35, 35, True);
              'fletching', 'fletch': Mouse(180, 260, 35, 35, True);
              'construction': Mouse(241, 260, 35, 35, True);
              'summoning': Mouse(303, 260, 35, 35, True);
              else Mouse(419, 95, 35, 35, True);
            end;
            Wait(500 + Random(200) + Random(100));
            if FindColorTolerance(x, y, 5865621, 155, 117, 370, 250, 0) then Break;
            if (TimeFromMark(LampTime) > 10000) then
            begin
              Result := False;
              Logout;
              Players[CurrentPlayer].Rand := 'Lamp';
              Exit;
            end;
          end;
          Mouse(380, 270, 70, 20, True);
          Wait(500 + Random(150) + Random(150));
          Inc(Lamps);
          TakeScreen('Lamp Random Solved');
          AddToSRLLog('******** SOLVED LAMP RANDOM ********');
          //WriteFileString(TheFile, '******** SOLVED LAMP RANDOM ********' + Chr(13));
        end;
    end;
    i dont know if this has already been fixed but if it hasn't then here they are

    ~shut

    EDIT: here is what the lamp looks like now

  2. #2
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    We should also add a function that will detect the text that RS spits out if you try to bank items like this, just in case the random handling breaks again.

    "A magical force prevents you from banking this item."


  3. #3
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    AFAIK some1 already fixed that ..
    Not sure .
    But thanks anyways .
    ~Eerik~

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

    Default

    Markus has already added to the Dev Repos, I am 99% sure.


    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!

  5. #5
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  6. #6
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice, but imo it's more beautiful to use "IntToPoint", like so:
    SCAR Code:
    function FindLamp(skill: string): Boolean;
    var
      LampTime, x, y, i: Integer;
      P: TPoint;
    begin
      GameTab(4);
      if FindColorTolerance(x, y, 1084300, MIX1, MIY1, MIX2, MIY2, 40) then
        if (FindBitmapToleranceIn(Lamp, x, y, MIX1, MIY1, MIX2, MIY2, 40)) then
        begin
          Result := True;
          Mouse(x, y, 1, 1, True);
          Wait(1500 + Random(500));
          MarkTime(LampTime);
          for i:= 1 to 4 do
          begin
            case (LowerCase(Skill)) of
              'attack':                    P := IntToPoint(61, 90);
              'strength':                  P := IntToPoint(125, 97);
              'ranged':                    P := IntToPoint(184, 97);
              'magic':                     P := IntToPoint(241, 97);
              'defence':                   P := IntToPoint(302, 95);
              'crafting', 'craft':         P := IntToPoint(358, 95);
              'hitpoints', 'hp':           P := IntToPoint(419, 95);
              'prayer', 'pray':            P := IntToPoint(60, 150);
              'agility':                   P := IntToPoint(125, 150);
              'herblore':                  P := IntToPoint(177, 150);
              'thieving', 'thief':         P := IntToPoint(237, 150);
              'fishing', 'fish':           P := IntToPoint(303, 150);
              'runecraft', 'runecrafting': P := IntToPoint(356, 150);
              'slayer', 'slay':            P := IntToPoint(421, 150);
              'farming', 'farm':           P := IntToPoint(63, 205);
              'mining', 'mine':            P := IntToPoint(120, 205);
              'smithing', 'smith':         P := IntToPoint(180, 205);
              'hunting', 'hunt', 'hunter': P := IntToPoint(241, 205);
              'cooking', 'cook':           P := IntToPoint(303, 205);
              'firemaking', 'fire':        P := IntToPoint(360, 205);
              'woodcutting', 'wc':         P := IntToPoint(428, 205);
              'fletching', 'fletch':       P := IntToPoint(180, 260);
              'construction':              P := IntToPoint(241, 260);
              'summoning':                 P := IntToPoint(303, 260);
            end;
            if ( Tp.x and Tp.y) <> 0 then
              Mouse(Tp.x, Tp.y, 35, 35, True)
            else
              Mouse(419, 95, 35, 35, True);
            Wait(500 + Random(200) + Random(100));
            if FindColorTolerance(x, y, 5865621, 155, 117, 370, 250, 0) then Break;
            if (TimeFromMark(LampTime) > 10000) then
            begin
              Result := False;
              Logout;
              Players[CurrentPlayer].Rand := 'Lamp';
              Exit;
            end;
          end;
          Mouse(380, 270, 70, 20, True);
          Wait(500 + Random(150) + Random(150));
          Inc(Lamps);
          TakeScreen('Lamp Random Solved');
          AddToSRLLog('******** SOLVED LAMP RANDOM ********');
          //WriteFileString(TheFile, '******** SOLVED LAMP RANDOM ********' + Chr(13));
        end;
    end;

    -Tsn.
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  7. #7
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by the scar noob View Post
    Nice, but imo it's more beautiful to use "IntToPoint", like so:
    SCAR Code:
    function FindLamp(skill: string): Boolean;
    var
      LampTime, x, y, i: Integer;
      P: TPoint;
    begin
      GameTab(4);
      if FindColorTolerance(x, y, 1084300, MIX1, MIY1, MIX2, MIY2, 40) then
        if (FindBitmapToleranceIn(Lamp, x, y, MIX1, MIY1, MIX2, MIY2, 40)) then
        begin
          Result := True;
          Mouse(x, y, 1, 1, True);
          Wait(1500 + Random(500));
          MarkTime(LampTime);
          for i:= 1 to 4 do
          begin
            case (LowerCase(Skill)) of
              'attack':                    P := IntToPoint(61, 90);
              'strength':                  P := IntToPoint(125, 97);
              'ranged':                    P := IntToPoint(184, 97);
              'magic':                     P := IntToPoint(241, 97);
              'defence':                   P := IntToPoint(302, 95);
              'crafting', 'craft':         P := IntToPoint(358, 95);
              'hitpoints', 'hp':           P := IntToPoint(419, 95);
              'prayer', 'pray':            P := IntToPoint(60, 150);
              'agility':                   P := IntToPoint(125, 150);
              'herblore':                  P := IntToPoint(177, 150);
              'thieving', 'thief':         P := IntToPoint(237, 150);
              'fishing', 'fish':           P := IntToPoint(303, 150);
              'runecraft', 'runecrafting': P := IntToPoint(356, 150);
              'slayer', 'slay':            P := IntToPoint(421, 150);
              'farming', 'farm':           P := IntToPoint(63, 205);
              'mining', 'mine':            P := IntToPoint(120, 205);
              'smithing', 'smith':         P := IntToPoint(180, 205);
              'hunting', 'hunt', 'hunter': P := IntToPoint(241, 205);
              'cooking', 'cook':           P := IntToPoint(303, 205);
              'firemaking', 'fire':        P := IntToPoint(360, 205);
              'woodcutting', 'wc':         P := IntToPoint(428, 205);
              'fletching', 'fletch':       P := IntToPoint(180, 260);
              'construction':              P := IntToPoint(241, 260);
              'summoning':                 P := IntToPoint(303, 260);
            end;
            if ( Tp.x and Tp.y) <> 0 then
              Mouse(Tp.x, Tp.y, 35, 35, True)
            else
              Mouse(419, 95, 35, 35, True);
            Wait(500 + Random(200) + Random(100));
            if FindColorTolerance(x, y, 5865621, 155, 117, 370, 250, 0) then Break;
            if (TimeFromMark(LampTime) > 10000) then
            begin
              Result := False;
              Logout;
              Players[CurrentPlayer].Rand := 'Lamp';
              Exit;
            end;
          end;
          Mouse(380, 270, 70, 20, True);
          Wait(500 + Random(150) + Random(150));
          Inc(Lamps);
          TakeScreen('Lamp Random Solved');
          AddToSRLLog('******** SOLVED LAMP RANDOM ********');
          //WriteFileString(TheFile, '******** SOLVED LAMP RANDOM ********' + Chr(13));
        end;
    end;

    -Tsn.
    yer well i just wanted to update it and not change it too much

    plus it was only a quick fix

    ~shut

  8. #8
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Shuttleu View Post
    yer well i just wanted to update it and not change it too much

    plus it was only a quick fix

    ~shut
    I know, I know, it was only a suggestion and I'm bored, lol

    -Tsn.
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  9. #9
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

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

    Default

    It should be:

    SCAR Code:
    {*******************************************************************************
    function FindLamp(skill: String): Boolean;
    by: Pups, Starblaster100 and PriSoner and ShuttleU
    Description: handles Genie. Results True if lamp found and handled.
    skill: Skill to use with lamp eg. 'strength', 'attack', etc.
    *******************************************************************************}


    unction FindLamp(skill: string): Boolean;
    var
      LampTime, x, y, i: Integer;
      P: TPoint;
    begin
      GameTab(4);
      if FindColorTolerance(x, y, 1084300, MIX1, MIY1, MIX2, MIY2, 40) then
        if (FindBitmapToleranceIn(Lamp, x, y, MIX1, MIY1, MIX2, MIY2, 40)) then
        begin
          Result := True;
          Mouse(x, y, 1, 1, True);
          Wait(1500 + Random(500));
          MarkTime(LampTime);
          for i:= 1 to 4 do
          begin
            case (LowerCase(Skill)) of
              'attack':                    P := Point(61, 90);
              'strength':                  P := Point(125, 97);
              'ranged':                    P := Point(184, 97);
              'magic':                     P := Point(241, 97);
              'defence':                   P := Point(302, 95);
              'crafting', 'craft':         P := Point(358, 95);
              'hitpoints', 'hp':           P := Point(419, 95);
              'prayer', 'pray':            P := Point(60, 150);
              'agility':                   P := Point(125, 150);
              'herblore':                  P := Point(177, 150);
              'thieving', 'thief':         P := Point(237, 150);
              'fishing', 'fish':           P := Point(303, 150);
              'runecraft', 'runecrafting': P := Point(356, 150);
              'slayer', 'slay':            P := Point(421, 150);
              'farming', 'farm':           P := Point(63, 205);
              'mining', 'mine':            P := Point(120, 205);
              'smithing', 'smith':         P := Point(180, 205);
              'hunting', 'hunt', 'hunter': P := Point(241, 205);
              'cooking', 'cook':           P := Point(303, 205);
              'firemaking', 'fire':        P := Point(360, 205);
              'woodcutting', 'wc':         P := Point(428, 205);
              'fletching', 'fletch':       P := Point(180, 260);
              'construction':              P := Point(241, 260);
              'summoning':                 P := Point(303, 260);
            end;
            if ((P.x and P.y) <> 0) then
              Mouse(P.x, P.y, 35, 35, True)
            else
              Mouse(419, 95, 35, 35, True);
            Wait(500 + Random(200) + Random(100));
            if FindColorTolerance(x, y, 5865621, 155, 117, 370, 250, 0) then Break;
            if (TimeFromMark(LampTime) > 10000) then
            begin
              Result := False;
              Logout;
              Players[CurrentPlayer].Rand := 'Lamp';
              Exit;
            end;
          end;
          Mouse(380, 270, 70, 20, True);
          Wait(500 + Random(150) + Random(150));
          Inc(Lamps);
          //TakeScreen('Lamp Random Solved');
          AddToSRLLog('******** SOLVED LAMP RANDOM ********');
          //WriteFileString(TheFile, '******** SOLVED LAMP RANDOM ********' + Chr(13));
        end;
    end;

    Just fixed some errors I found in TSN's version.
    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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. FindLamp Fix
    By Lee Lok Hin in forum Research & Development Lounge
    Replies: 6
    Last Post: 08-16-2008, 12:32 PM
  2. Help with FindLamp('') skill names
    By Baked0420 in forum OSR Help
    Replies: 6
    Last Post: 05-02-2008, 08:53 AM

Posting Permissions

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