Results 1 to 5 of 5

Thread: Help with multiple road colors

  1. #1
    Join Date
    Mar 2010
    Posts
    152
    Mentioned
    1 Post(s)
    Quoted
    56 Post(s)

    Default Help with multiple road colors

    Hi, i'm very new to writing scripts but have been using them for a while. Basically i am using RadialRoadWalking to navigate the map

    and of course as you all know the colors are constantly changing, I've accumulated a list of the various color integers and now need

    to know how i can call upon the RadialRoadWalking function to distinguish between which is needed etc.

    I've seen a lot of people using autocolor functions but i cant seem to get my head around it all. Can anyone help?

    EDIT: To further explain myself, at present my function reads as follows;

    const

    RoadA = 45464654;
    RoadB = 54848484;

    begin
    RadialRoadWalk(RoadA,160,200,49,50,50)
    RadialRoadWalk(RoadB,160,200,49,50,50)

    But i would like my script to be more like

    const

    RoadA = 45464654, 485485, 8484854, 8485454;
    RoadB = 54848484, 7848484, 8484848, 848484;

    begin
    RadialRoadWalk(RoadA,160,200,49,50,50)
    RadialRoadWalk(RoadB,160,200,49,50,50)

    How would i make it search all possibilities of RoadA and then click to one if its available?
    Last edited by GREEN GIANT; 07-02-2013 at 10:27 PM.

  2. #2
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by GREEN GIANT View Post
    /clear
    You'd put all the colors into an integer array and loop through it I guess.

    Simba Code:
    var
     RoadA:TIntArray;
     i:integer;
    RoadA := numbers
    for i := 0 to High(RoadA) do
    begin
       if(RadialRoadWalk(RoadA[i],x1,y1,x2,y2)) then
         //code here
    end;

    Typed that out here, dunno if it's 100% correct

  3. #3
    Join Date
    Mar 2010
    Posts
    152
    Mentioned
    1 Post(s)
    Quoted
    56 Post(s)

    Default

    Hi thanks for the help but i still cant get it work Can you see the problem with the following code;

    program New;
    {$DEFINE SMART8}
    {$i SRL-OSR\SRL.Simba}

    var
    RoadAArray:TIntegerArray;
    i:Integer;

    begin
    setupsrl;
    setlength(RoadAArray,7);
    RoadAArray[0] :=5000276;
    RoadAArray[1] :=6776687;
    RoadAArray[2] :=6974065;
    RoadAArray[3] :=7105652;
    RoadAArray[4] :=7171702;
    RoadAArray[5] :=7105908;
    RoadAArray[6] :=7171958;

    for i := Low(RoadAArray) to High(RoadAArray) do
    writeLn(ToStr(RoadAArray[i]));

    makecompass('N')
    RadialRoadWalk(RoadAArray[i],160,200,49,50,50) @@at present its say im out of range on this line
    end.

  4. #4
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by GREEN GIANT View Post
    Hi thanks for the help but i still cant get it work Can you see the problem with the following code;

    program New;
    {$DEFINE SMART8}
    {$i SRL-OSR\SRL.Simba}

    var
    RoadAArray:TIntegerArray;
    i:Integer;

    begin
    setupsrl;
    setlength(RoadAArray,7);
    RoadAArray[0] :=5000276;
    RoadAArray[1] :=6776687;
    RoadAArray[2] :=6974065;
    RoadAArray[3] :=7105652;
    RoadAArray[4] :=7171702;
    RoadAArray[5] :=7105908;
    RoadAArray[6] :=7171958;

    for i := Low(RoadAArray) to High(RoadAArray) do
    writeLn(ToStr(RoadAArray[i]));

    makecompass('N')
    RadialRoadWalk(RoadAArray[i],160,200,49,50,50) @@at present its say im out of range on this line
    end.
    Try this

    Simba Code:
    program New;
    {$DEFINE SMART8}
    {$i SRL-OSR\SRL.Simba}

    var
    RoadAArray: TIntegerArray;
    i: Integer;

    begin
      setupsrl;
      RoadAArray := [5000276, 6776687, 6974065, 7105652, 7171702, 7105908, 7171958];
      setlength(RoadAArray, Length(RoadAArray));
      for i := Low(RoadAArray) to High(RoadAArray) do
      begin
        writeLn(ToStr(RoadAArray[i]));
        makecompass('N')
        RadialRoadWalk(RoadAArray[i],160,200,49,50,50)
      end;
    end.

  5. #5
    Join Date
    Mar 2010
    Posts
    152
    Mentioned
    1 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Try this

    Simba Code:
    program New;
    {$DEFINE SMART8}
    {$i SRL-OSR\SRL.Simba}

    var
    RoadAArray: TIntegerArray;
    i: Integer;

    begin
      setupsrl;
      RoadAArray := [5000276, 6776687, 6974065, 7105652, 7171702, 7105908, 7171958];
      setlength(RoadAArray, Length(RoadAArray));
      for i := Low(RoadAArray) to High(RoadAArray) do
      begin
        writeLn(ToStr(RoadAArray[i]));
        makecompass('N')
        RadialRoadWalk(RoadAArray[i],160,200,49,50,50)
      end;
    end.
    Worked a charm thank you

    Another question if i may, i now want to repeat the process for a second array (different color path) i've just tried declaring RoadBArray: TIntegerArray; as a second variable and pasted the code below but now it just continuously lists the integers in my chat box without attempting to move.

    So my question is, how do i now stop the initial Radialwalk and start a new one after it with a new set of Arrays.

    EDIT: I kind of got it to work, but any input is greatly appreciated as i'm guessing my method isn't the most efficient.
    Last edited by GREEN GIANT; 07-03-2013 at 12:28 PM.

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
  •