Results 1 to 4 of 4

Thread: heey case statement

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

    Default heey case statement

    ehm i wanna use 3 different walks


    SCAR Code:
    procedure walk;
    begin
      if not loggedin then exit;
     
      case whichwalk(2) of
        0:begin
             radialroadwalk
           end;  
        1:begin
             radialroadwalk
           end;  
        2:begin
             radialroadwalk
           end;

    i wanna do somthing like this
    should i make 3 different procedures
    and then a case or a case it clicks one time and then a case again and then to the place? the second is most random but is that smart?
    ~Hermen

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

    Default

    Umm I'm a little confused on what you're trying to do here?
    Can you explain again?

  3. #3
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    the easiest way would be to make a case and have 3 seperate procedures for each type of walking
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


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

    Default

    okay i fixed but got a compile prob...
    SCAR Code:
    program HideTannerAndCrafter;
    {.include srl/srl.scar}

    var
     x, y :integer;
    Tan, Cactuscolor, Cactus :integer;
    TanColor, hide, H, Hi:integer;
    HideText, Rock, RockColor,  loads, load,TanSymbol,loopbrake :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 :='';          // runescape username
         Players[0].Pass :='';          // runescape password
         Players[0].Nick :='ran';          // nick, 3 - 4 letters of username
         Players[0].Loc  :='bank';      // you can use 'somewhere' or 'Aereck'
         Players[0].Integers[1] := 5;   //howman
         Players[0].Active:=True;       // active player



         writeln(inttostr(HowManyPlayers)+' Players');

    end;

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



    {===============================================]
        this function finds randoms by:wt-fawaki
    [===============================================}

    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;



    procedure LoadDtms;
    begin
     hide := DTMFromString('78DA63E4656060006124B06BE346062E20CD0' +
           '8C4FF81809119C8606740038C48249006A91121A0860F48481150' +
           '2301249809A891041202F8D50000C82E06DB');

     HideText := DTMFromString('78DA633CCFC8C0D00CC458004C94F10890D54' +
           '4849A3A026A761261CE7620AB910835AD04D4DC24C29C9744B8E7' +
           '19116A1E03590DA86A7EA0ABD90B64F51350738C08351731D560B' +
           '8E73A903599809A0340D624026AF6629A83E19EF544F87D139055' +
           '4F40CD6622D2CF66C2691500FDE0200E');
     HI := DTMFromString('78DA635CCFC0C0B09001159CF8C1C005A4188' +
           '1F83F1030AE0332E63360058C307A13916A961150B38EB01A001A' +
           'D60C6B');
    end;
    procedure LoadBigDtm;
    begin
      TanSymbol := DTMFromString('78DA63AC66626008664001A5215A0C5C409A1' +
           '188FF03016329504D00AA1A464626080DE39703F97E04D45401F9' +
           'BE04D4D410A1A68E08BBEA8950D300E4FB1350D34884DF416AC20' +
           '9A86902F2438950134684DFA388F07B141171114D445C50430D31' +
           '769512118620351104D4941011CE2598691EAB5D84E2BD0CC88FC' +
           '4AF060049E21924');
    end;

    procedure ClickTanSymbol;
    var
    LoopInteger: Integer;
    begin
     loadbigdtm;
     LoopInteger:=0;
     LoopBrake:=false
     repeat
      LoopInteger:= loopinteger + 1
      if finddtm(TanSymbol,x,y,MSX1, MSY1, MSX2, MSY2) then
       begin
          mmouse(x,y,1,0);
          mouse(x,y,2,1,false);
          loopbrake:=true
          flag;
       end;
      until (LoopInteger >= 15) or loopbrake;
       if not finddtm(TanSymbol,x,y,MSX1, MSY1, MSX2, MSY2) then
       logout;
       nextplayer(false);
    end;

    function FindHideText1:boolean;
    var
      LoopInteger: Integer;
      LoopBrake: Boolean;
    begin
      if not loggedin then exit;
      LoopInteger := 0;
      LoopBrake := False;
      loaddtms;
       repeat
         LoopInteger:= LoopInteger + 1
         if FindDTM(HideText,x,y,MSX1, MSY1, MSX2, MSY2) then
         begin
           mmouse(x,y,5,5);
           wait(100+random(300));
           GetMousePos(x,y);
           mouse(x,y,0,0,false);
           LoopBrake := True;
        end;
          until((LoopInteger>=10)or(LoopBrake))
          if loopbrake then
          logout;
          nextplayer(False);
       end;

    function FindHideText:boolean;
    var
      LoopInteger: Integer;
      LoopBrake: Boolean;
    begin
      if not loggedin then exit;
      LoopInteger := 0;
      LoopBrake := False;
      loaddtms;
        repeat
          LoopInteger:= LoopInteger + 1
          if FindDTM(HI,x,y,MSX1, MSY1, MSX2, MSY2) then
          begin
            mmouse(x,y,5,5);
            wait(100+random(300));
            GetMousePos(x,y);
            mouse(x,y,0,0,false);
            result:=true;
            LoopBrake := True;
          end else
            result:=false
            logout;
          until((LoopInteger>=10)or(LoopBrake))
          if not((LoopInteger>=10)or(LoopBrake)) then
            logout;
            nextplayer(False);
       end;



    procedure GetHides;
    var
      LoopInteger: Integer;
      LoopBrake: Boolean;
    begin
      If Not LoggedIn Then Exit;
        makecompass('N')
        Highestangle;
        wait(100);
        OpenBankFast('akb');//leave this
        wait(100);
        fixbank;
        LoopInteger := 0;
        LoopBrake := False;
       repeat
         LoopInteger:= LoopInteger + 1
         if FindObj(X, Y,'oins', 2084091,10) then
         loopbrake:=true
         Mouse(x,y,0,0,false);
         begin
           if chooseoption('X') then
           begin
             wait(1000);
             writeln('found money taking money from bank');
             typesend('81');
             loopbrake:=true
          end;
        end;
           wait(1000+random(500));
        until((loopinteger>=10) or (loopbrake))
          loaddtms;
          if FindDTM(hide,x,y,MSX1, MSY1, MSX2, MSY2) then
          begin
            mmouse(x,y,1,0);
            mouse(x,y,2,1,false);
              if chooseoption('All') then
              begin
                writeln('found hides in bank');
                closebank;
                exit;
              end else
                writeln('cant find cowhide in bankscreen');
                closebank;
                logout;
         end;
    end;

    procedure GetCactusColor;
    begin
       Cactus := BitmapFromString2(False, 'aB199078DA1DCCC911C0200' +
           'C43D1960C5E732404FA2F297C2E6F3492C722225F3F488D830E74' +
           '5B18E4F0C208349A5EC6EA13F7EDEF034B2567C3879C2F97391D0' +
           '78DA85F97564C6D3F568');

      CactusColor:=AutoColorThis(Cactus,200 , MMX1, MMY1, MMX2, MMY2);
      WriteLn('CactusColor: '+IntToStr(CactusColor));
      FreeBitmap(Cactus);
    end;


    procedure GetTanColor;
    begin
      tan := BitmapFromString2(False, 'a51C4C78DA45CC410E80300' +
           '844D12B8DA543E9D26AB9FF91044C74F3F2432600C0DD02D81928' +
           '2D64DFD9E89F34CD962B6C561766D3EB5E0FC6AAFD38B2EBC3AB2' +
           'E66CF1A4D4F65DBA08ABAFF3E8FF');

      TanColor:=AutoColorThis(Tan, 100, MMX1, MMY1, MMX2, MMY2);
      WriteLn('TanColor: '+IntToStr(TanColor));
      FreeBitmap(Tan);
    end;

    procedure GetRockColor;
    begin
      Rock := BitmapFromString2(False, 'aE149A78DA1DCBC9154021080' +
           '3C09608AB1EFD8BFD97A4E132E405101159E322F15EBC684259E4' +
           'A21FD5E1CC7D133B79A3FD541C159BCD34663C5C58B4BFC3001C2' +
           '88');

      RockColor:=AutoColorThis(Rock, 100, MMX1, MMY1, MMX2, MMY2);
      WriteLn('RockColor: '+IntToStr(RockColor));
      FreeBitmap(Rock);
    end;

    procedure walk1;
    begin
      if not loggedin then exit;
        GetCactusColor;
        radialroadwalk(CactusColor,50,120,60,0,0);
        Flag;
        radialroadwalk(CactusColor,0,120,60,0,0);
        flag;
        ClickTansymbol;

    end;

    procedure walk2;
    begin
      if not loggedin then exit;
      getRockcolor;
        setrun(true);
        radialroadwalk(RockColor,0,120,60,20,-20);
        flag;
        ClickTansymbol;
    end;

    procedure walk3;
    begin
      if not loggedin then exit;
      GetCactusColor;
        radialroadwalk(CactusColor,50,120,60,0,-30);
        Flag;
        ClickTansymbol;
    end;

    function ToHideTanner:boolean;
    begin
      if not loggedin then exit;
      case Random(3)+1 of
      1 : walk1;
      2 : walk2;
      3 : walk3;

      end;
    end;

    function TalkToEllis:boolean;
    var
    LoopInteger: Integer;
    begin
      if not loggedin then exit;
        LoopInteger := 0;
      repeat
        LoopInteger := LoopInteger + 1
        wait(100+random(300));
        if (FindColorTolerance(x, y, 5208536, MSX1, MSY1, MSX2, MSY2, 10)) then
        begin
          Mouse(x, y, 6, 6, false);
          wait(100+random(300));
          ChooseOption('ade');
          markTime(H);
          Wait(1000+random(1000));
        end;
      until FindHideText or findhidetext1 or(LoopInteger >= 15)
        begin
          if findhidetext1 then
          begin
            logout;
            nextplayer(False);
          end else
            chooseoption('ll');
            wait(500+random(50))
      end;
    end;


    function ToBank:boolean;
    begin
      If Not LoggedIn Then Exit;
        setrun(true);
        radialroadwalk(2566901,130,200,65,x,y);
          if findcolorspiraltolerance(x,y,1390414,MMX1,MMY1,MMX2,MMY2,10) then
          begin
            mmouse(x,y,0,0);
            mouse(x,y,3,3,true);
            Flag;
          end;
          if findcolorspiraltolerance(x,y,5166057,MMX1,MMY1,MMX2,MMY2,10) then
          begin
            mmouse(x,y,0,0);
            mouse(x,y,3,3,true);
           flag;
        end;
    end;

    procedure StoreTannedHides;
    begin
      If Not LoggedIn Then Exit;
        openbankfast('akb');//leave this
        depositall;
        load:=load + 1
    end;


    procedure SetupClient;
    begin
      LoadDtms;
      activateclient;
      wait(1000);
      declareplayers;
      CheckUserNicks;
      loginplayer;
    end;
    {====================]
          mainloop
    [====================}

    begin
      setupsrl;
      setupclient;
     repeat
       Gethides; //takes the hide and money out of bank
       ToHideTanner;//goes to hide tanner
       TalkToEllis;//talks to hideranner and tans the hides
       tobank;//goes to bank
       storeTannedHides;//stores the tanned hides
     Until Load = Players[CurrentPlayer].Integers[1]
      if (Load >= Players[CurrentPlayer].Integers[1]) then
        begin
          NextPlayer(True);
          Loads := 0;
        end;

    end.
    ~Hermen

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. What is wrong here? (if- statement)
    By marpis in forum C/C++ Help and Tutorials
    Replies: 3
    Last Post: 12-06-2008, 01:26 AM
  2. help with if-then else statement
    By OwnedPl0x?!?! in forum OSR Help
    Replies: 3
    Last Post: 11-17-2007, 12:42 PM
  3. Case Statement Failsafe
    By Kave in forum OSR Help
    Replies: 4
    Last Post: 09-03-2007, 03:27 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
  •