Log in

View Full Version : Calling something in a script?



ffcfoo
07-15-2010, 01:32 AM
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
07-15-2010, 01:38 AM
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
07-15-2010, 01:54 AM
x3500;724129']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
07-15-2010, 01:55 AM
x3500;724129']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
07-15-2010, 01:59 AM
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
07-15-2010, 02:31 AM
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
07-15-2010, 02:35 AM
x3500;724140']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
07-15-2010, 02:43 AM
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
07-15-2010, 03:38 AM
x3500;724144']


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
07-15-2010, 04:18 AM
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
07-15-2010, 04:23 AM
You can MSN me up, I'll walk you through the most efficient and easiest way of doing what you're trying to do :)