Results 1 to 3 of 3

Thread: Help with SCAR math

  1. #1
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default Help with SCAR math

    how would I multiply one variable by antoher variable, and then take that and print it when an fkey is pressed?... Thanks.

    Cus I want a user to put in a number of items, and then how much they want to sell them for. then I want to multiply those variables, and output that to a string. Then, when a user specified Kkey is pressed, I want that printed out to RS...


    Well, how do i multiply variables, how do I put the product in a string, and how do I print that string to RS when an Fkey is pressed...

    Remember, I only want the commands to perform the actions, not the "coded" full version.


    Also, if you help me on the above, can you please tell me the Logic operators.
    Like THESE

  2. #2
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    PHP Code:
    program New;

    Var
      
    Var1Var2String;

    begin
      Var1 
    := '10';
      
    Var2 := '20';
      
    Writeln(IntToStr(StrToIntDef(Var10)*StrToIntDef(Var20)));
    end
    Theres an example for you
    there is no real command to do it, its just a maths function you do
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  3. #3
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Thank you! Thank you! Thank you!

    Now, if someone can tell me how to use


    ScarScript:
    (IntToStr(StrToIntDef(Var1, 0)*StrToIntDef(Var2, 0)))


    to make a value for a variable, or in otherwords, make a variable hold the value of the product.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Error ;'( in Math.Scar...
    By Richie_S in forum OSR Help
    Replies: 4
    Last Post: 10-31-2008, 01:04 AM

Posting Permissions

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