SRL Archive - OSR Help

How to add to an integer/extended.


RSisDead

2012-06-18 10:44:31

So this is my first project using SRL, and i've got to say, so far i'm doing pretty well. The only problem is i'm familiar with C++ so when i don't know what i'm doing, I do it like it is in C++. So i'm writing an alching script, and i'm trying to get the script to terminate after a predetermined number of alchs. so i have Const
NUMBER_OF_ALCHs =X;

then i have
Var
Alch_Count :extended;
So i'm trying to add one to Alch_Count after each Alch, and then when NUMBER_OF_ALCHS = Alch_Count i want it to terminate. But, when i try to add to Alch_Count with this
wait(randomrange(1000, 1200));
Mouse(571, 375, 2, 2, true);
wait(randomrange(1000, 1200));
Mouse(611, 226, 2, 2, true);
Alch_Count :+1;
wait(randomrange(1000, 1200));
Mouse(565, 377, 2, 2, true);

but it gives me an error and doesn't add to the variable…
Any help is appreciated, Thanks.

riwu

2012-06-18 10:47:15

Alch_Count:=Alch_Count+1;
OR
Inc(Alch_Count);

Also u can just define it as Integer (uses slightly lower memory/faster than extended i believe)

RSisDead

2012-06-18 10:50:17

From: riwu
Alch_Count:=Alch_Count+1;
OR
Inc(Alch_Count);

Also u can just define it as Integer (uses slightly lower memory/faster than extended i believe)


Yeah i was going to use an Int, but the beginners tut. led me to believe that ints don't handle large numbers. It made it look like ints were like -10/10 scale, whereas the extended, or in C they are called LongInts, were used for larger number ex -999999/999999.

litoris

2012-06-18 10:54:05

From: RSisDead
Yeah i was going to use an Int, but the beginners tut. led me to believe that ints don't handle large numbers. It made it look like ints were like -10/10 scale, whereas the extended, or in C they are called LongInts, were used for larger number ex -999999/999999.


There are LongInts in pascal too.

riwu

2012-06-18 22:49:50

From: RSisDead
Yeah i was going to use an Int, but the beginners tut. led me to believe that ints don't handle large numbers. It made it look like ints were like -10/10 scale, whereas the extended, or in C they are called LongInts, were used for larger number ex -999999/999999.

Extended are for decimal (float) no. (eg 1.234), integer can hold non-decimal numbers from -(2^32/2) to +(2^32/2) which is sufficient to hold almost any sort of RS counting (other than suomi and the like's total xp).
Not really much of a problem to use extended (even when u can use integer) though.