Log in

View Full Version : Constants - strings - >=



purple37
03-30-2007, 01:30 AM
ok im making a script where it buys runes and it stops buying runes once the runes cost too much (it does this by reading the value) so sometimes, say the price i put to not buy at is 13 if the price raises to 14 it will start buying again
SO
is there a way in constants to make it do something like
ElementalPrice >= '13';

heres what the part of the script i want to use it in looks like

if istext('costs' + ElementalPrice)then
writeln('The price is over' + ElementalPrice)
else
writeln('10 more runes bought!')

nielsie95
03-30-2007, 10:59 AM
I think you better can use Integers for this. So make ElemantalPrice an Integer and it should work

If you want to use the price in a string you should use IntToStr(..). Like this:

if istext('costs' + IntToStr(ElementalPrice))then
writeln('The price is over' + IntToStr(ElementalPrice))
else
writeln('10 more runes bought!')

XcanadamanX
03-30-2007, 12:03 PM
if istext('costs ' + IntToStr(ElementalPrice))then //add a space after costs
writeln('The price is over' + IntToStr(ElementalPrice)) //so it doesnt look like costs30
else
writeln('10 more runes bought!')

whales
03-30-2007, 12:09 PM
First make a procedure that returns the current price of the runes (I think you may allready have this though). Then create a variable that stores the price of the runes and then use something like if (C>13) then buy more runes, where C is the variable that stores the rune price. Get what I am saying?

purple37
03-30-2007, 10:39 PM
yes thank you
i needed the IntToStr so now it works

i needa remember that :)

and whales i declared the variable in the beginning of the script then later in the script where it should be used i put that ElementalPrice > 13; buy i get an error : assignment expected