Results 1 to 4 of 4

Thread: somthing wrong with a untill on line 270

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

    Default somthing wrong with a untill on line 270

    lol somthing wrong with an end; i dont know exactly whats wrong becaus ei tried couple of things not working....
    sorry for wrong topic title i thought of somthing else when i started the topic

    already thanks you!
    and what you think of teh piece of code?


    SCAR Code:
    program restlessghost;
    {.include SRL/SRL.scar}

    var
     CantHomeTeleport, HomeTeleport, FindNorMalRandomsTime, SST1, SST2, FindFastRandomsTime, door, PleaseWait, H:integer;
    x, y, lx, ly, kx, ky, i, Hx, Hy, k:integer;
    const
    Location = 'at Father'; //You can use somewhere, at priest.

    {=====================================================================================]
                DONT TOUCH THIS BELOW IF YOU DONT KNOW WHAT YOUR DOING!
    [=====================================================================================}


    Function FindFastRandoms: Boolean;
    var
      i: Integer;
    begin
      for i:=1 to 9 do
      begin
        case I of
         1:  If FindDead then
               Result := True;
         2:  If FindMod then
               Result := True;
         3:  If FindMime then
               Result := True;
         4:  If FindMaze then
               Result := True;
         5:  If FindQuiz then
               Result := True;
         6:  If FindDemon then
               Result := True;
         7: begin
               if NoGameTab then
               begin
                 Result := True;
                 Players[CurrentPlayer].loc := 'No GameTab';
                 Logout;
                 Exit;
               end;
             end;
         8: begin
               if InBlack then
               begin
                 Result := True;
                 Players[CurrentPlayer].loc := 'InBlack';
                 Logout;
                 Exit;
               end;
             end;
         9: begin
               if FindFight then
               begin
                 RunTo('N',False);
               end;
             end;
        end;

      end;
    end;


    //credits to WT-FAWAKI-----------------------------------------//
    // -- Performs Wait and FindTalk. + calls FindNormalRandoms every 10 secs and
    // -- FindFastRandoms every 3 secs.
    //----------------------------------------------------------------------------//

    Procedure WaitPlus(Time:Integer);
    var T: integer;
      begin
        For T := 1 to Time do
        begin
          if not LoggedIn then exit;
          Wait(200 + Random(50));
          FindTalk;
          RC;
        end;

        FindTalk;
        MarkTime(FindNorMalRandomsTime);
        if FindNorMalRandomsTime - SST1 >(10000 + Random(5000)) then
          begin
            FindNorMalRandoms;
            MarkTime(SST1);
          end;

        MarkTime(FindFastRandomsTime);
        if FindFastRandomsTime - SST2 >(1500 + Random(1500)) then
          begin
            FindFastRandoms;
            MarkTime(SST2);
          end;
    end;

    procedure antiban;
    begin
      Case Random(10) Of
        1 : HoverSkill('defense', False);
        2 : HoverSkill('strenght', False);
        3 : begin
             GameTab(1+Random(12));
             Wait(2000+Random(400));
             GameTab(4);
            end;
        4 : RandomRClick;
        5 : PickUpMouse;
        6 : HoverSkill('attack', False);
        7 : almostlogout;
        8 : begin
            gametab(9);
            gametab(5);
            gametab(1);
            gametab(2);
            end;
        9 :begin
           mmouse(x,y,333,273);
           end;



      end;
    end;


    procedure loadbitmaps;
     begin
      hometeleport := BitmapFromString2(False, 'a84B1878DA8D8E510A0' +
           '3210C44AF944493D84F75F5FE47EA8E5B4C410A55181EE14D9488' +
           '58E93ECCF94E6D6063014F4316A469D9AC23D8247C4B7D9B52D63' +
           '6ED7BCFC75C5DD7894C17260DCF7BCBC1D2839DC27FC936F94297' +
           '5AA5F5F739701F3E274953B6E1D5EB2C4FFED33ABBDFCE797FB5D' +
           'E870');
     canthometeleport := BitmapFromString2(False, 'a046E278DA8D534BB2C' +
           '42008BC129AC1CF524D72FF233D119FC12853E3A2CB6A5AC01601' +
           'C0A40F54F415C0C58BD05842E7882F8D07D260700FFAF044318C5' +
           '39D09B4C70F65C37C0D8D0D2D0F92086FCAE32CD73D08BDA9E8DB' +
           '299F49E92E3AE5F1263C4E62323E51DEDBF2ECDB2DBA3EDAA14C8' +
           '118B8295B5D25E714F1845C22BE983366C652A998383AF8AA67A5' +
           'E4A592F7AC3C6D31B1A8286AF56C73746498A2CCCBCE5BC55EF72' +
           '83619B57FCEC01A815DC34C28982C2388C5B7967797CC2FD1B55B' +
           'D9A15CD219CDBD8D7271E6E573D17B50DFC2E42BC1EA98F44D5B9' +
           'A27DA2C6D7D189A75327BFEEFAFBC3AB69BC3AD63EB544F28BA52' +
           '1D13CCD4A1E2A1F62BB5591A2FFE9A81D5B1C9B7F5B7CACE8503B' +
           'D8AE4FFBD85E8A60CED2EDF1DEB3D2C7F6133E7B2BA32757FD5D');
     PleaseWait := BitmapFromString(60, 2, 'z78DA33300001373030C060E30' +
           '294A8A7C41C52012EF3F1DB458C4A4C71FC2A872BA08F1F890F4F' +
           '00A555AC21');
     door := BitmapFromString2(False, 'aDD43D78DAC59241128330084' +
           '5AFF4090984A53572FF232966615DD8493B6365F12603FF6D0800' +
           '30D50D287340E32D940E72F453CD31ED1997E8C71032455F8B1FB' +
           '418506B1BF39E7FB02A74495E595F675EE54B6326EAD6620EE777' +
           '8E5B8A429C3BEFB0146262FFB47C4F8D583DFFACF5F92ABEDDC39' +
           '535788176FEDFFB2C9D55521BB9D8DF6A05CAB');
     end;


    Procedure casthometeleport;
     begin
      loadbitmaps;//loadsbitmaps
      gametab(7);
      wait(400+Random(600));
       If(FindBitmap(hometeleport, lx, ly)) Then
        Begin
        wait(100 + Random(150));
        Mouse(lx, ly, 5, 5, True);
        wait(15000);
        gametab(4);
        if (FindBitmap(canthometeleport, kx, ky)) then
        begin
        writeln('cant use home teleport logging out');
        logout;
        end
        else
        WriteLn('your in limbridge, have a nice day!');
      end
       else
        If Not(FindBitmap(HomeTelePort, lx, ly)) Then
         begin
          WriteLn('couldnt fin spell.');
       end;
    freebitmap(hometeleport);
    freebitmap(canthometeleport);


    end;



    function ClickAnswer(Answer: string): Boolean;
    begin

      if (FindNpcChatText(Answer)) then
      begin
        Mouse(x - Random(35) + Random(70),  y + Random(8),  0,  0,  True);
        i := 0;
        if (FindBitmapToleranceIn(PleaseWait, kx, ky, MCX1, MCY1, MCX2, MCY2, 30)) then;
          repeat
            Wait(100);
            i := i +1
          until (not(FindBitmapToleranceIn(PleaseWait, kx, ky, MCX1, MCY1, MCX2, MCY2, 30))) or (i > 20);
        Result := True;
      end;


    freebitmap(pleasewait);
    end;


    function WalkToOrStay:boolean;
    begin
    if Location='somewhere' then
        begin
          casthometeleport;//casts home teleport
          HighestAngle;     //standard stuff
          MakeCompass('N');
          FindRoadColor;
          SetRun(true);
          RadialRoadWalk(RoadColor, 60, 115, 44, 0, 0);
          if (FindBitmapToleranceIn(door, x, y, MMX1, MMY1, MMX2, MMY2, 30)) then
           begin
             mmouse(x,y,0,0);
             mouse(x,y,0,0,true);
             result:=true
             writeln('we are at the door')
           end
           else
            result:=false
            writeln('cant find door')

          end;
             if location= 'Father' then
             begin
             HighestAngle;     //standard stuff
          MakeCompass('N');
          FindRoadColor;
          SetRun(true);
          RadialRoadWalk(RoadColor, 60, 115, 44, 0, 0);
           If(FindBitmap(door, x, y)) Then
           begin
             mmouse(x,y,0,0);
             mouse(x,y,0,0,true);
             result:=true
             writeln('we are at the door')
           end
           else
            result:=false
            writeln('cant find door')
          end;

        end;


    // Credits To Niesie95's
    function InTalk: Boolean;
    begin
      if (FindColorTolerance(x,  y,  128,  220,  360,  365,  370,  5)) then
        Result  :=  True;
    end;


    procedure FindAndTalkToAereck;
    begin
     repeat
       if (FindObj(Hx, Hy, 'ereck', 7028284, 5)) then
      begin
        Mouse(hx, hy, 1, 1, false);
        ChooseOption('alk-to');
        markTime(H);
        repeat
          wait(500);
         until(InTalk) or (TimeFromMark(k) >=  5000);
        if (InTalk) then
        begin
          wait(900 +random(400));           //i can do this better if you really want it just say it
          writeln('going to talk father');
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('quest');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('help');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
        end;
      end;
    end;



    procedure FindAndTalkToUrhney;
    begin
     repeat
       if (FindObj(Hx, Hy, 'rhney', 7028284, 5)) then
      begin
          Mouse(hx, hy, 1, 1, false);
          ChooseOption('alk-to');
          markTime(H);
         repeat
          wait(500);
         until(InTalk) or (TimeFromMark(k) >=  5000);
        if (InTalk) then
        begin
          wait(900 + random(400);           //i can do this better if you really want it just say it
          writeln('going to talk father');
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('sent');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('haunting');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
        end;
      end;


    begin
    setupsrl;
    WalkToAereck;

    end.
    ~Hermen

  2. #2
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    procedure FindAndTalkToUrhney;
    begin
     repeat
       if (FindObj(Hx, Hy, 'rhney', 7028284, 5)) then
      begin
          Mouse(hx, hy, 1, 1, false);
          ChooseOption('alk-to');
          markTime(H);
         repeat
          wait(500);
         until(InTalk) or (TimeFromMark(k) >=  5000);
        if (InTalk) then
        begin
          wait(900 + random(400);           //<-- forgot an end parenthesis here
          writeln('going to talk father');
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('sent');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('haunting');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
           wait(500 + random(250));
          ClickAnswer('continue');
        end;
      end;
     until // <-- need an until something here
    end; // <--- need an end here


    begin
      setupsrl;
      WalkToAereck;  //<-- ? not a procedure.. I'm assuming you mean WalkToOrStay?
    end.

    Should compile after that

    and btw
    SCAR Code:
    end else
    can be written on one line
    just makes it less confusing =]

  3. #3
    Join Date
    Jan 2007
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Also, i think it would be easier if you change it to this:
    SCAR Code:
    function cclickanswer (b: Integer; text:  string): Boolean; // By Jahuro
    var
    a : Integer;
      begin
        repeat
          ClickAnswer(text);
          wait(500 + random(250));
          a := a + 1;
        until(b = a);
    end;

    procedure FindAndTalkToUrhney;
    begin
     repeat
       if (FindObj(Hx, Hy, 'rhney', 7028284, 5)) then
      begin
          Mouse(hx, hy, 1, 1, false);
          ChooseOption('alk-to');
          markTime(H);
         repeat
          wait(500);
         until(InTalk) or (TimeFromMark(k) >=  5000);
        if (InTalk) then
        begin
          wait(900 + random(400);
          writeln('going to talk father');
          cclickanswer (1, 'continue');
          cclickanswer (1, 'sent');
          cclickanswer (2, 'continue');
          cclickanswer (1, 'haunting');
          cclickanswer (11, 'continue');
       end;
      end;
     until
    end;
    I like cats.
    Narcle's AK Smelter 1.1.6
    Run Time : 7 Hr 53 Min 5 Sec
    Total Bars : 3371
    Total XP : 58995

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

    Default

    thanks i not really thinked of that but it's okay thanks!
    ehm about the bug still not working i dont know what you mean!
    ~Hermen

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 10
    Last Post: 09-13-2007, 09:27 PM
  2. ehm somthing with getdoorcolor
    By ShowerThoughts in forum OSR Help
    Replies: 2
    Last Post: 08-25-2007, 07:58 PM
  3. theres somthing wrong with our include
    By ShowerThoughts in forum OSR Help
    Replies: 10
    Last Post: 07-31-2007, 12:59 PM

Posting Permissions

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