Results 1 to 4 of 4

Thread: help with AttackMode

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

    Default help with AttackMode

    in my script, i want to make it so that the skill to train is the lowest skill they have that they set a goal for, so if their goals were 40 attack 10 def and 50 str, it would train each skill fairly evenly, until that skill reached it's goal, here's what i have so far

    SCAR Code:
    function AttackMode:boolean;
    var
      i,att,str,def:integer;
      Levels[0..2]: array of integer;
    begin
      if not(loggedIn) then exit;
      result:=true;
      if (timefrommark(a)>60000)or(players[currentplayer].skill='') then
      begin
        GameTab(2);
        wait(200);
        Levels[0] := 100;
        Levels[1] := 100;
        Levels[2] := 100;
        att:=getskillinfo('attack',false);
        str:=getskillinfo('strength',false);
        def:=getskillinfo('defence',false);
        if Debug then writeln(inttostr(att)+' attack');
        if Debug then writeln(inttostr(str)+' strength');
        if debug then writeln(inttostr(def)+' defence');
        marktime(a);
        Players[CurrentPlayer].skill:='';
        While (Players[CurrentPlayer].skill:='') do
        begin
        if att<lowercasE(players[CurrentPlayer].integers[1] then
          Levels[0] := att;
        if str<lowercasE(players[CurrentPlayer].integers[2] then
          Levels[1] := str;
        if def<lowercasE(players[CurrentPlayer].integers[3] then
          Levels[2] := def;
          Players[CurrentPlayer].skill =
        end;
      end;
        GameTab(1);
        case lowercase(players[currentplayer].skill) of
          'attack': setfightmode(1);
          'strength': setfightmode(2);
          'defence','defense': setfightmode(4);
          else result:=false;
        end;
      end;
    end;

    how could i find the lowest integer in the array, or what should i change to make it do this, thanks in advance guys
    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

  2. #2
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Gimme A Min

    Edit: Ok, Used The Integers[3], [4], and [5] (relised it was ForeFeathers) to determin lowest and not >= for target
    SCAR Code:
    procedure AttackMode;
    var
      att, str, def: Integer;
    begin
      if not LoggedIn then Exit;
      GameTab(2);
      Wait(200);
      att := Getskillinfo('attack',false);
      str := Getskillinfo('strength',false);
      def := Getskillinfo('defence',false);
      Players[CurrentPlayer].skill:='';
      while (Players[CurrentPlayer].skill = '') do
      begin
        if Players[CurrentPlayer].Integers[3] < Players[CurrentPlayer].Integers[3] and att < Players[CurrentPlayer].Integers[3] and not att > = Players[CurrentPlayer].Integers[3] then
          Players[CurrentPlayer].skill := 'attack';
        if str < Players[CurrentPlayer].Integers[3] and Players[CurrentPlayer].Integers[3] < Players[CurrentPlayer].Integers[3] and not att > = Players[CurrentPlayer].Integers[4] then
          Players[CurrentPlayer].skill := 'strength';
        if Players[CurrentPlayer].Integers[3] < Players[CurrentPlayer].Integers[3] and def < Players[CurrentPlayer].Integers[3] and not att > = Players[CurrentPlayer].Integers[5] then
          Players[CurrentPlayer].skill := 'defence';
      end;
      GameTab(1);
      case lowercase(players[currentplayer].skill) of
        'attack': setfightmode(1);
        'strength': setfightmode(2);
        'defence','defense': setfightmode(4);
      end;
    end;

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

    Default

    there has got to be an easier way than that...i don't understand it at all..i mean, really, it confuses the shit out of me..
    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

  4. #4
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thats It...

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
  •