Results 1 to 9 of 9

Thread: Death walk back help

  1. #1
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default Death walk back help

    ok so ive been tryin to kink out the deathwalk bugs in my script and im encountering this problem...

    the walkback procedures themselves work when i test them alone...but when i try to test them with my script it refuses to break the loop of chopping to actually start walking back even though i include failsafes throughout my chop procedures as well as my main loop...sooo any1 know what im doing wrong?

    heres my chop procedures, deathwalk procedures, and mainloop:

    SCAR Code:
    //TREE FINDING, CHOPPING, & DEATH WALKBACK PROCEDURES//
    procedure CheckBroken;
    begin
      if (Wielding = True) then
      begin
        GameTab(5);
      end else
      if (FindDTM(BrokenAxeDTM,x,y,MIX1,MIY1,MIX2,MIY2)) then
      begin
        NextPlayer(False);
      end;
    end;

    Function IsDead: Boolean;
    begin
      if(FindSymbol(x,y,'water')) or (FindChatText('h dear you are dead'))then
      Writeln('you are dead =(');
      Result:= True;
    end;

    Function FindTree: Boolean;

    var i: integer;

    begin
      for i:= 0 to 4 do
      begin
        MarkTime(WaitTime);
        if (IsUpText(TreeType)) then
        Break;
        if (TimeFromMark(WaitTime) > 60000) then
        begin
          Writeln('couldnt find the tree');
          Result:= False;
        end else
        if (FindColorSpiralTolerance(x,y,TreeColor1,Quad[i].x1,Quad[i].y1,Quad[i].x2,Quad[i].y2,TreeTol))or
           (FindColorSpiralTolerance(x,y,TreeColor2,Quad[i].x1,Quad[i].y1,Quad[i].x2,Quad[i].y2,TreeTol))or
           (FindColorSpiralTolerance(x,y,TreeColor3,Quad[i].x1,Quad[i].y1,Quad[i].x2,Quad[i].y2,TreeTol))then
        begin
          MMouse(x,y,3,3);
          if (IsUpText(TreeType)) then
            Result:= True;
        end;
      end;
    end;

    procedure WalkBackWillows;
    begin
      PerfectNorth;
      RadialRoadWalk(FindRoadColor,89,100,10,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,82,100,50,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,324,360,60,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,305,336,60,0,0);
      Flag;
      if(not(FindSymbol(x,y,'furnace')))then
      begin
        MarkTime(WaitTime);
        repeat
          RadialRoadWalk(FindRoadColor,288,400,25,0,0)
        until(FindSymbol(x,y,'furnace')) or (TimeFromMark(WaitTime) > 10000);
      end else
      RadialRoadWalk(FindRoadColor,335,360,65,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,345,375,60,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,300,275,60,0,0);
      Flag;
      if(not(FindSymbol(x,y,'quest')))then
      begin
        MarkTime(WaitTime);
        repeat
          RadialRoadWalk(FindRoadColor,290,215,20,0,0);
          Flag;
        until(FindSymbol(x,y,'quest')) or (TimeFromMark(WaitTime) > 10000);
      end else
      RadialRoadWalk(FindRoadColor,305,275,55,0,0);
      Flag;
      Mouse(596,136,10,10,True);
      Flag;
      Wait(1000 + random(700));
      begin
        if (FindTree = True) then
        begin
          Writeln('We are HERE!!!...next player now =p');
          WB:= WB + 1;
          NextPlayer(True);
        end else
          Writeln('We got lost =( next player...');
          WBF:= WBF + 1;
          NextPlayer(False);
      end;
    end;

    procedure WalkBackOaks;
    begin
      PerfectNorth;
      RadialRoadWalk(FindRoadColor,89,100,10,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,82,100,50,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,324,360,60,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,305,336,60,0,0);
      Flag;
      if(not(FindSymbol(x,y,'furnace')))then
      begin
        MarkTime(WaitTime);
        repeat
          RadialRoadWalk(FindRoadColor,288,400,25,0,0)
        until(FindSymbol(x,y,'furnace')) or (TimeFromMark(WaitTime) > 10000);
      end else
      RadialRoadWalk(FindRoadColor,335,360,65,0,0);
      Flag;
      Mouse(702,58,7,7,True);
      Wait(1000 + random(700));
      begin
        if (FindTree = True) then
        begin
          Writeln('We are HERE!!!...next player now =p');
          WB:= WB + 1;
          NextPlayer(True);
        end else
          Writeln('We got lost =( next player...');
          WBF:= WBF + 1;
          NextPlayer(False);
      end;
    end;

    procedure WalkBackTrees;
    begin
      PerfectNorth;
      RadialRoadWalk(FindRoadColor,89,100,10,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,82,100,50,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,60,85,65,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,67,84,60,0,0);
      Flag;
      RadialRoadWalk(FindRoadColor,340,380,65,0,0);
      Flag;
      Mouse(665,71,7,7,True);
      Wait(1000 + random(700));
      begin
        if (FindTree = True) then
        begin
          Writeln('We are HERE!!!...next player now =p');
          WB:= WB + 1;
          NextPlayer(True);
        end else
          Writeln('We got lost =( next player...');
          WBF:= WBF + 1;
          NextPlayer(False);
      end;
    end;

    procedure DeathWalk;
    begin
      if(not(IsDead)) then
        Exit;
      if (IsDead = True) then
      begin
        if (Wielding = True) and (FindDTM(AxeDTM,x,y,MIX1,MIY1,MIX2,MIY2)) then
        Mouse(x,y,2,2,True);
      end else
      if (Players[CurrentPlayer].integer1 = 3) then
      begin
        WalkBackWillows;
      end else
      if (Players[CurrentPlayer].integer1 = 2) then
      begin
        WalkBackOaks;
      end else
      if (Players[CurrentPlayer].integer1 = 1) then
      begin
        WalkBackTrees;
      end;
    end;

    procedure CutIt;
      begin
        case random(2) of
          0: begin
               GetMousePos(x,y);
               Wait(500 + random(100));
               Mouse(x,y,3,3,True);
               Wait(1000 + random(100));
               MMouse(x,y,3,3);
               MarkTime(WaitTime);
               if(InvFull) or (FindFastRandoms) or (not(FindColorTolerance(x,y,TreeColor1,MSX1,MSY1,MSX2,MSY2,3)))then
                 Exit;
                 while(TimeFromMark(WaitTime) < ChopTime * 1000)do
                   begin
                     Randoms;
                     CheckBroken;
                     DontGetBanned;
                     Respond;
                     DeathWalk;
                     RRotate;
                   end;
                 end;
          1: begin
               GetMousePos(x,y);
               Wait(500 + random(100));
               Mouse(x,y,3,3,False);
               ChooseOption(x,y,'own');
               Wait(1000 + random(100));
               MMouse(x,y,3,3);
               MarkTime(WaitTime);
               if(InvFull) or (FindFastRandoms) or (not(FindColorTolerance(x,y,TreeColor1,MSX1,MSY1,MSX2,MSY2,3)))then
                 Exit;
                 while(TimeFromMark(WaitTime) < ChopTime * 1000)do
                 begin
                   Randoms;
                   CheckBroken;
                   DontGetBanned;
                   Respond;
                   DeathWalk;
                   RRotate;
                 end;
               end;
             end;
           end;

    procedure Chop;
    begin
      repeat
        if (not(LoggedIn)) then
          NextPlayer(True);
          if (IsDead = True) then
            DeathWalk;
            if (FindColorTolerance(x,y, 65535, 6,6,117,27,10)) or
               (FindColorTolerance(x,y, 383705,6,6,117,27,10)) or
               (FindColorTolerance(x,y, 55769, 6,6,117,27,10)) and
               (IsUpTextMulti('hop','own',TreeType)) then
            begin
              Writeln('Ent Found RUNNING!');
              RunAwayDirection(RunDir);
              Wait(40000 + random(15000));
              RunBack;
              EntsAvoided:= EntsAvoided + 1;
            end else
            if (FindTree = True) then
            begin
              CutIt;
            end;
          until(InvFull);
        end;
    //MAIN LOOP//
    begin
      ScriptSetup;
      NEWLINE:='';
      if (not(LoggedIn)) then
        LogInPlayer;
        Setup;
        repeat
          begin
            if (not(LoggedIn)) then
              NextPlayer(True);
              if(IsDead = True)then
                DeathWalk;
                Chop;
                Drop;
                Proggy;
                if (LoadsB = Loads) then
                begin
                  NextPlayer(True);
                  LoadsB:= 0;
                  Writeln('w00t switched players');
                  Setup;
                end;
              end;
        until(False);
    end.
    METAL HEAD FOR LIFE!!!

  2. #2
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    I don't see your 'ScriptSetup' procedure anywhere. I'm guessing thats where you put 'SetupSRL' but its not there.

  3. #3
    Join Date
    May 2007
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah, other then that, the script is nice.
    Originally Posted by YoHoJo
    I like hentai.

  4. #4
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    lol my whole script is much longer than that...i just posted the chopping procedure, deathwalks, and mainloop to see what i should change to make it break from chopping to deathwalking...

    any1 have any suggestions on doing that?
    METAL HEAD FOR LIFE!!!

  5. #5
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    So you are having problems with it exiting the chopping procedure to walk back to the bank right? I think it might be because you've only told the script to check if the inv is full once just after it starts chopping. So unless the inv is full almost as soon as it clicks the tree it will continue until WaitTime is greater than whatever. I'm not sure but that might be the problem.

  6. #6
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    no lol this is a powerchopper and it doesnt bank...

    this is if your character dies it will walkback to an area where you can cut the certain type of tree that you want. sooo

    lets say my char is chopping...then somehow it dies...and im in lumby it will indicate that im dead and my IsDead function recognizes that, but it will try to find trees at lumby instead of actually walking back to the chopping spot.

    so im having trouble breaking from the chopping procedure, yes. however its not due to the invfull thing cuz its in a repeat loop.
    METAL HEAD FOR LIFE!!!

  7. #7
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Oh I get it... I got confused with so many procedures involving walking and stuff. Sorry. Anyhow... this probably isn't the cause of the problem but I've noticed something:
    SCAR Code:
    Function IsDead: Boolean;
    begin
      if(FindSymbol(x,y,'water')) or (FindChatText('h dear you are dead'))then
      Writeln('you are dead =(');
      Result:= True;
    end;

    Because you didn't put begin after the if (findsymbol....) then line, it will only write 'you are dead' if it finds the symbol or the talk but will return a result of true everytime the function is called. You need to put begin and end around the writeln and the result:=true to make it work properly:

    SCAR Code:
    Function IsDead: Boolean;
    begin
      if(FindSymbol(x,y,'water')) or (FindChatText('h dear you are dead'))then
      begin
        Writeln('you are dead =(');
        Result:= True;
      end;
    end;

    EDIT: I've found your problem...:

    SCAR Code:
    procedure DeathWalk;
    begin
      if(not(IsDead)) then
        Exit;
      if (IsDead = True) then
      begin
        if (Wielding = True) and (FindDTM(AxeDTM,x,y,MIX1,MIY1,MIX2,MIY2)) then
        Mouse(x,y,2,2,True);
      end else
      if (Players[CurrentPlayer].integer1 = 3) then
      begin
        WalkBackWillows;
      end else
      if (Players[CurrentPlayer].integer1 = 2) then
      begin
        WalkBackOaks;
      end else
      if (Players[CurrentPlayer].integer1 = 1) then
      begin
        WalkBackTrees;
      end;
    end;

    If you look at the else after the 'If(Wielding...) then' line, you'll notice that if it ISN'T DEAD then it will walk back. This is because the else basically means if this isn't true then do this. If you get rid of the else, you should be fine.

  8. #8
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    sweet ill test it out thanks

    EDIT:

    HELL YES! it works thanks so much dude !!!
    METAL HEAD FOR LIFE!!!

  9. #9
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Lol np... glad to help.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How Do I Death Walk?
    By tigerskall in forum OSR Help
    Replies: 28
    Last Post: 11-10-2007, 09:40 AM
  2. death itself is not as bad as can be
    By WhiteShadow in forum Blogs and Writing
    Replies: 12
    Last Post: 05-06-2007, 03:14 PM
  3. Death
    By XxKanexX in forum Blogs and Writing
    Replies: 2
    Last Post: 03-07-2007, 01:07 AM
  4. Death.
    By Cruel in forum Blogs and Writing
    Replies: 12
    Last Post: 02-16-2007, 05:37 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
  •