Results 1 to 5 of 5

Thread: How to add to an integer/extended.

  1. #1
    Join Date
    Jun 2012
    Posts
    42
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How to add to an integer/extended.

    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
    Code:
    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.

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    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)

  3. #3
    Join Date
    Jun 2012
    Posts
    42
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    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.

  4. #4
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    Quote Originally Posted by RSisDead View Post
    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.
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  5. #5
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by RSisDead View Post
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •