Results 1 to 5 of 5

Thread: Questions about scripting

  1. #1
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Questions about scripting

    One step is to set your inventory constants and then I'm trying to write a procedure that logs you out if you have set more than 25 items(3 standard and 25 user defined).


    Simba Code:
    procedure VerifyBankInv;
    begin
      var i: integer;
      i:= (OVL + Pray_Restore + Pray_Pot + Pouch + Food)
      if (i >25) then
      begin writeln('Verify your bank settings.');
        logout;
      end else
      begin
        exit;
      end;
    end;

    where

    Simba Code:
    const
      OVL           = 0;           //# of OVL to withdraw
      Pray_Restore  = 0;           //# of Pray Restore to withdraw
      Pray_Pot      = 0;           //# of Pray Pot to withdraw
      Pouch         = 0;           //# of Pouch to withdraw
      Food          = 0;           //# of Fish to withdraw

    is declared earlier.

    The error I'm getting is:

    Code:
    [Error] (97:3): Identifier expected at line 96
    What I think is wrong: I have a feeling my syntax to add constants is incorrect but not sure where to find information on basic operators/ operations.

    What I've tried to do: I checked through a few scripts to view how constants are added and was unable to locate any good examples, I also searched the forums for :"operators" , "adding constants" and searched google for "operators in scar/ simba."


    Thank you for any help.
    Last edited by catlover444; 04-29-2012 at 06:39 PM.

  2. #2
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Simba Code:
    procedure VerifyBankInv;
    var
      i: integer; //moved
    begin
      i:= (OVL + Pray_Restore + Pray_Pot + Pouch + Food); //added ;
      if (i >25) then
      begin writeln('Verify your bank settings.');
        logout;
      end else
      begin
        exit;
      end;
    end;
    Working on: Tithe Farmer

  3. #3
    Join Date
    Feb 2012
    Location
    SRL Jail
    Posts
    1,319
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what is line 96, 97, 95
    EDIT: ninjad

  4. #4
    Join Date
    Apr 2012
    Posts
    32
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Moved this to first scripts.
    Last edited by catlover444; 05-07-2012 at 06:19 AM.

  5. #5
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    Simba Code:
    procedure VerifyBankInv;
    var
      i: integer; //moved
    begin
      i:= (OVL + Pray_Restore + Pray_Pot + Pouch + Food); //added ;
      if (i >25) then
      begin writeln('Verify your bank settings.');
        logout;
      end else
      begin
        exit;
      end;
    end;
    Simba Code:
    procedure VerifyBankInv;
    var
      I : Integer;

    begin
      I:= (OVL + Pray_Restore + Pray_Pot + Pouch + Food);
      if (I > 25) then
      begin
        WriteLn('Verify your bank settings.');
        Logout;
      end else
        Exit;
    end;
    Standards
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

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
  •