Results 1 to 6 of 6

Thread: Need more Help

  1. #1
    Join Date
    Oct 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need more Help

    I have the dropping part good now. But when i run the script its very weird.
    Once i click run it mines a tin ore then logs out and nothing happens. Help please.

    SCAR Code:
    program RockSmasher;

    {.include SRL/SRL.scar}

    Const
    Rockcolor1= 7829378;
    Rockcolor2= 6447723;

    var x,y,randomm: integer;


      Procedure DeclarePlayers;
    begin
         HowManyPlayers  :=1;               // Set Number of Players here.
         NumberOfPlayers(HowManyPlayers);   // Sets the Players Array Length;
         CurrentPlayer:=0;                // CurrentPlayer = Array Index

         Players[0].Name :=''; //UserName
         Players[0].Pass :=''; //PassWord
         Players[0].Nick :=''; //NickName
         Players[0].Active:=True;


    end;

         
     Procedure Randoms;
     Begin
     FindTalk;
     FindNormalRandoms;
     solveChatRandom;
     FindLamp ('Mining') //Uses lamp on that skill
     SolvePinball;
     DwarfItem;
     If (FindFight)Then
     Begin
     MakeCompass ('N')
     RunTo('E', True)
     Wait(7000 +Random(3000));
     RunTo('W', True);
     End;
     End;
     

     procedure antiban;
    begin
     randomm := Random(4)
      case randomm of


      0:                begin

                        Wait(3591+(random(287)));
                        RandomRClick;
                        Wait(3591+(random(287)));
                        Randoms
                       end;

      1:     begin
             Wait(3694+(random(791)));
             GameTab(random(13)+1);
             Randoms;
             Wait(3694+(random(791)));
             GameTab(4);
             end;

      2:                begin
                        Wait(3294+(random(873)));

                        Randoms;
                        HoverSkill('Woodcutting' ,false);

                        Wait(3294+(random(873)));

                        end;

      3:     begin
              Wait(3694+(random(791)));
              GameTab(random(13)+1);
              Randoms;
              Wait(3694+(random(791)));
              GameTab(4);
              end;
    end;
    end;



      Procedure MineRocks;
    Begin
      repeat
        if FindObjCustom(x, y, ['Min', 'ine'], [rockcolor1, rockcolor2], 7) then
        begin
          Mouse(x,y,0,0,false);
          Wait(500+(random(150))); // <- you dont need to wait this long, the rock will already be mined
          ChooseOption('ine')
          randoms;
          antiban;
          writeln('found rock');
        end else
          writeln('couldnt find rock'); //<-- this is the only line in the else statement

      until( InvFull )

    end;


     Procedure DropOres;
    var
      i : Integer;
    begin
      if invfull then
      begin
        for i := 2 to 28 do
        begin
          DropItem(i);
          Wait(RandomRange(501, 1501));
        end;
      end;
    end;
     
     Begin
      SetupSRL;
       DeclarePlayers;
           LoginPlayer;
            repeat
             MineRocks;
              DropOres;
               until (IsFKeyDown(3));
               
               End.

  2. #2
    Join Date
    Jan 2008
    Location
    Stanford, CA
    Posts
    329
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    well i dont see how it would log out...i dont see any logout sequence in your script(or am i mistaken?). but i think u should set a loop to try finding the ore llike say 5 times before stopping. for example.

    SCAR Code:
    Procedure MineRocks;

    var
    Tries: integer;

    Begin
      repeat
       Tries:=Tries+1://tries starts at 0
        if FindObjCustom(x, y, ['Min', 'ine'], [rockcolor1, rockcolor2], 7) then
        begin
          Mouse(x,y,0,0,false);
          Wait(500+(random(150))); // <- you dont need to wait this long, the rock will already be mined
          ChooseOption('ine')
          randoms;
          antiban;
          //u might wanna put a DTM failsafe ...(if not FindDTM(ore,x,y,coors) then begin  writeln(blah); Terminatescript; end;
          writeln('found rock');
      until( InvFull )or (tries=5);
     if Tries=5 then
      //failsafe
     
    end;

    sorry if i didnt fix your problem...it might be an include problem, but nice job with your script so far. Keep it up =). Rep me if i helped

  3. #3
    Join Date
    Apr 2007
    Posts
    277
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SolvePinball doesn't work so it just logs you out, remove it.
    Current Script: Al-Kharid Fighter and Banker
    Status : Just Started

  4. #4
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    add some standards to your script :S it makes my head hurt to look at it
    ~ Metagen

  5. #5
    Join Date
    Jan 2008
    Location
    Stanford, CA
    Posts
    329
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    haha i agree standards are the key to having a great-looking script

  6. #6
    Join Date
    Oct 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok i got it working, thx guys

Thread Information

Users Browsing this Thread

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

Posting Permissions

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