Results 1 to 10 of 10

Thread: Tbox and TpointArray uses?

  1. #1
    Join Date
    Feb 2009
    Location
    inside Hello World! Application
    Posts
    232
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Unhappy Tbox and TpointArray uses?

    so i got these points and want to turn them into boxes but how? i used stand how to use them i dont know how to write it tho

    Simba Code:
    --Slot 3--
    //Buy
    360, 130, 400, 170
    //Sell
    420, 130, 470, 170
    //Bar
    350, 160, 480, 180

    --Slot 4--
    //Buy
    50, 250, 100, 290
    //Sell
    110, 250, 160, 290
    //Bar
    40, 280, 160, 300

    --Slot 5--
    //Buy
    200, 250, 250, 290
    //Sell
    270, 250, 310, 290
    //Bar
    200, 280, 320, 300

    --Slot 6--
    //Buy
    360, 250, 400, 290
    //Sell
    430, 250, 470, 290
    //Bar
    350, 280, 480, 300

    for GE script was wondering how'd u put it into Boxes :/ heres what i came up with and stuck now



    Simba Code:
    program GEboxes;
    {$i srl/srl.scar}
    var
    Slot1, Slot2, Slot3, Slot4, Slot5, Slot6 :TBox;

    Slot3pTl, Slot4pTl, Slot5pTl, Slot6pTl,
    Slot3Br, Slot4Br, Slot5CBr, Slot6Br :TPoint;

    Procedure SetupSlots;
      begin

      //-------------Buying Box--------------\\
      Slot3pTl:=(360,130); //360, 130, 400, 170 < Both Tl and Br
      Slot4pTl:=(50,250);  //50, 250, 100, 290    ^sme
      Slot5pTl:=(200,250); //200, 250, 250, 290   ^sme
      Slot6pTl:=(360,250);  //360, 250, 400, 290  ^sme
     //---------------------------------------\\
      Slot3Br:=(400,170);
      Slot4Br:=(100,290);
      Slot5Br:=(250,290);
      Slot6Br:=(400,290);
    {\\=======================================//}

      Slot3:= PointToBox(Slot3pTL,SLot3Br);
      Slot4:= PointToBox(Slot4pTl,Slot4Br);
      Slot5:= PointToBox(Slot5pTl,Slot5Br);
      Slot6:= PointToBox(Slot6pTl,Slot6Br);

    end;

    Procedure SetupSlots2;
      begin
      var
      SellingBox1, SellingBox2, SellingBox3, SellingBox4,
    SellingBox5, SellingBox6 :TPointArray;

      // Or i think you can do it like this

      //-------------Selling Box--------------\\
       SellingBox1 := [((x,y),(x,y)),((x,y),(x,y))]



    end;

    begin
    SetupSRL;

    end.

    just wanted to help some1 but no idea how to do it >.< also with this i'll probably make a "Sensor" test so if mouse goes into the box then its like "Your mouse is on the Buy Bag" or w.e :/

  2. #2
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    IntToBox().

  3. #3
    Join Date
    Feb 2009
    Location
    inside Hello World! Application
    Posts
    232
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by RISK View Post
    IntToBox().

    >.<

    lawl cheers imma try it out any ideas on the Sensor? maybe like

    Simba Code:
    if(getmouspos(x,y)) then
       begin
       writeln('We are in!')
    end;

    would that work for this type of Box? or


    Simba Code:
    for := 0 to BoxCord.y do //?
    if(Getmousepos(PointInBox(x,Boxcord))) then
    begin
    end;  
    // or something similar :/

  4. #4
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    This is a rough example, but:
    Simba Code:
    procedure Example;
    var
      X, Y: Integer;
      P: TPoint;
      B: TBox;
    begin
      B := IntToBox(100, 150, 100, 200);
      GetMousePos(X, Y);
      P.X := X;
      P.Y := Y;

      if (PointInBox(P, B)) then
        WriteLn('The point is in the box.');
    end;

  5. #5
    Join Date
    Feb 2009
    Location
    inside Hello World! Application
    Posts
    232
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by RISK View Post
    This is a rough example, but:
    Simba Code:
    procedure Example;
    var
      X, Y: Integer;
      P: TPoint;
      B: TBox;
    begin
      B := IntToBox(100, 150, 100, 200);
      GetMousePos(X, Y);
      P.X := X;
      P.Y := Y;

      if (PointInBox(P, B)) then
        WriteLn('The point is in the box.');
    end;

    kk thanks love you gonna make some mad ass boxes

    ps. No homo

    ~bro433

  6. #6
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You're welcome. I'm always happy to help.

  7. #7
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    i like your example but it doesn't write the line...


    I'M trying to learn how to GetMousePos and search from there out but within a Tbox:

    so GetMousePos, Search in Tbox for a color... I believe this is the example i need may i ask you to please Elaborate some more, it would be soo helpful!! Please Thanks

  8. #8
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    There is probably a better way, but:
    Simba Code:
    procedure Example;
    var // These are local variables that are used only in this procedure
      X, Y: Integer;
      P: TPoint;
      B: TBox;
    begin
      B := IntToBox(100, 200, 300, 400); // Defines the box's corners
      GetMousePos(X, Y); // Gets the current mouse position and stores the X and Y values in to the X and Y integers
      P.X := X; // Makes our point's X value to be the integer "X" we got from GetMousePos
      P.Y := Y; // Makes out point's Y value to the be integer "Y" we got from GetMousePos

      if (PointInBox(P, B)) then // If the mouse is in the box do:
        if (FindColor(X, Y, COLOR, B.X1, B.Y1, B.X2, B.Y2)) then // If the color is in the box do:
          WriteLn('Success.'); // Writes the line "Success" in the debug of Simba
    end;

    You should just PM me next time.

  9. #9
    Join Date
    Feb 2009
    Location
    inside Hello World! Application
    Posts
    232
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    also heres what i came up with but gonna change it and instead of listing so many different variables for Buybag,SellBag,ProgressBar i'm just gonna make 1 for each and use;

    Simba Code:
    Case condition of
    end;

    Should work nicely? heres what i have atm make a thread but got no posts -.- just 24views

    heres what i got so far >.<

    Simba Code:
    program GEBoxCheck;
    {$i srl/srl.scar}

    {*******************************************************************************
    Procedure WBPointAt;
    by: Inf3cti0us with help from RISK
    Description:BB# = BuyBag(Slot #) SB# = SellBag(slot #) S#B = Slot(numb #)Bar
    it identifies which Slot you are in and what icon you are on as a test ;)
    *******************************************************************************}

    procedure WBPointAt;
    var
    {// Some Variables which dont need to be touched either \\}
      X, Y: Integer;
      P: TPoint;
      BB1, BB2, BB3, BB4, BB5, BB6,
      SB1, SB2, SB3, SB4, SB5, SB6,
      S1B, S2B, S3B, S4B, S5B, S6B: TBox;

    begin
    {// No Need to change anything to do with these settings they are good \\ }
      BB1 := IntToBox(49, 125, 95, 170);    SB1 := IntToBox(110, 125, 157, 172);
      BB2 := InttoBox(203, 127, 250, 171);  SB2 := IntToBox(266, 127, 313, 171);
      BB3 := IntToBox(360, 130, 400, 170);  SB3 := IntToBox(420, 130, 470, 170);
      BB4 := IntToBox(50, 250, 100, 290);   SB4 := IntToBox(110, 250, 160, 290);
      BB5 := IntToBox(200, 250, 250, 290);  SB5 := IntToBox(270, 250, 310, 290);
      BB6 := IntTobox(360, 250, 400, 290);  SB6 := IntToBox(430, 250, 470, 290);

      S1B := IntToBox(41, 163, 166, 177);
      S2B := IntToBox(197, 163, 322, 177);
      S3B := IntToBox(350, 160, 480, 180);
      S4B := IntToBox(40, 280, 160, 300);
      S5B := IntToBox(200, 280, 320, 300);
      S6B := IntToBox(350, 280, 480, 300);

      GetMousePos(X, Y);
      P.X := X;
      P.Y := Y;

      if (PointInBox(P,BB1)) then  // If you change BB1 to any BB#/SB#/S#B then should change what it does
      begin;
        WriteLn('The point is in the Buying Bag Slot1'); // If you are hovering the Buying bag or w.e it will say this
      //  WriteLn('');
        wait(randomrange(500,700))
       end else
      // WriteLn('');
       writeln('The point is not in the Buying Bag in Slot 1!');// If you arent hovering the Buying bag or w.e it will say this

        if(PointInBox(P,SB1)) then
         begin;
          WriteLn('The point is in the Selling Bag Slot 1'); // If you hover the Selling bag or w.e it will say this
          wait(randomrange(500,700))
       end else

       writeln('The point is not in the Selling Bag in Slot 1!')
    end;

    begin
    SetupSRL;
    ClearDebug;
    wait(randomrange(3000,5000))
    WBPointAt;
    end.
    I'm not a lesser Being imma Lesser demon


    http://i.imgur.com/faGr0.png << First Script With Paint. Good First proggy? exp 21k/hr is ok pretty buggy

  10. #10
    Join Date
    Apr 2007
    Posts
    373
    Mentioned
    2 Post(s)
    Quoted
    24 Post(s)

    Default

    This definetly is very usefull.
    The GE box coord should be implemented in SRL as const imo.

    Good Job
    ~Fre

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
  •