Results 1 to 23 of 23

Thread: Combining Scripts

  1. #1
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Combining Scripts

    Hey everyone,
    I am thinking about combing my Cutter and Stringer into one script.
    But, I am kind of stuck on where to start. There are many ways to do it,
    but I was wondering if any of you could help me out. If you could help me come up with good/easy way to combine my two scripts.

    Viper Cutter
    and
    Viper Stringer

    Thanks to everyone who helps.
    Will Rep++

    Edit: If you want you can add me on Msn, Just click on the button under my post count
    Edit: Read Last Post plz.
    Last edited by Mystic; 05-26-2009 at 06:43 AM.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  2. #2
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    add em together, then add a string/boolean or something in declare players where each player can choose which (string or cut) feature it wants to use. Have two separate mainloops, and a case statement that corresponds to the users choice something like....

    SCAR Code:
    procedure DeclarePlayers;
      //add the other stuff here
      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Booleans[0] := True; // True = String, False = Cut;
      //other stuff down here
    end;

    Procedure ChooseLoop;
    begin
      if Players[CurrentPlayer].Booleans[0] then MainloopA else MainloopB;
    end;

    or

    Procedure ChooseLoop;
    begin
      case Lowercase(Players[CurrentPlayer].Strings[0]) of
        'stringer': MainloopA;
        'cutter': MainLoopB;
      end;
    end;
    “Ignorance, the root and the stem of every evil.”

  3. #3
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    add em together, then add a string/boolean or something in declare players where each player can choose which (string or cut) feature it wants to use. Have two separate mainloops, and a case statement that corresponds to the users choice something like....

    SCAR Code:
    procedure DeclarePlayers;
      //add the other stuff here
      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Booleans[0] := True; // True = String, False = Cut;
      //other stuff down here
    end;

    Procedure ChooseLoop;
    begin
      if Players[CurrentPlayer].Booleans[0] then MainloopA else MainloopB;
    end;

    or

    Procedure ChooseLoop;
    begin
      case Lowercase(Players[CurrentPlayer].Strings[0]) of
        'stringer': MainloopA;
        'cutter': MainLoopB;
      end;
    end;
    Ohh, I see, Thanks for your help.
    I will try it out, and tell you how it works.
    Rep++

    Edit: How would I have It able do both, (Ex. Once it finishes Cutting then It will String.)
    Maybe I could add another boolean? Or maybe add a Constant?
    Thanks For all your help!
    Last edited by Mystic; 05-25-2009 at 01:39 PM.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well in MainloopB, you can check at the end of it to see if one of the booleans is true, then perform the MainloopA and vice versa.

  5. #5
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm.. I was just going to add a string.
    'cut' , 'string' ,or 'both'.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  6. #6
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Do that then, and just do case
    SCAR Code:
    case Players[CurrentPlayer].Strings[0] of
      'both':
      begin
        mainloopa;
        mainloopb;
      end;
    end;

  7. #7
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I put mine as
    SCAR Code:
    Procedure ChooseLoop;
    begin
      case Lowercase(Players[CurrentPlayer].Strings[2]) of
        'cut': MainLoopA;
        'string': MainLoopB;
        'both': MainLoopC;
      end;
    end;

    I'm going to make a third loop, it will be easier for me to understand/script.
    Thanks! Repp++
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  8. #8
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    havent u already released both them scripts r u gonna be closing them threads?

  9. #9
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea, I released both of the scripts, But to make it easier for everyone, I am Combing them all into One Big Script. Once I see that it works, I will be closing the other 2 threads, and putting up a new thread with the "One Big Script".

    Edit: So far so good.
    Edit: Successfully Compiled. Time to test it out.
    If you can test this script for me then please pm me or msg me on Msn.
    Thanks!!!!!!
    Last edited by Mystic; 05-25-2009 at 04:32 PM.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  10. #10
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey everyone i'm back. My script seems to be working fine, but it still messes up. I think that everything is right. What it does is when it starts cutting, it will try to start cutting/ stringing again, and the load is not even done. The individual scripts work fine. But when I combine them i just can't seem to get them to work.
    If anyone could take a quick look at my script and help me solve this problem would be GREATLY appreciated. Repp++ and Credited
    Thanks everyone!!

    EDIT: Posted new script on last post.
    Last edited by Mystic; 05-26-2009 at 10:21 AM.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  11. #11
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    few things, first

    SCAR Code:
    if(Players[CurrentPlayer].Strings[2] = 'cut')then
          MainLoopA;
          if(Players[CurrentPlayer].Strings[2] = 'string')then
          MainLoopB;
          if(Players[CurrentPlayer].Strings[2] = 'both')then
          MainLoopC;

    what if someone types 'String' or 'STrinGs'? then your screwed, so wrap the PlayersCurrentPlayer.Strings[2] in a Lowercase() which makes the input no matter what, in all lowercase.

    Use a case statement for that, it would look nicer (I swear).

    Now, the error your recieveing seems to me like something specific in the script, not the new mainloops themselves. Either: Your dtm is off, or you should increase the max wait time or something? I'll keep looking and edit if i find something.
    “Ignorance, the root and the stem of every evil.”

  12. #12
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Mmk thanks Bumblebee. If anyone wants to test/edit it feel free to
    Hope to hear from you soon. Thank you!

    Edit: ?
    SCAR Code:
    Procedure ChooseLoop;
    begin
      case Lowercase(Players[CurrentPlayer].Strings[2]) of
        'cut': MainLoopA;
        'string': MainLoopB;
        'both': MainLoopC;
      end;
    end;
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  13. #13
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    SCAR Code:
    Procedure ChooseLoop;
    begin
      case Lowercase(Players[CurrentPlayer].Strings[2]) of
        'cut': MainLoopA;
        'string': MainLoopB;
        'both': MainLoopC;
        else
        begin
          Writeln('You''re an idiot.');
          TerminateScript;
        end;
      end;
    end;
    It's always good coding technique to cover every possibility for error in human interaction.

  14. #14
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lmao! Added, but still looking for a fix on my dumb script
    Anyways. Thanks
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  15. #15
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What do you need fixed?

  16. #16
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, when I run the script, It does everything correctly, but while it is cutting its first load it is not even finished and tries to start cutting a new load. Idk, it's weird, everything looks right, but its not working like i want it to .
    If you really need I can post a video, just ask me.
    Thanks! Will Rep++ everyone who helps!

    By downloading this script you agree to not post it anywhere except this thread.
    Also you agree to not steal it and call it your own.
    Thank you.
    Last edited by Mystic; 05-28-2009 at 01:07 PM.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  17. #17
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No?
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  18. #18
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Are you minimizing smart?
    Try to just leave it at the front.
    It could be that the script is losing focus.

    T~M

  19. #19
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm not minimizing smart, as I need to see what it does. Idk what's wrong, everything looks right...
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  20. #20
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey bro

    I've added some failsafes for you to see why its doing that, also I've noticed a few mistypes perhaps? Such as when checking for dtm count in inventory, it should be 27 not 28 right? Cuz you are carrying a knife and knife will take up that one spot I've added the failsafe on the time limit, maybe its doing that because its been past 2 minutes while cutting :P



    ~NS

  21. #21
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    If it doesn't work correctly, i suggest you to use the old functions but write the mainloop again, like
    SCAR Code:
    procedure MainLoop;
    begin
      repeat
        Cut;
        if players[currentplayer].booleans[?] then
          Fletch
        else
          DropLogs;
      until(something);
    end;

  22. #22
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Not to advertise, but check out my script for some ideas on doding it.

    Its not too hard.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  23. #23
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Mmk thanks nadeem, marpis, Nava2 <3
    I will check it out very soon. Rep++
    [offtopic]Btw nice avvy Nava2 [/offtopic]
    Last edited by Mystic; 05-27-2009 at 07:13 AM.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

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
  •