Results 1 to 13 of 13

Thread: Script help please :)

  1. #1
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default Script help please :)

    hey there i am making a script but i got a problemo:
    I need an IsFull function but already have WillowAmount :

    SCAR Code:
    function WillowAmount: Integer;
    Var
      Logs, X, Y, I, C : Integer;
      Box : TBox;

    Begin
      try
        Logs := DTMFromString('78DA63DCC8C4C0F08A010D30229140FA2450C' +
             'D4D026AB601D5DC25A0E61450CD23026ACE01D5BC26A0663750CD' +
             '47FC6A00BF630A00');
        IncEx(Players[CurrentPlayer].Integers[2], CountItemsIn('inv', 'dtm', Logs, []));
        IncEx(ReportVars[1], CountItemsIn('inv', 'dtm', Logs, []));
        For I := 1 To 28 Do
        Begin
          Box := InvBox(I);
          If FindDTM(Logs, X, Y, Box.X1, Box.Y1, Box.X2, Box.Y2) Then Inc(C);
        End;
        Result := C;
      finally
        FreeDTM(Logs);
      end;
    End;

    do i need to make a IsFull function?

    I am really tired and confused with what i have made lol, and have an operation in about 3 hours

    T~M

  2. #2
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well are you trying to see if the inventory is full with any item or just willows or what? Elaborate more please .

  3. #3
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    umm anything, if IsFull begin BankWalk

    T~M

    EDIT: its a willow chopper

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if InvFull then blah...
    ?

  5. #5
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    SCAR Code:
    if InvFull then blah...
    ?
    yeh, that kinda thing, but do i need to keep WillowAmount or do i delete or what lol, im hurting im confused and tired :O

    T~M

  6. #6
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol I am tired also but I am on my ipod right now. You should keep the count function and just set the logscut var or whatever to it and then leave to bank when inventory is full.
    Last edited by Da 0wner; 05-15-2009 at 03:54 PM. Reason: Grammar, on iPod lol.

  7. #7
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    LOL does anyone wanna make it for me ? :P
    If not can someone come on msn and tell me wha to do
    Msn: Destiful@hotmail.co.uk

    T~M

  8. #8
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    SCAR Code:
    function CountItemDTM(DTM: Integer): Integer;
    var
      i, x, y: Integer;
      TB: Tbox;
    begin
      GameTab(4);
      for i := 1 to 28 do
      begin
        TB := InvBox(i);
        if ExistsItem(i) then
          if FindDTM(DTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
            Inc(Result);
      end;
    end;

    Use as

    Logs := CountItemDTM('Willow_Logs');
    etc.

  9. #9
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    ItemAmount('inv', 'dtm', DTMVAR, []);

  10. #10
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Wait so i put the function that bobbohobbo wrote into my script or is it in SRL?
    also
    Logs := CountItemDTM('Willow_Logs');
    do i rename with my dtm?
    and da 0wner what is yours?

    T~M

  11. #11
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The one I have is in SRL.
    SRL/SRL/Core/Amount.scar

    For area you can use 'inv', 'shop', 'bank', trade', or 'your trade'.
    For ItemType you can use 'dtm', 'bmp', 'color', 'bmpmask'.
    And for item you use the value of your bitmap/color/DTM.
    For tol you use [] if you are using a DTM and you use [tol] if you are using bitmaps for the tolerance of the bitmap. You use [colortol, mincount] for colors. And for masks you use [bmptol, countourtol].

  12. #12
    Join Date
    Feb 2009
    Location
    Philipines
    Posts
    600
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You put the function that BobboHobbo made in your script, and I think this is how you use it:

    SCAR Code:
    function CountItemDTM(DTM: Integer): Integer;
    var
      i, x, y: Integer;
      TB: Tbox;
    begin
      GameTab(4);
      for i := 1 to 28 do
      begin
        TB := InvBox(i);
        if ExistsItem(i) then
          if FindDTM(DTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
            Inc(Result);
      end;
    end;

    procedure lol;
    var
      Logs, TotalLogs: Integer;
    begin
     Logs := DTMFromString('78DA63DCC8C4C0F08A010D30229140FA2450C' +
             'D4D026AB601D5DC25A0E61450CD23026ACE01D5BC26A0663750CD' +
             '47FC6A00BF630A00');
     TotalLogs := CountDTM(Logs);
     Inc(TotalLogs);
    end;

  13. #13
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    We got it working <3
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

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
  •