Log in

View Full Version : Greater than or equal in variables/constants?



purple37
03-31-2007, 03:04 AM
So i have a script that buys runes that im making it stop buying at a certain price or higher

here is the script
Procedure ElementalCheck;
Begin
ElementalPrice:= ElementalRunePrice;
Wait(500 + Random(500));
if IsText('costs ' + IntToStr(ElementalPrice))then
Writeln('Elemental rune: the price is over ' + IntToStr(ElementalPrice))
Wait(20000 + Random(15000))
else
Wait(500 + Random(500));
end;

OK - i have now realized i need to use StrToInt function but the question now is - Where?

i have ElementalPrice declared as an integer earlier in the script and ElementalRunePrice is a constant (that is an integer)
so i want to make it so that if it finds the ElementalPrice in the chatbox after pressing value on the rune it wont buy that or if the price is any higher than the ElementalRunePrice

Thank You

nielsie95
03-31-2007, 08:43 AM
I hope this is what you mean:


procedure checkprices;
var i: integer;
begin
for i := 10 to 20 do //10 is price 1, 20 price 2, It's looking between these 2
if InChat ('costs '+IntToStr(i)) then
begin
PriceYouAreLookingFor := i; //declare this as a global variable if you want the price anywhere else in your script.
WriteLn('The Price was '+IntToStr(PriceYouAreLookingFor));
Break;
end
end;
end;


I'm not sure if it works, just made this in 1 min :p..
But it's a start, you can improve it. :)