Results 1 to 7 of 7

Thread: Is there a random inventory slot function?

  1. #1
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default Is there a random inventory slot function?

    Basically, as an antiban I want my script to randomize which inventory slot to use for depositing. What I have now is a simple case procedure to randomize which slot it uses to deposit the items, but I feel like using hard coordinates has a safer alternative. Is there a function/procedure that can do this?

    Simba Code:
    Case (random(5)) of

          0: Mouse(660, 229, 4, 4, false);
          1: Mouse(576, 265, 4, 4, false);
          2: Mouse(619, 265, 4, 4, false);
          3: Mouse(576, 301, 4, 4, false);
          4: Mouse(618, 301, 4, 4, false);


    Thanks.

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    I would use:

    Simba Code:
    MouseItem(Random(28), False);
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  3. #3
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Which slots would you like it to randomly go to?
    Hard cores are fine as long as the rx,ry are large enough. 4,4 seems fine you can even make them like 7,7, and be good.

  4. #4
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Thanks.
    Can it do something like this to randomly click one slot from a set of integers?

    MouseItem([3, 5, 6, 9, 10], False);


    I want it to randomly choose a slot that is slot number 3, 5, 6, 9, or 10.

  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    That will not work, but you can make an array called like RandomSlots, and choose from those.

    Something like
    Simba Code:
    Var RandomSlots: Array Of Integer;  

    SetArrayLegnth(RandomSlots, 5);
    RandomSlots:=[3, 5, 6, 9, 10_;
    MouseItem(RandomSlots[Random(5)], False);

    ^Ghetto fake example code.

  6. #6
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Oh, didn't know you wanted that This could do it:

    Simba Code:
    var
      items : TIntegerArray;

    items := [3, 5, 6, 9, 10];
    MouseItem(items[Random(High(items))], False);
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  7. #7
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Oh, didn't know you wanted that This could do it:

    Simba Code:
    var
      items : TIntegerArray;

    items := [3, 5, 6, 9, 10];
    MouseItem(items[Random(High(items))], False);
    Hmm okay thanks I'll try 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
  •