Results 1 to 9 of 9

Thread: FindLamp

  1. #1
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default FindLamp

    I found this suggestion from EvilChicken! on a thread:

    Quote Originally Posted by EvilChicken! View Post
    2: FindLamp skill coords can be shortened using simple maths.
    So I tried, a big thanks to bullzeye and nielsie for helping me with this

    SCAR Code:
    Function FindLamp(Skill: String): Boolean;
    Label Finish;
    Var
      LampTime, x, y, Msk, MS, Col, Row : Integer;
      Skills : Array Of Array Of String;
    Begin
      GameTab(4);
      Skills := [TStringArray(['']), TStringArray(['attack', 'atk']), TStringArray(['strength', 'str']), TStringArray(['range', 'ranged']),
             TStringArray(['magic']), TStringArray(['defence', 'def']), TStringArray(['crafting', 'craft']), TStringArray(['hitpoints', 'hp']),
             TStringArray(['prayer', 'pray']), TStringArray(['agility']), TStringArray(['herblore', 'herb']), TStringArray(['thieving', 'thief']),
             TStringArray(['fishing', 'fish']), TStringArray(['runecraft', 'runecrafting']), TStringArray(['slayer', 'slay']), TStringArray(['farming', 'farm']),
             TStringArray(['mining', 'mine']), TStringArray(['smithing', 'smith']), TStringArray(['hunting', 'hunt', 'hunter']),
             TStringArray(['cooking', 'cook']), TStringArray(['firemaking', 'fire']), TStringArray(['woodcutting', 'wc']), TStringArray(['']),
             TStringArray(['']), TStringArray(['fletching', 'fletch']), TStringArray(['construction']), TStringArray(['summoning', 'summon'])];

        For Msk := 0 to High(Skills) Do
         For MS := 0 to High(Skills[Msk]) Do
         If Skill = '' Then Begin Msk := 7; Break End Else
         Try
           If (Lowercase(Skill) = (Skills[Msk][MS])) Then
           Begin
             Row := Trunc(Msk / 7) + 1;
             Col := (Msk - 1) Mod 7 + 1;   //Bullzeye skills.
            End;
          Except Continue;
          End;
        If Row Xor 0 = 0 Then Exit;
        If (Msk Mod 4) = 0 Then Dec(Row);
        If Col = 0 Then Col := 7;
         If FindColorTolerance(x, y, 1084300, MIX1, MIY1, MIX2, MIY2, 40) Then
          If (FindTransparentBitmapTolerance(Lamp, x, y, clBlack, MIX1, MIY1, MIX2, MIY2, 40)) Then
          Begin
            Inc(RandSolved[rand_Lamp]);
            TakeScreen('Lamp Random Solved');
            AddToSRLLog('******** SOLVED LAMP RANDOM ********');
            WriteLn('******** SOLVED LAMP RANDOM ********');
            Mouse(x, y, 1, 1, True);
            Wait(1500 + Random(500));
            MarkTime(LampTime);
          End;
          If GetColor(115, 74) = 6325658 Then Goto Finish Else
          If (TimeFromMark(LampTime) > 10000) Then
          Begin
            LogOut;
            Players[CurrentPlayer].Rand := 'Lamp';
          End;
          Finish :
          Begin
            Mouse(51 + (55 * (Col - 1)), 84 + (55 * (Row - 1)), 45, 45, True);
            Wait(1500 + Random(500));
            Mouse(416, 281, 7, 1, True);
            Result := True;
          End;
      Exit;
    End;

    Thanks.

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

    Default

    I have a question.
    If Row Xor 0 = 0 Then Exit;
    0 = 0 , is always true right? then put a true.
    ~Hermen

  3. #3
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    that is one massive unelegant, unreadable and uneditable confusion.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  4. #4
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    that is one massive unelegant, unreadable and uneditable confusion.

    ~RM
    I find it easy to read, tell me which parts look unreadable, so I may improve the readability

  5. #5
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Probably when you declare Skills..

  6. #6
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    So how is that any different to:

    SCAR Code:
    Boxes := [IntToBox(37, 107, 100, 170), IntToBox(131, 107, 194, 170), IntToBox(225, 107, 288, 170), IntToBox(309, 107, 372, 170),
                IntToBox(37, 179, 100, 242), IntToBox(131, 179, 194, 242), IntToBox(225, 179, 288, 242), IntToBox(37, 251, 100, 314),
                IntToBox(131, 251, 194, 314), IntToBox(225, 251, 288, 314)];

    ??

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

    Default

    Honestly the current function is much easier to read/understand and to edit if Jagex makes any modifications.

  8. #8
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by Hermen View Post
    I have a question.

    0 = 0 , is always true right? then put a true.
    But he's not comparing 0 to 0. He's comparing Row Xor 0 to 0.

  9. #9
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by ZephyrsFury View Post
    Honestly the current function is much easier to read/understand and to edit if Jagex makes any modifications.
    Okay I accept that

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
  •