SRL Archive - Help

Calling something in a script?


ffcfoo

2010-07-14 21:32:29

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:

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.

x[Warrior]x3500

2010-07-14 21:38:17

dont use an integer, use an array of string.

like:



strings[0]:= 'LBOW_YEW';

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

edit: or…



strings[0]:= '';

case strings[0] of
'LBOW_YEW':
begin
end;
'SBOW_YEW':
begin
end;
end;


ffcfoo

2010-07-14 21:54:57

From: x[Warrior]x3500
dont use an integer, use an array of string.

like:



strings[0]:= 'LBOW_YEW';

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

edit: or…



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?

Frement

2010-07-14 21:55:54

From: x[Warrior]x3500
dont use an integer, use an array of string.

like:



strings[0]:= 'LBOW_YEW';

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

edit: or…



strings[0]:= '';

case strings[0] of
'LBOW_YEW':
begin
end;
'SBOW_YEW':
begin
end;
end;



The integers are pointers to DTMs in array.

ffcfoo

2010-07-14 21:59:19

From: Frement
The integers are pointers to DTMs in array.


That is what I said but in different terms. Can't I just you Inttostr.

x[Warrior]x3500

2010-07-14 22:31:59

From: Frement
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?

ffcfoo

2010-07-14 22:35:48

From: x[Warrior]x3500
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.

x[Warrior]x3500

2010-07-14 22:43:24



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;


?

ffcfoo

2010-07-14 23:38:40

From: x[Warrior]x3500


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.

x[Warrior]x3500

2010-07-15 00:18:09

From: ffcfoo
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

Cigue

2010-07-15 00:23:19

You can MSN me up, I'll walk you through the most efficient and easiest way of doing what you're trying to do :)