Results 1 to 11 of 11

Thread: Need something very small that i dont know...

  1. #1
    Join Date
    Dec 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need something very small that i dont know...

    Hello, here is a function im using in my *first* srl script.

    SCAR Code:
    function FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut:
      Integer): Boolean;
    var
      I, Color: Integer;
    begin
      for I := 1 to 6 do
      begin
        case I of
          1: Color := Color1;
          2: Color := Color2;
          3: Color := Color3;
          4: Color := Color4;
          5: Color := Color5;
          6: Color := Color6;
        end;
        if (LoggedIn) then
        begin
          if (FindObj(x, y, 'ttack', Color, tol)) then
          begin
            Result := True;
            GetMousePos(x, y);
            if (not (LoggedIn) or (WeAreDead)) then break;
            Mouse(x, y, 0, 0, True);
            if (not (LoggedIn) or (WeAreDead)) then break;
            Wait(2000);
            FFlag(10);
            MarkTime(Mark);
            repeat
              if (not (LoggedIn) or (WeAreDead)) then break;
              Wait(1000 + Random(500));
              FindNormalRandoms;
              if (TimeFromMark(Mark) > TimeOut) then break;
            until ((not (FindColorSpiral(x, y, GreenStatusColor, 240, 140, 290, 175))
              or (WeAreDead)));
            NPCS := NPCS + 1;
            Players[CurrentPlayer].Killed := Players[CurrentPlayer].Killed + 1;
          end
          else
            Result := False;
        end
      end
    end;

    Ok, heres the problem, interger is screwing it up, how do i resolve this?
    Note: Yes, i did put timeout in the const

  2. #2
    Join Date
    Jun 2006
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What do you mean integer is screwing it up?

  3. #3
    Join Date
    Dec 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    In the debug box, it will say

    'Line 22: [Error] (18095:80): Invalid number of parameters in script'

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

    Default

    what's on line 22?

  5. #5
    Join Date
    Dec 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Here is the full script oh so far
    SCAR Code:
    program New;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}
    //Hello, this is a script by petrock6. If you need any small script PM me!
    //I am not responsible for anything of your lose to this script or me.
    var
      I, Color: Integer;
      Const //Set colors, food colors, stat colors, weapon color etc
    Color1 = 00000000;//Color 1, 2, 3 etc will detirmine monster colors
    Color2 = 00000000;//You can choose the same, but not recommended.
    Color3 = 00000000;
    Color4 = 00000000;
    Color5 = 00000000;
    Color6 = 00000000;
    foodcolor = 00000000;//Color of the food you want to eat.
    eathp = 00;//Hp you want to start eating at i reccomend half
    foodlogout = False; //If true, this script will disable chars with no food
    tol = 0; //Tolerance of finding monster color
    TimeOut = 1; //Amount of time to wait till clicking the next monster
    begin
     Repeat
    FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut, Integer): Boolean;
    var
      I, Color: Integer;
    begin
      for I := 1 to 6 do
      begin
        case I of
          1: Color := Color1;
          2: Color := Color2;
          3: Color := Color3;
          4: Color := Color4;
          5: Color := Color5;
          6: Color := Color6;
        end;
        if (LoggedIn) then
        begin
          if (FindObj(x, y, 'ttack', Color, tol)) then
          begin
            Result := True;
            GetMousePos(x, y);
            if (not (LoggedIn) or (WeAreDead)) then break;
            Mouse(x, y, 0, 0, True);
            if (not (LoggedIn) or (WeAreDead)) then break;
            Wait(2000);
            FFlag(10);
            MarkTime(Mark);
            repeat
              if (not (LoggedIn) or (WeAreDead)) then break;
              Wait(1000 + Random(500));
              FindNormalRandoms;
              if (TimeFromMark(Mark) > TimeOut) then break;
            until ((not (FindColorSpiral(x, y, GreenStatusColor, 240, 140, 290, 175))
              or (WeAreDead)));
            NPCS := NPCS + 1;
            Players[CurrentPlayer].Killed := Players[CurrentPlayer].Killed + 1;
          end
          else
            Result := False;
        end
      end
    end;
    procedure RealEatIfNeeded(foodcolor, eathp: Integer; foodlogout: Boolean);
    begin
      if (GetHp <= EatHp) and (FoodColor >= 0) then
      begin
        GameTab(4);
        Wait(10 + Random(20));
        if (FindColorSpiralTolerance(x, y, foodcolor, 560, 210, 730, 460, 2)) then
        begin
          MMouse(x + 2, y - 2, 6, 5)
            if (IsUpText('Eat')) then
          begin
            GetMousePos(x, y);
            Mouse(x, y, 3, 2, True);
          end;
        end
        else
        begin
          if (FoodLogout) then
          begin
            Logout;
            Players[CurrentPlayer].Active := False;
          end;
        end;
      end;
    end;
    Until(false)
    end.
    It isnt to big because i havent added anti randoms anti ban, etc.

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

    Default

    ok your script is confusing me. This is how it should be

    program new;
    ////////////////////////Globals
    const
    blah=2;
    blah1='ddjkdjk';

    var
    lolldsj:integer;
    something:string;

    ////////////////////procedures and functions

    function f1Juggling (whichnum:integer) :boolean;
    var
    myint:integer;
    begin
    if whichnum=3 then result:=true;
    end;

    procedure declarebitmaps;
    begin
    lolldj:=bitmapfromstring('ssksjks');
    end;

    ////////////// main loop

    begin
    setupsrl;
    declarebitmaps;
    repeat
    if f1juggling(3) then writeln('yes');
    until isfkeydown(12);
    end.

  7. #7
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    SCAR Code:
    //I am not responsible for anything of your lose to this script or me.
    ummmm......what did you mean by "or me" in what way might they possibly lose things to you ?
    STOP PM'ING ME

  8. #8
    Join Date
    Dec 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm not talking about that, your spamming, i don't like spammers....Im talking about small issues...

  9. #9
    Join Date
    Dec 2006
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;
    {.include srl/srl.scar }
    {.include srl/srl/skill/fighting.scar}
     
    var I, Color: Integer;
     
    Const //Set colors, food colors, stat colors, weapon color etc
    Color1 = 00000000;//Color 1, 2, 3 etc will detirmine monster colors
    Color2 = 00000000;//You can choose the same, but not recommended.
    Color3 = 00000000;
    Color4 = 00000000;
    Color5 = 00000000;
    Color6 = 00000000;
    foodcolor = 00000000;//Color of the food you want to eat.
    eathp = 00;//Hp you want to start eating at i reccomend half
    foodlogout = False; //If true, this script will disable chars with no food
    tol = 0; //Tolerance of finding monster color
    TimeOut = 1; //Amount of time to wait till clicking the next monster
     
     
     
    begin
    setupsrl;
    FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut);
    RealEatIfNeeded(foodcolor, eathp ,foodlogout);
    end.

    arghttt

  10. #10
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    you still need to put the
    FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut);
    and
    RealEatIfNeeded(foodcolor, eathp ,foodlogout);
    as functions and procedure in your script, otherwise it wont work


    EDIT:
    BUT!
    that will work actualy
    because you copied and pasted those procedures from srl. so yea
    thats fine

  11. #11
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    Quote Originally Posted by petrock6 View Post
    I'm not talking about that, your spamming, i don't like spammers....Im talking about small issues...
    ermmm how is this spaming?? do you even know what spaming is? and the post was merely out of concern for myself and everyone else...so unless you got something to hide whats the big deal?
    STOP PM'ING ME

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help (only small)
    By poolikemax in forum OSR Help
    Replies: 5
    Last Post: 08-27-2008, 10:09 AM
  2. Small Help.
    By faster789 in forum OSR Help
    Replies: 11
    Last Post: 04-19-2008, 02:52 PM

Posting Permissions

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