Results 1 to 6 of 6

Thread: Two quick questions: variables and withdraw(); function

  1. #1
    Join Date
    Sep 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Two quick questions: variables and withdraw(); function

    What is the correct way to compare a variable to itself? (As in):

    SCAR Code:
    if variable=variable then
      begin
        //do something
      end else
      begin
        //do something else
      end;
    end;


    I tried that and it didn't work... I also tried "variable==variable"...

    Next question, in the Withdraw(Col, Row, Amount: Integer); function, what do you do if you want to withdraw all? (or maybe there's a different function all together?) I ask because it's a little suspicious if you withdraw "20" by typing it in every time, when you could just click the "withdraw-20" function that pops up after typing it in once...

    EDIT: I know you can just move the mouse to the item you want, right click and use the "ChooseOption" function, but I'm wondering if there's an easier way...
    Thanks
    -Macros

  2. #2
    Join Date
    Apr 2007
    Location
    Laguna Beach, California
    Posts
    231
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    it depends on the variable
    for strings : if ("string 1" = "string 2") (and case matters)
    for all others simple : if (var1 = var2)

    for withdraw all set amount equal to 0
    Check out my SVC - here - It got me a scipters cup

  3. #3
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    For comparing a variable to itself, wouldn't it be easier just to use true, since a variable (should) always equal itself?

  4. #4
    Join Date
    Sep 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol whoops, that was a really stupid mistake with the variables, thanks!

  5. #5
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Do this:

    Withdraw(1, 1, 20+random(20));

    That should work. Back to watching Supernova.

  6. #6
    Join Date
    Apr 2007
    Location
    Laguna Beach, California
    Posts
    231
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    @Sand Storm
    No that doesnt work... it can still be less than 28 which is what he wants... 0 for the amount withdraws all. And he said he already solved it... read the thread dude
    Check out my SVC - here - It got me a scipters cup

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Two Quick Questions
    By sex° in forum News and General
    Replies: 2
    Last Post: 06-10-2008, 02:51 AM
  2. 2 Quick Questions
    By StrikerX in forum SRL Site Discussion
    Replies: 8
    Last Post: 04-21-2008, 07:39 AM
  3. Function and Procedure 'variables'.
    By Wizzup? in forum OSR Advanced Scripting Tutorials
    Replies: 11
    Last Post: 03-27-2008, 03:07 AM
  4. what is the withdraw function, to withdraw X
    By ummmmm0k in forum OSR Help
    Replies: 3
    Last Post: 01-21-2008, 07:52 AM
  5. Function Return variables? How?
    By kodeejs in forum OSR Help
    Replies: 14
    Last Post: 08-19-2007, 02:10 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
  •