Results 1 to 2 of 2

Thread: First script, couple of noob questions

  1. #1
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default First script, couple of noob questions

    well me and in_jeopardy were working on this last night a bit, but hes not on atm and theres some things i wanna do, before i get kicked off the comp by mum lol.

    here is the script so far:

    SCAR Code:
    program KebabBuyer;
    {.include SRL\SRL.scar}

    var
    x,y: Integer
    cx,cy: Integer;
    KebabSign: Integer;

    procedure LoadBmps;
    begin
      KebabSign:= BitmapFromString(5, 1, '621106000000000000000' +
           '000000000');
    end;

    procedure FreeBmps;
    begin
      FreeBitmap(KebabSign);
    end;

    procedure StoreWalk;
    begin
    LoadBmps;
    if(FindDeformed(x,y,KebabSign,553,6,720,160)) then
      begin
       Wait(100+random(10));
       Mouse(x,y,1,1,true);
       Writeln('Walking to Kebab Store');
       Wait(13000+random(200));
      end else
       Writeln('Store Bitmap not found...');
       killscript(0);
    FreeBmps;
    end;

    procedure BuyKebabs;
    begin
    if(FindObj(cx, cy, 'Talk-to Karim', 7290216, 50)) then
      begin
       Mouse(cx, cy, 5, 5, true);
       TalkToRand;
       MouseBox(348, 582, 422, 597, 1);
       TalkToRand;
      end else
       Writeln('Could not find Karim...');
       killscript(0);
    end;

    begin;
    SetupSRL;
    ActivateClient;
    Wait(1342 + random(321))
    StoreWalk;
    Wait(2132 + random(152))
    BuyKebabs;
    end.


    Problems
    - The script finds the KebabBmp, which is the kebab sign on minimap. It walks there but on the way it decides it cant find it, and executes script. but it doesnt write 'Store Bitmap not found...' in the debug box which is what it should do. But it does find it because it walks there in the first place, so wtf is going on?

    - Often the talking to Karim doesnt work, the mouse just moves around in circles until the "Talk-to Karim" comes up in the top left, then it clicks on him. Any better ways of talking to him?

    - What is the best way to click on the text box down the bottom when theres 2 options? I want it to click on Yes, which is the bottom option. We've done TalkToRand; for the click to continue parts.

    - How can we check if the door to the place is open or shut? And then open it? Because if its shut the script messes up.

    Any help greatly appreciated, I want this to turn into a good script

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I just use MouseBox for clicking to continue and things like that. For checking if the doors open, try taking a color/bitmap of the door, (If your using a bitmap I suggest using AutoColorThis; to learn more about that read my tut taking apart a script (My willow chopper)) have it move the mouse to it, and if the text is up Open, have it click or if the text isn't up Open, then have it go inside.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Couple of questions
    By chrisn2323 in forum OSR Help
    Replies: 2
    Last Post: 12-30-2007, 09:07 PM
  2. Couple questions
    By kryptonite in forum OSR Help
    Replies: 5
    Last Post: 07-23-2007, 02:18 AM
  3. A couple of scripting questions.
    By Buckleyindahouse in forum OSR Help
    Replies: 3
    Last Post: 12-01-2006, 06:04 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
  •