Results 1 to 4 of 4

Thread: Help me with this script please!

  1. #1
    Join Date
    Dec 2012
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Help me with this script please!

    Simba Code:
    program Pricechecker;
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    var
    LastT, LastP, Name: string;
    ItemPc, Time: Integer;

    const
      FcName = '07 mm';     //fc to join  - won't join if you're already in one

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      with Players[0] do
      begin
        Name       := '';                 //login in name
        Pass       := '';                //Password
        Active     := True;
        Nick := '';
        Players[0].LampSkill := Skill_Slayer;
      end;
    end;

    function CustomGetChatBoxText(Line, TextCol: Integer): string;   //taken from the include to modify tolerance
    var
      P: TPoint;
      cArr: TPointArray;
      B: TBox;
    begin
      Result := '';
      P := TextCoords(Line);
      if (FindColorsTolerance(cArr, TextCol, MCX1, P.y, MCX2, P.y + 13, 0)) then
      begin
        B := GetTPABounds(cArr);
        result := Trim(GetTextAtExWrap(b.x1-1,p.y,B.x2+1,p.y+13,0,5,2,TextCol,0, smallchars07));
      end;
    end;

    procedure Progress;
    var
     TimeRan, PCHr: Integer;
    begin
      TimeRan := (GetTimeRunning / 1000);
      PCHr := (3600 * (ItemPC)) / ((TimeRan));
      ClearDebug;
      Writeln('The Killer''s PriceChecker');
      Writeln('Time running: ' + TimeRunning);
      Writeln('Completed ' + IntToStr(ItemPC) + ' Price Checks');
      Writeln('Completing at a rate of ' + IntToStr(PCHr) + ' /Hour');
      MarkTime(Time);
    end;

    procedure JoinFC;
    var
      JoinChat, x, y: integer;
    begin
       JoinChat := BitmapFromString(55, 22, 'meJyNV+1OwzAM3Psg9qcUoQHTAD' +  //join button
            'Ft4hF5WPB6zfXmj7RTNKWOc7nY5zQdj5fD5894vOwPX8PbN9vL8Tq' +
            'ebk2N5oaOOcPfHGw6LeagjbPu+hOmGjGd+IpMDursGoYenz8cWkRO' +
            '+cTdVZbxdA6WK6KnAUzBSSbGkH2lDVgsYeuWez+dGf9l4n3WZpBGU' +
            'heNiaC/ox0ZRrdOMzm5wKaLRnuMKnZNi1ORY2jRQHycKvJg1prkKP' +
            'NSigTin3RLwHRpl+4tJGNxOQ4QZKqBDib/l7oWlXZKL41bWviugaQ' +
            '7eegf5ZeG2iU9rZRlaMpdnz+h9u8XzsI/hwxk9/unbTXUM6arnbYo' +
            'QGhkv4KKOFVOd/gZ/vTbrgcShpwMwfqAgg8w+yThvFp0DjBqBjiul' +
            'Jze4EMEdFKS7hiEz5L3tuVUfkpSszaPctGpzW/Dpo15SuBD/2isHo' +
            'fikAdVrsKYgAwt3IgmNCZikNpRfwSwkoRuMN4fnDPZOtra0aGUJNd' +
            'yE7W4InilTKYpcttIUt+Vul+nAe3cSqzVKTcS8+sIUxUg4CyRZGf7' +
            'PMcQt+hPwTduZ81mv1EVWNHuaU4n1jcj7IPUL5wfnl6XApSJCJqWn' +
            'vqQpBs1KL0odpqtq572aK1yjscySd7fW65+lK+Y6eVVXbSc1NlHfM' +
            'ATW9OjTBPtMNO7bnpxxWG4egdwDLGvQcoB3KL2lpd+e+/wcKsqND5' +
            'WF4Z1qtktlAQkNUtzmdW4bSQc75DprPjRpI/8OFL9aAR4dRnal0v6' +
            'PbJFD3T+B5+ScsY=');
       Gametab(tab_Clan);
       if not FindBitmap(JoinChat, x, y) then
       begin
        Writeln('Could not find the join chat button - we must already be in a clan');
        Exit;
       end;
       Mouse(x + 10, y + 10, 5, 5, 1);
       TypeSend(FcName);
    end;

    procedure TypeSendCustom(Text: string);
    var
      I: Integer;
    begin
      for i := 1 to Length(Text) do
      begin
        {$IFDEF SIMBAMAJOR980}
        SendKeys(Text[i], 40 + Random(40));
        {$ELSE}
        SendKeys(Text[i], 1 + Random(2), 1 + Random(2));
        {$ENDIF}
        Wait(1 + Random(2));
      end;


        TypeByte(VK_ENTER);
    end;
    procedure Kick(name: string);
    var
    x, y, q, w, Time, addplayer: Integer;

    begin
      AddPlayer := BitmapFromString(58, 16, 'meJylltFKQzEQRPtPPkofChehaF' +   //bitmap for adding players
            'GLBfVBv8uv1cEDh2HvpQheQplsdjaTzSbNYVlO53Pa8fTwfLkcliX' +
            'g5e01OGDgtHjShXV3PN4/PTqaofivcVrc4txzAa4QI6bnSrcjxEcN' +
            'uAUMLMjsKB+euoGJRheFyO5QOg9iGrJV5QKjnDQyu8ob3+735D9Ej' +
            'O+fH2hgtIODHQ2IM/bQyVsoa1USSTLb7WiCpB1+SyJAba0k+Obrmy' +
            '7TBcTCkvFcC8OZrpmBwiywdB5EcGZBodmzYPKrKiMAYt/tds6S1WF' +
            'x1fjYmqtOiK7a0eFsVQeMWSgDDkuG+HXhyoOlXYv144r8xp66X2Mj' +
            'FN8YeYhRbRPJKkPBxPdmUBtHLE2LWXJFfcDpEiG/cC2Gdh5Ejhsx6' +
            'YbodeHsKsHBzY2Fw9gWjwzZpmFBHl1uDGKigeRYVE1EVc+CKk99z6' +
            'UPxkQIVhvVosXNNQ98akBkn1NWQYQuKiwhwk1AZ7EwUGuFyGJPXVq' +
            'rtVqwsKf6eIIMSP00kYbmJrqDnS5YfdD09N7YVCvo+rfCR91udkda' +
            'xjIHcI3o/H/d+m9iHrymDNh3kXm2TtaZ/EvdUifQqdXGfOw7davFo' +
            'pLVRIYgKh7Mh7NEcqIevnXdkiW41l5j0uLF6J973+2D6w3pQ8Lrtw' +
            't+k6ikvuL6DzFu1O3mU6HpKhH0e8nr3Ruj/Ts5m48EiD66+u9S2e6' +
            'pD4l+VPh0HM8eKsrlKwbcDq3HUFeI1E8r/AGoOmfR');
      GameTab(tab_Friends);  //so we are on the right tab...
      if not FindBitmap(AddPlayer, x, y) then
        Writeln('Could not find the add player button');    //a little bit of debug

        MarkTime(Time); //so we don't have a risk of infinite loops
        repeat
          if FindColorTolerance(q, w, 16777215, 553, 208, 715, 312, 10) then  //finds names
            begin
              Mouse(q + 15, w + 5, 15, 15, 2);
              ChooseOption('elete');
            end else
              Break;
        until(TimeFromMark(Time) > 45000);//clear friends list
        if (Name = '') or (Length(Name) > 20) then
          Exit;
        Mouse(x + 10, y + 10, 10, 10, 1);
        TypeSend(Name);
        Wait(2500 + Random(200));
        if (not FindColorTolerance(q, w, 65280, 655, 231, 713, 245, 10)) and (not FindColorTolerance(q, w, 65535, 655, 231, 713, 245, 10))  then//Check if online (green stoff?)
          Exit;



        Mouse(92, 437, 5, 5, 2);
        Chooseoption('ick');

        //FindColorTolerance(q, w, 16777215, 553, 208, 715, 312, 10);
        //Mouse(q + 15, w + 5, 15, 15, 1);
        //TypeSend(BeforeName + Name + AfterName);//Send a nice message :)
        inc(itempc);
    end;
    procedure PriceCheck;
    var
    I, l, hig, lo, aver, alc: integer;
    T, average, recentlow, recenthigh, str, alch, search, ot : string;
    Expl, Bang : TStringArray;

    begin
      T := lowercase(CustomGetChatBoxText(8, 128));
      Search := T;
      Name := LowerCase(CustomGetChatBoxText(8, clMessage));
      //Writeln(name);
      Writeln(t);
          l := Pos('..', Name);
          if (l <> 0) then
            Delete(Name, l, l);
          //Writeln(name);
          l := Pos('[', Name);
          if (l <> 0) then
            Delete(Name, l, l);
          l := Pos(']', Name);
          if (l <> 0) then
            Delete(Name, l, l);

            Delete(Name, 1, 1);
          //Writeln(name);
         // replace(Names[f], '] ', '');
      //Writeln(name);
      Expl := explode(' ', T);

      for I:=0 to high(Expl) do
      begin
        if (Expl[I] = 'pc') then
        begin                                      //so we get the name and not !pc for our search
          T := replace(T, 'pc ', '');
          T := replace(T, 'of', 'of ');
          T := replace(T, 'black', 'black ');
          T := replace(T, 'plank', ' plank');
          T := replace(T, 'oakplank', 'oak plank');
        //  T := replace(T, 'black', 'black ');
          T := replace(T, 'hcween', 'h''ween');
          T := replace(T, 'dark', 'dark ');
          T := replace(T, 'guthancs ', 'guthan''s /');
          T := replace(T, 'ahrimcs', 'ahrim''s');
          T := replace(T, 'magecs', 'mages');
          T := replace(T, 'dharokcs', 'dharok''s');
          T := replace(T, 'veraccs', 'verac''s');
          T := replace(T, 'toragcs', 'torag''s');
          T := replace(T, 'karilcs', 'karil''s');
          Ot := T;

          T := replace(T, ' ', '+');
          T := replace(T, ' ', '+');


          if not (T = LastT) then
          begin
            LastT := T;
            Wait(10);
            writeln(t);
            str := GetPage('link2' + T);
            if (str = '{"error":"No results found."}') or (str = '{"error":"Enter a longer search term."}') then
            begin
              TypesendCustom('/' + Name + ' I couldn''t find your item');
              Wait(100 + Random(10));
              Exit;
            end;
            average := Between('"average":"','"', str);
            recentlow := Between('recent_low":"', '"',str);
            recenthigh := Between('recent_high":"', '"',str);
            alch := Between('high_alch":"', '"',str);
            Aver := Round(StrToFloat(Average));
            Lo := Round(StrToFloat(recentlow));
            Hig := Round(StrToFloat(recenthigh));
            alc := Round(StrToFloat(alch));

            TypeSendCustom('/[' + Capitalize(ot) + '] Rng:' + IntToStr(Hig) + '-' + IntToStr(lo) + ' Average:' + IntToStr(Aver) + ' Alch:' + IntToStr(alc));
            Inc(ItemPC);
            Wait(100 + random(10));
            Exit;
          end;
        end;
      end;
      begin
        for I:=0 to high(Expl) do
        begin
          if (Expl[I] = '!stats') then
          begin                                      //so we get the name and not !pc for our search
            Search := replace(search, '!stats ', '');
            Search := replace(search, '!stats', '');                           //to make sure everything goes, was having difficulties
            Search := replace(search, 'stats ', '');
            Search := replace(search, '!', '');
            Search := replace(search, 'stats', '');
            ot := Search;
            Search := replace(search, ' ', '+');
            Search := replace(search, ' ', '+');
            if not (Search = LastP) then
            begin
              Lastp := Search;
              Wait(10);
              Writeln(search);
              Str := GetPage('link' + search);

              bang := Explode(',', Str);
              L := pos('Page', str);
              if L <> 0 then
                Exit;
              Writeln(str);
              TypeSendCustom('/' + Capitalize(ot) + '-[Hp:' + Bang[9] + ' At:' + Bang[3] + ' St:' + Bang[7] + ' Df:' + Bang[5] + ' Rn:' + Bang[11] + ' Mg:' + Bang[15] + ' Pr:' + Bang[13] + ']');
              Exit;
            end;
          end;
        end;
      end;
      for I:=0 to high(Expl) do
      begin
        if (Expl[I] = 'home swap') or (Expl[I] = 'home') or (Expl[I] = 'house') or (Expl[I] = 'swap') or (Expl[I] = 'stand') then
        begin                                      //so we get the name and not !pc for our search
          SetAllChats('hide','Friends', 'Friends', 'off');
          Kick(name);
          SetAllChats('hide','Friends', 'on', 'off');
        end;
      end;
    end;

    begin
      SetUpsrl;
      DeclarePlayers;
      LoginPlayer;
      JoinFc;
      MarkTime(Time);
      repeat
        if TimeFromMark(time) > 10000 then
        begin
          if not LoggedIn then
          begin
            LoginPlayer;
            joinfc;
          end;
          CompassMovement(5, 15, false);
          Progress;
          MarkTime(Time);
        end;
        PriceCheck;
      until(False);
    end.




    Please help me the script was working perfectly before the update now on the simba log says:
    "Error: Exception: Too many parameters at line 176
    The following DTMs were not freed: [SRL - Lamp bitmap, SRL - Book of Knowledge]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Minimap Mask bitmap, 3]"

    anybody knows how to fix it??

  2. #2
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    did you enter your nickname?

  3. #3
    Join Date
    Dec 2012
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    yeah erased links and user,pass n name so i can paste here

  4. #4
    Join Date
    Aug 2010
    Location
    Slovenia
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm having the same problem. The Delete procedure is causing this...

    WTFDelProcedure.jpg

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
  •