Results 1 to 14 of 14

Thread: help with this function

  1. #1
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default help with this function

    SCAR Code:
    Function Findandpickpocket(x, y, Color1, color2, color3: integer; name1: string): boolean;
    var i,v,b: integer;
    var man: integer;
    begin
      man:= Createbitmapmaskfromtext(name1,upchars);
      i:=0;
      repeat
        i:=i+1;
        if findcolortolerance(x,y,color1,1,1,700,700,2) or
           findcolortolerance(x,y,color2,1,1,700,700,2) or
           findcolortolerance(x,y,color3,1,1,700,700,2) then
        begin
          Mouse(x,y,0,0,false);
          if findpopup(name1) or
          (findbitmapmasktolerance(man,v,b,0,0,516,39,20,50)) then
          begin
            typesend(' ');
            Popup('ickpock');
            wait(1000+random(1000));
          end;
          if (GetlastChatTextblack ('You pick the woman')=true)
          or (GetlastChatTextblack('You pick')=true) then
          begin
            result:=true;
            DisguiseScar('successful');
            wait(2000+random(1000));
            DisguiseScar('Trying again');
            successfulPickpockets:=successfulPickpockets+1;
          end else;
          if (not(GetlastChatTextblack ('You pick the woman')=true))
          or (not(GetlastChatTextblack('You pick')=true)) then
          Result:=false;
          UnsuccessfulPickpockets:= UnsuccessfulPickpockets+1;
        end else;
        Result:=false;
        exit;
      until(result=true) or (i>=10);
    end;

    that always results true and false and iv run out of ideas

  2. #2
    Join Date
    Apr 2007
    Posts
    186
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So whats the exact problem ? Do you want it to result as something else then true or false ? Explain more!

  3. #3
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    wow urs is gunna be way more cool than mine...mine just finds the guy and pickpockets him...and if theres too many people then i go sumwhere else to pickpocket
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  4. #4
    Join Date
    Apr 2007
    Posts
    220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think It's pretty good I don't know what some commands are, like Popup and GetlastChatTextblack.. I think PopUp is the same as IsUpText and GetLastChatTextBlack is the text RS types in the chatbox like: "You cooked a lobster".. Correct me if im wrong. But if those commands work fine it's a very nice script. (h)

  5. #5
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    im trying to only get it to result true or false but no matter what happens it always results both true and false


    popup is when you right click something and the menu pops up and then it choses an option and getlastchattextblack i made from getlastchattext because im testing all of the things to find these words because i cant seem to find one that works

  6. #6
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    umm right clicking, u dont get popup...popup is if u click on an npc and hey saysumthing....use clickoption or chooseoption
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  7. #7
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    its not the popup part, that works perfect its the text finding

    edit: popup is used correctly in my script

  8. #8
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    is there a better function to use because that doesnt work right now

  9. #9
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    better funtion than what?popup?
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  10. #10
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by jhildy View Post
    im trying to only get it to result true or false but no matter what happens it always results both true and false
    Not possible

    It is like binary, it will always be either a 1 or a 0, never something else, never both.

  11. #11
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Run your procedure, and put:

    SCAR Code:
    If (FindandPickpocket) then
     begin;
      writeln('Returned True');
     end;
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  12. #12
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    that wont make it return true..
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  13. #13
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    yea i want that function to return true

    edit: well i dont know how it happens but it always does it results true then just keeps going and results false later on in it

    edit again: i figured it out it now only counts sucessful pickpockets(it counts some unsucessful but theres to many at the end so ill figure that out later)

  14. #14
    Join Date
    Mar 2007
    Posts
    276
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea i have the same problem. Helped me alot ty every1


    Someone: 'Who the hell is TooManySitUps?'

    Boreas: 'Switch the first and last letter of my name, what do you get?'

    Someone: 'Um, SoreAb?'

    Boreas: 'And how do you get that?'

    Someone: 'From Too Many Sit Ups!! Haha, Boreas you are so clever!'

    Boreas: 'Ya he's like my evil twin that takes over when I'm being really sarcastic, or playing devil's advocate.'

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-27-2008, 05:20 PM
  2. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  3. Any function that does this?
    By shadowpwner in forum OSR Help
    Replies: 2
    Last Post: 08-14-2007, 03:15 AM
  4. [FUNCTION] FindDoorColour: integer; By ZephyrsFury [FUNCTION]
    By ZephyrsFury in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-27-2007, 08:45 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
  •