Results 1 to 9 of 9

Thread: Cant figure out a way to...

  1. #1
    Join Date
    Nov 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Cant figure out a way to...

    A way to

    until(InvFull)
    then
    procedure walktoshop

    Been stuck here for an hour now. My script is still only sat 10-30% done and most of the stuff is incomplete. Please advise me on how to complete it, trying to make a lumby oak cutter + seller.

    my script is below:

    SCAR Code:
    program OaksGotPwned;
    {.include SRL/SRL.Scar}

    const
         Shop = 2709391; // color of the pot of the general shop in minimap
         OakColor = 3105112; // color of the oak leaves, pick any color

    var
     x, y :integer;     // do not touch this

    /////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////

    procedure Signature;
    begin
      ClearDebug;
      writeln('Oaks Got Pwned! OMGZORZ!!!!!!!!!!!!!');
      writeln('This Script has been made by r3dr4g0n');
      writeln('Please do not distribute without permission');
      writeln('You can edit my script to make your own,')
      writeln('just give me credit');
      writeln('ENJOY THE SCRIPT!');
      wait(3000 + random(750));
    end;


    ///////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////

    procedure FaceNorth;
    begin                     //  Sets up your
         MakeCompass('N');    //  compass and
         HighestAngle;        //  highest angle
         MouseSpeed:=15;      // <--- this is your mouse speed, change it if you know what your doing
         Gametab(4);
    end;


    ///////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////

    Function CutOak: Boolean;
    begin
      repeat
         if(Findcolor(x, y, OakColor, 140, 3, 515, 337)) then
         begin
              MMouse(x, y, 5, 5);
              Wait(100 + random(50));
              if IsUpText('ak') then
              begin
                Mouse(x, y, 0, 0, True);
                Result := True;
              end;
         end;
      until (result)
    end;

    //////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////

    procedure WalkItOut;
    begin

    end;

    //////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////

    begin
         Activateclient;    // minimizes scar and opens RS
         SetupSRL;
         Signature;
         Wait(100+random(100));        // waits 3 seconds before doing anything
         FaceNorth;
         SetRun(true)
         GameTab(4);         // faces in the right direction
            repeat
              CutOak;            // starts cutting oak
              Findnormalrandoms;
              Wait(1500+random(1500));
              WalkItOut;   // walks to shop when ur inven is full
    end.

  2. #2
    Join Date
    Nov 2006
    Location
    In an Amish Paradise
    Posts
    729
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try this...

    SCAR Code:
    Function CutOak: Boolean;
    begin
         if(Findcolor(x, y, OakColor, 140, 3, 515, 337)) then
         begin
              MMouse(x, y, 5, 5);
              Wait(100 + random(50));
              if IsUpText('ak') then
              begin
                Mouse(x, y, 0, 0, True);
                Result := True;
              end;
         end;
    end;

    begin
    repeat
    If CutOak then
    WriteLn('Cutting Oaks!')
    until(Invfull)
    end.

    Next time make a function that doesn't have a loop in it
    ~Stupedspam

  3. #3
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Not much point in using a function for the chopoak procedure..

    SCAR Code:
    program OaksGotPwned;
    {.include SRL/SRL.Scar}

    const
         Shop = 2709391; // color of the pot of the general shop in minimap
         OakColor = 3105112; // color of the oak leaves, pick any color

    var
     x, y :integer;     // do not touch this

    /////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////

    procedure Signature;
    begin
      ClearDebug;
      writeln('Oaks Got Pwned! OMGZORZ!!!!!!!!!!!!!');
      writeln('This Script has been made by r3dr4g0n');
      writeln('Please do not distribute without permission');
      writeln('You can edit my script to make your own,')
      writeln('just give me credit');
      writeln('ENJOY THE SCRIPT!');
      wait(3000 + random(750));
    end;


    ///////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////

    procedure FaceNorth;
    begin                     //  Sets up your
      MakeCompass('N');    //  compass and
      HighestAngle;        //  highest angle
      MouseSpeed:=15;      // <--- this is your mouse speed, change it if you know what your doing
      Gametab(4);
    end;


    ///////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////

    Procedure CutOak;
    begin
      repeat
        if(Findcolor(x, y, OakColor, 140, 3, 515, 337)) then
        begin
          MMouse(x, y, 5, 5);
          Wait(100 + random(50));
          if IsUpText('ak') then
          begin
            Mouse(x, y, 0, 0, True);
          end;
        end;
      until(InvFull)
    end;

    //////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////

    procedure WalkItOut;
    begin

    end;

    //////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////

    begin
      Activateclient;    // minimizes scar and opens RS
      SetupSRL;
      Signature;
      Wait(100+random(100));        // waits 3 seconds before doing anything
      FaceNorth;
      SetRun(true)
      GameTab(4);         // faces in the right direction
      repeat
        CutOak;            // starts cutting oak
        Findnormalrandoms;
        Wait(1500+random(1500));
        WalkItOut;   // walks to shop when ur inven is full
      until(false)
    end.

    Use a repeat inside the chop procedure, once the inventory is full leave the procedure and continue onto the next (WalkItOut)

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  4. #4
    Join Date
    Sep 2007
    Posts
    415
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    NVM didn't notice that you had ChopOak to end when inv is full...roger got it
    Quote Originally Posted by That guy that wrote forefeathers
    <munklez>haha im too lazy, girls annoy me
    <munklez> they always wanna like, do stuff
    <munklez> and i just wanna program
    <munklez> and they always take all my money

  5. #5
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Would kinda work yes (apart from the commented until), but thats not the "proper" way of doing it. The problem is the random checking.

    You need to ...
    • Start cutting
    • Check for ent
    • Check for randoms while cutting
    • AntiBan (random movement of mouse, hoverskill)
    • Repeat.. untill full
    • Bank
    • Repeat.


    In my script, while i am "chopping" i run the antirandoms and antiban. After x seconds it re-clicks tree, or if the tree is gone then it waits 6-8 seconds and then looks again.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  6. #6
    Join Date
    Nov 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay now when my Inventory is full, it stops but it doesn't go WalkItOut :P

  7. #7
    Join Date
    Nov 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    dunno how to put in an ENT or random, read the guides BUT I dont wanna bother with that yet, this is just my first script ill make it later later... but i dunno how to walk and then repeat, im using Radial Walk ... heres what it looks like now :

    SCAR Code:
    program OaksGotPwned;
    {.include SRL/SRL.Scar}

    const
         Shop = 4225977; // color of the pot of the general shop in minimap
         OakColor = 3105112; // color of the oak leaves, pick any color

    var
     x, y :integer;     // do not touch this

    /////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////

    procedure Signature;
    begin
      ClearDebug;
      writeln('Oaks Got Pwned! OMGZORZ!!!!!!!!!!!!!');
      writeln('This Script has been made by r3dr4g0n');
      writeln('Please do not distribute without permission');
      writeln('You can edit my script to make your own,')
      writeln('just give me credit');
      writeln('ENJOY THE SCRIPT!');
      wait(3000 + random(750));
    end;


    ///////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////

    procedure FaceNorth;
    begin                     //  Sets up your
         MakeCompass('N');    //  compass and
         HighestAngle;        //  highest angle
         MouseSpeed:=15;      // <--- this is your mouse speed, change it if you know what your doing
    end;


    ///////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////

    Procedure CutOak;
    begin
      repeat
        if(FindColor(x, y, OakColor, 1, 1, 515, 337)) then
        begin
          MMouse(x, y, 5, 5);
          Wait(100 + random(50));
          if IsUpText('ak') then
          begin
            Mouse(x, y, 0, 0, True);
            Wait(1500 + random(1500));
          end;
        end;
      until(InvFull)
    end;

    //////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////

    procedure WalkItOut;
    begin
         RadialWalk(Shop , 47, 104, 50, 0, 0);
    end;

    //////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////

    begin
         Activateclient;    // minimizes scar and opens RS
         SetupSRL;
         Signature;
         Wait(100+random(100));        // waits 3 seconds before doing anything
         FaceNorth;
         SetRun(true)
         GameTab(4);         // faces in the right direction
            repeat
              CutOak;            // starts cutting oak
              Findnormalrandoms;
              Wait(20000+random(1500));
              WalkItOut;   // walks to shop when ur inven is full
         until(false)
    end.

  8. #8
    Join Date
    Nov 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Roger, can I look at your script and take some stuff out of it and take ideas ?

    NVM thats too advanced for me at this stage

  9. #9
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    r3dr4g0n.

    Your free to take any ideas from my script. Taking code won't help your learning.

    Finding ent is the easy part, use the FindEnt, or the FindEntA in my script.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Can YOU figure it out??
    By Metagen in forum OSR Help
    Replies: 3
    Last Post: 10-07-2008, 06:44 PM
  2. Bug, Very hard to figure!
    By faster789 in forum OSR Help
    Replies: 6
    Last Post: 04-07-2008, 09:37 AM
  3. Grrr... Can't seem to figure this out!!
    By Illkillutill in forum OSR Help
    Replies: 16
    Last Post: 02-14-2008, 03:25 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
  •