Results 1 to 3 of 3

Thread: Am I doing this right..

  1. #1
    Join Date
    Oct 2006
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Am I doing this right..

    I am working on a autofighter and was wondering if this would work.
    I am trying to get it to stop after a cetain number of kills.
    I have this so far, do you think it would work?

    SCAR Code:
    const
      monsterstokill=1000; //Number of monsters you want to fight before stopping.

    My fighting procedure is this.
    SCAR Code:
    procedure Fighting;
    begin if not InFight then begin
        FindMonster(MColor1, MColor2, MColor3,tolerance,MonsterName);
        KAttackMonster(MColor1,MColor2,MColor3,tolerance,MonsterName);
      end;

    and finally, my main question is how to make it stop after a certain number of kills, is it right?
    SCAR Code:
    begin
     Startup;
     SetFightMode(FightMode);
     repeat
       ABan;
       MonsterColors;
       FindNormalRandoms;
       progressreport;
       Fighting;
       a=a+1;
     until(a=monsterstokill);
       Logout;
       Writein('Finished Fighting, Logout')
    end.

    I saw something like this in a tutorial and didnt kniw if I was doing it right.

  2. #2
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    yes it is right, although u should add "SetupSRL" in your main loop

    if you want to see what a is, you could add this line,
    SCAR Code:
    writeln('a = '+IntToStr(a))

    the procedure Writeln can only print out strings. thats why you use the function IntToStr, which changes an integer into a string so i can be printed out.

    another thing iv noticed is you use the procedure called Writein,
    this will not work because that doesnt exist, the procedure you want it WriteLn (its an L, like Lady Lamp or Like)
    Join the Official SRL IRC channel. Learn how to Here.

  3. #3
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    A tip for remembering is to think of it as write line.

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
  •