Results 1 to 11 of 11

Thread: Calling something in a script?

  1. #1
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Question Calling something in a script?

    Hi, I have been posting a lot of threads just to learn to script. Somewhere in the script I want to call up something by going through this:

    SCAR Code:
    Integers[1] := LBOW_YEW

    A LBOW represents a longbow and a SBOW represents a shortbow. Well in the cutting in my Fletcher script I want it to click shortbow if SBOW is in the integers[1] line. Well I have no idea how to do that. So for example 1 more time if the Integers[1] was SBOW_WILLOW then I want in the cutting procedure to see if that is there and if it is it will do another procedure if it doesn't then I want it to carry on with the rest of the procedure.

  2. #2
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    dont use an integer, use an array of string.

    like:

    Code:
    strings[0]:= 'LBOW_YEW';
    
    if (strings[0]= 'LBOW_YEW') then
    begin
      * do the procedure which clicks on the yew longbow button *
    end;
    edit: or...

    Code:
    strings[0]:= '';
    
    case strings[0] of 
      'LBOW_YEW':
      begin
      end;
      'SBOW_YEW':
      begin
      end;
    end;
    Last edited by x[Warrior]x3500; 07-15-2010 at 01:42 AM.

  3. #3
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by x[Warrior]x3500 View Post
    dont use an integer, use an array of string.

    like:

    Code:
    strings[0]:= 'LBOW_YEW';
    
    if (strings[0]= 'LBOW_YEW') then
    begin
      * do the procedure which clicks on the yew longbow button *
    end;
    edit: or...

    Code:
    strings[0]:= '';
    
    case strings[0] of 
      'LBOW_YEW':
      begin
      end;
      'SBOW_YEW':
      begin
      end;
    end;
    But but but... I already got my DTMs and everything set up with intergers?

  4. #4
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by x[Warrior]x3500 View Post
    dont use an integer, use an array of string.

    like:

    Code:
    strings[0]:= 'LBOW_YEW';
    
    if (strings[0]= 'LBOW_YEW') then
    begin
      * do the procedure which clicks on the yew longbow button *
    end;
    edit: or...

    Code:
    strings[0]:= '';
    
    case strings[0] of 
      'LBOW_YEW':
      begin
      end;
      'SBOW_YEW':
      begin
      end;
    end;
    The integers are pointers to DTMs in array.
    There used to be something meaningful here.

  5. #5
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    The integers are pointers to DTMs in array.
    That is what I said but in different terms. Can't I just you Inttostr.
    Last edited by ffcfoo; 07-15-2010 at 02:02 AM.

  6. #6
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    The integers are pointers to DTMs in array.
    ahh well nothing was said about dtms, so that is why i said to use stings

    so you want to declare a certain type of bow? then if that bow is found, (during the cutting procedures) it will select it? else, it will continue to find the other bows?
    Last edited by x[Warrior]x3500; 07-15-2010 at 02:34 AM.

  7. #7
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by x[Warrior]x3500 View Post
    ahh well nothing was said about dtms, so that is why i said to use stings

    so you want to declare a certain type of bow? then if that bow is found, (during the cutting procedures) it will select it? else, it will continue to find the other bows?
    That is what I want to do.

  8. #8
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Code:
    Integers[1] := LBOW_YEW;
    Integers[2] := LBOW_WILLOW;
    Integers[0] := SBOW_YEW;
    
      for  i:= 0 to 2  do
      begin
        if FindDtm(integers[i]...) then
        begin
         ....
         exit;
        end;
        inc i;
      end;
    ?

  9. #9
    Join Date
    Jan 2009
    Location
    Tacoma,Wa
    Posts
    338
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by x[Warrior]x3500 View Post
    Code:
    Integers[1] := LBOW_YEW;
    Integers[2] := LBOW_WILLOW;
    Integers[0] := SBOW_YEW;
    
      for  i:= 0 to 2  do
      begin
        if FindDtm(integers[i]...) then
        begin
         ....
         exit;
        end;
        inc i;
      end;
    ?
    What the? Why 3 Integers? Why DTM? Im not trying to find a dtm. I just want to let this procedure know to cut long bows or shortbows.

  10. #10
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by ffcfoo View Post
    What the? Why 3 Integers? Why DTM? Im not trying to find a dtm. I just want to let this procedure know to cut long bows or shortbows.
    why 3 ints: it was an example. u can hav as many as u want
    why dtm: because that is what you guys are suddenly tlking about. XD maybe i am just confused.

    do you want to use the integer as a constant? if so, you could just say " if integers[0]= --- then [insert code to choose the bow] " . but this would be far too much like my initial comment, and apparently that was wrong

    so sry if i can not help. apparently i can not exactly grasp what you want to accomplish.


    PS - what my script did was go through each dtm (and try to find it) and if it found it, then (add a mouse() it would select it and exit. else, it would move onto the next dtm and try to find it

  11. #11
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can MSN me up, I'll walk you through the most efficient and easiest way of doing what you're trying to do
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

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
  •