Results 1 to 4 of 4

Thread: Amount error

  1. #1
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    423
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Amount error

    Hey, Im trying to get the amount of something as an integer so i can use it not just
    if amount(ji-go,1) > 2 then..... like everyone else seems to use it as.

    this is what Ive got

    SCAR Code:
    Procedure SetUpScript;
    begin
     SetupSRL;
     CashStart:=0;
     ChaosStart:=0;
     DeathStart:=0;
     CashStart : = (Amount('inv',1));
     ChaosStart: = (Amount('inv',2));
     DeathStart: = (Amount('inv',3));
    end;

    but it keeps giving me an error.
    Failed when compiling
    Line 17: [Error] (15042:11): Assignment expected in script

    Does anyone know whats wrong? its probly a stupid error because I havnt scripted for ages. Cheers

  2. #2
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Do not add spaces between ":" and "="
    Also you dont need:
    SCAR Code:
    CashStart:=0;
     ChaosStart:=0;
     DeathStart:=0;
    Becasue you set the value to them after those three lines, lol.

  3. #3
    Join Date
    Nov 2006
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    SCAR Code:
    {.include srl/srl.scar}
    {.include srl/srl/misc/amount.scar}
    var
    cashstart, chaosstart, deathstart : integer;
    Procedure SetUpScript;
    begin
     SetupSRL;
     CashStart:=0;
     ChaosStart:=0;
     DeathStart:=0;
     CashStart := Amount('inv',1);
     ChaosStart := Amount('inv',2);
     DeathStart := Amount('inv',3);
    end;

    begin
    setupscript;
    end.
    works for me...
    Infractions, reputation, reflection, the dark side of scripting, they are.

  4. #4
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    423
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Cool thanks guys, I thought it would be something dumb like that.

    @ Pentti I put that there and the brackets and stuff because I was trying random things to get it to work.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need help with- getting an amount
    By yanix123 in forum OSR Help
    Replies: 2
    Last Post: 12-30-2007, 11:01 PM
  2. get run amount
    By jhildy in forum OSR Help
    Replies: 1
    Last Post: 06-04-2007, 09:17 PM

Posting Permissions

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