Results 1 to 14 of 14

Thread: [P]utonajonnys [I]ncredible [C]ustomisable [S]cript - Preview/Teaser

  1. #1
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default [P]utonajonnys [I]ncredible [C]ustomisable [S]cript - Preview/Teaser

    [P]utonajonnys [I]ncredible [C]ustomisable [S]cript

    Some teaser code for you, try it out, It will bring up the form for you to input your script, if anybody here has ever tried out RIDiverse (or something like that) you may notice some similarities, graphically it looks awful at the moment but I am rubbish at that king of thing, if anybody has any ideas let me know:

    This is an example setup for Superheating Steel.


    New Images:
    I have now added a "printing to string" feature to save actions for later use, together with a reading from string feature, both work well. Importantly you can add strings to the end of each other to increase the length of your actions, e.g if Clicking Item 1 was '0:1:2:3:' and Clicking Item 2 was '4:5:6:7:' then clicking Item 1 then Item 2 is '0:1:2:3:4:5:6:7:'.



    This code needs cleaning up majorly, I learnt most of the stuff I know about forms whilst making this so I may re-write it at some point.
    Simba Code:
    program new;
    {.include SRL/SRL.simba}
    var
      Setup, Fake : TForm;
      Confirm, Cancel, Plus, Minus : TButton;
      Edits : array of array of TEdit;
      InitialLists : array of TListBox;
      Shown : integer;
      SpellLists, WaitLists : array of TComboBox;

    type
      Action = record
        Spell, Select : String;
        ToDo, ItemNumber, Time, Amount, Timeout, OnItem : integer;
        Rep : Boolean;
    end;

    Var
      A : array of Action;

    Procedure ButtonClick(Sender: TObject);
    Var
      i, j : integer;
    begin
      Case Sender of
        Confirm : begin
                    Setup.ModalResult := mrOk;
                    for i := 0 to high(InitialLists) do
                      if(InitialLists[i].Parent = Setup)then
                        inc(j);
                    for i := 0 to j - 1 do
                      begin
                        SetArrayLength(A, GetArrayLength(A) + 1);
                        A[i].ToDo := InitialLists[i].ItemIndex;
                        if(Edits[0][i].Text = '<Item Number>')then
                          A[i].ItemNumber := -1
                        else
                          A[i].ItemNumber := StrToInt(Edits[0][i].Text);
                        A[i].Select := Edits[1][i].Text;
                        if(Edits[2][i].Text = '<Wait Time (msec)>')then
                          A[i].Time := -1
                        else
                          A[i].Time := StrToInt(Edits[2][i].Text);
                        A[i].Spell := SpellLists[i].Text;
                        if(Edits[3][i].Text = '<Amount (0 = all)>')then
                          A[i].Amount := -1
                        else
                          A[i].Amount := StrToInt(Edits[3][i].Text);
                        if(Edits[4][i].Text = '<Timeout (msec)>')then
                          A[i].Timeout := -1
                        else
                          A[i].Timeout := StrToInt(Edits[5][i].Text);
                        if(Edits[5][i].Text = '<On Item (0 = none)>')then
                          A[i].OnItem := -1
                        else
                          A[i].OnItem := StrToInt(Edits[5][i].Text);
                        if(Edits[6][i].Text = '<Repeat Until No More>')then
                          A[i].Rep := False
                        else
                          A[i].Rep := StrToBool(Edits[6][i].Text);
                        WriteLn(IntToStr(i)+':');
                        WriteLn(A[i]);
                      end;
                  end;
        Cancel : begin
                   Setup.ModalResult:= mrOk;
                 end;
        Plus : begin
                 inc(Shown);
                 for i := 0 to high(InitialLists) do
                   if(Shown >= i) then
                     InitialLists[i].Parent := Setup
                   else
                     InitialLists[i].Parent := Fake;
                 end;
        Minus : begin
                   if(Shown > 0)then
                     dec(Shown);
                   for i := 0 to high(InitialLists) do
                     if(Shown >= i) then
                       InitialLists[i].Parent := Setup
                     else
                       begin
                         InitialLists[i].Parent := Fake;
                         Edits[0][i].Parent := Fake;
                         Edits[1][i].Parent := Fake;
                         Edits[2][i].Parent := Fake;
                         SpellLists[i].Parent := Fake;
                       end;
                 end;
      end;
    end;

    Const
      ClickItem_ = 0;
      RClickItem_ = 1;
      CastSpell_ = 2;
      Use_ = 3;
      WaitUntil_ = 4;
      WaitFor_ = 5;
      Withd_ = 6;
      Dep_ = 7;

    Procedure ListClick(Sender: TObject);
    Var
      i, n : integer;
    begin
      for i := 0 to high(InitialLists) do
        if(InitialLists[i] = Sender)then
          n := i;

      Case Sender of
        InitialLists[n] : begin
                            i := InitialLists[n].ITEMINDEX;
                            Case i of
                              ClickItem_ : begin
                                             Edits[0][n].Parent := Setup;
                                             Edits[1][n].Parent := Fake;
                                             Edits[2][n].Parent := Fake;
                                             Edits[3][n].Parent := Fake;
                                             Edits[4][n].Parent := Fake;
                                             Edits[5][n].Parent := Fake;
                                             Edits[6][n].Parent := Fake;
                                             SpellLists[n].Parent := Fake;
                                             WaitLists[n].Parent := Fake;
                                           end;
                              RClickItem_ : begin
                                              Edits[0][n].Parent := Setup;
                                              Edits[1][n].Parent := Setup;
                                              Edits[2][n].Parent := Fake;
                                              Edits[3][n].Parent := Fake;
                                              Edits[4][n].Parent := Fake;
                                              Edits[5][n].Parent := Fake;
                                              Edits[6][n].Parent := Fake;
                                              SpellLists[n].Parent := Fake;
                                              WaitLists[n].Parent := Fake;
                                            end;
                              CastSpell_ : begin
                                             Edits[0][n].Parent := Fake;
                                             Edits[1][n].Parent := Fake;
                                             Edits[2][n].Parent := Fake;
                                             Edits[3][n].Parent := Fake;
                                             Edits[4][n].Parent := Fake;
                                             Edits[5][n].Parent := Setup;
                                             Edits[6][n].Parent := Setup;
                                             SpellLists[n].Parent := Setup;
                                             WaitLists[n].Parent := Fake;
                                           end;
                              Use_ : begin
                                       Edits[0][n].Parent := Setup;
                                       Edits[1][n].Parent := Fake;
                                       Edits[2][n].Parent := Fake;
                                       Edits[3][n].Parent := Fake;
                                       Edits[4][n].Parent := Fake;
                                       Edits[5][n].Parent := Fake;
                                       Edits[6][n].Parent := Fake;
                                       SpellLists[n].Parent := Fake;
                                       WaitLists[n].Parent := Fake;
                                     end;
                              WaitUntil_ : begin
                                             Edits[0][n].Parent := Fake;
                                             Edits[1][n].Parent := Fake;
                                             Edits[2][n].Parent := Fake;
                                             Edits[3][n].Parent := Fake;
                                             Edits[4][n].Parent := Setup;
                                             Edits[5][n].Parent := Fake;
                                             Edits[6][n].Parent := Fake;
                                             SpellLists[n].Parent := Fake;
                                             WaitLists[n].Parent := Setup;
                                           end;
                              WaitFor_ : begin
                                           Edits[0][n].Parent := Fake;
                                           Edits[1][n].Parent := Fake;
                                           Edits[2][n].Parent := Setup;
                                           Edits[3][n].Parent := Fake;
                                           Edits[4][n].Parent := Fake;
                                           Edits[5][n].Parent := Fake;
                                           Edits[6][n].Parent := Fake;
                                           SpellLists[n].Parent := Fake;
                                           WaitLists[n].Parent := Fake;
                                         end;
                              Withd_ : begin
                                         Edits[0][n].Parent := Setup;
                                         Edits[1][n].Parent := Fake;
                                         Edits[2][n].Parent := Fake;
                                         Edits[3][n].Parent := Setup;
                                         Edits[4][n].Parent := Fake;
                                         Edits[5][n].Parent := Fake;
                                         Edits[6][n].Parent := Fake;
                                         SpellLists[n].Parent := Fake;
                                         WaitLists[n].Parent := Fake;
                                       end;
                              Dep_ : begin
                                       Edits[0][n].Parent := Setup;
                                       Edits[1][n].Parent := Fake;
                                       Edits[2][n].Parent := Fake;
                                       Edits[3][n].Parent := Setup;
                                       Edits[4][n].Parent := Fake;
                                       Edits[5][n].Parent := Fake;
                                       Edits[6][n].Parent := Fake;
                                       SpellLists[n].Parent := Fake;
                                       WaitLists[n].Parent := Fake;
                                     end;
                          end;
        end;

      end;
    end;

    Const
      ClickItem = 'Left click item';
      RClickItem = 'Right click item';
      CastSpell = 'Cast spell';
      Use = 'Use item';
      WaitUntil = 'Wait until';
      WaitFor = 'Wait for';
      Withd = 'Withdraw';
      Dep = 'Deposit';

    procedure InitForm;
    Var
      InitialListsString : array of string;
      Title : TLabel;
      i, n, m : integer;
      Prompts, Spells, Waits : array of String;
    begin
      Setup := CreateForm;
      With Setup do
        begin
          Left := 100;
          Top := 100;
          Width := 500;
          Height := 500;
          Caption := 'Script Setup';
          Color := ClWhite;
        end;

      Confirm := TButton.Create(Setup);
      With Confirm do
        begin
          Parent := Setup;
          Left := 285;
          Top := 45;
          Height := 20;
          Width := 100;
          Caption := 'Confirm';
          OnClick := @ButtonClick;
        end;

      Cancel := TButton.Create(Setup);
      With Cancel do
        begin
          Parent := Setup;
          Left := 395;
          Top := 45;
          Height := 20;
          Width := 100;
          Caption := 'Cancel';
          OnClick := @ButtonClick;
        end;

      Plus := TButton.Create(Setup);
      With Plus do
        begin
          Parent := Setup;
          Left := 5;
          Top := 45;
          Height := 20;
          Width := 20;
          Caption := '+';
          OnClick := @ButtonClick;
        end;

      Minus := TButton.Create(Setup);
      With Minus do
        begin
          Parent := Setup;
          Left := 30;
          Top := 45;
          Height := 20;
          Width := 20;
          Caption := '-';
          OnClick := @ButtonClick;
        end;

      Title := TLabel.Create(Setup);
      With Title do
        begin
          Parent := Setup;
          Top := 10;
          Left := 10;
          Caption := '[P]utonajonnys [I]ncredible [C]ustomisable [S]cript';
          Font.Size := 15;
          Font.Color := ClBlue;
          Font.Name := 'Comic Sans MS';
        end;

      SetArrayLength(InitialLists, 100);
      SetArrayLength(Edits, 7);
      for n := 0 to high(Edits) do
        SetArrayLength(Edits[n], 100);
      SetArrayLength(SpellLists, 100);
      SetArrayLength(WaitLists, 100);
      Shown := 0;
      InitialListsString := [ClickItem, RClickItem, CastSpell, Use, WaitUntil, WaitFor, Withd, Dep];

      for n := 0 to high(InitialLists) do
        begin
          InitialLists[n] := TListBox.Create(Setup);
          With InitialLists[n] do
            begin
              if(Shown >= n) then
                Parent := Setup
              else
                Parent := Fake;
              Top := 90 + 120 * (n mod 5);
              Left := 60 + 300 * (n div 5);
              Width := 110;
              Height := 110;
              OnClick := @ListClick;
              for i := 0 to high(InitialListsString) do
                Items.Add(InitialListsString[i]);
            end;
        end;

      Prompts := ['<Item Number>', '<Click Option>', '<Wait Time (msec)>', '<Amount (0 = all)>', '<Timeout (msec)>', '<On Item (0 = none)>', '<Repeat Until No More>']

      for m := 0 to high(Edits) do
        begin
          for n := 0 to high(Edits[m]) do
            begin
              Edits[m][n] := TEdit.Create(Setup);
              With Edits[m][n] do
                begin
                  Top := 90 + 120 * (n mod 5) + 25 * Byte((m = 1) or (m > 2)) + Byte(m = 6) * 25;
                  Left := 180 + 300 * (n div 5);
                  Width := 110;
                  Height := 20;
                  Text := Prompts[m];
                end;
            end;
        end;

      Spells := ['ardougne teleport', 'bind', 'bones to bananas', 'bones to peaches',
                 'camelot teleport', 'charge', 'charge air orb', 'charge earth orb',
                 'charge fire orb', 'charge water orb', 'claws of guthix', 'confuse',
                 'crumble undead', 'curse', 'earth blast', 'earth bolt',
                 'earth strike', 'earth surge', 'earth wave', 'enchant crossbow bolt',
                 'enfeeble', 'entangle', 'falador teleport', 'fire blast',
                 'fire bolt', 'fire strike', 'fire surge', 'fire wave',
                 'flames of zamorak', 'high level alchemy', 'iban blast',
                 'low level alchemy', 'lumbridge home teleport', 'lumbridge teleport',
                 'lvl-1 enchant', 'lvl-2 enchant', 'lvl-3 enchant', 'lvl-4 enchant',
                 'lvl-5 enchant', 'lvl-6 enchant', 'magic dart',
                 'mobilising armies teleport', 'saradomin strike', 'snare',
                 'storm of armadyl', 'stun', 'superheat item', 'telekinetic grab',
                 'teleother camelot', 'teleother falador', 'teleother lumbridge',
                 'teleport block', 'teleport to ape atoll', 'teleport to house',
                 'trollheim teleport', 'varrock teleport', 'vulnerability',
                 'watchtower teleport', 'water blast', 'water bolt', 'water strike',
                 'water surge', 'water wave', 'weaken', 'wind blast', 'wind bolt',
                 'wind rush', 'wind strike', 'wind surge', 'wind wave'];

      for n := 0 to high(SpellLists) do
        begin
          SpellLists[n] := TComboBox.Create(Setup);
          With SpellLists[n] do
            begin
              Top := 90 + 120 * (n mod 5);
              Left := 180 + 300 * (n div 5);
              Width := 110;
              Height := 110;
              Text := '<Select Spell>';
              for i := 0 to high(Spells) do
                Items.Add(Spells[i]);
            end;
        end;

      Waits := ['Inventory Full', 'Inventory Empty'];

      for n := 0 to high(WaitLists) do
        begin
          WaitLists[n] := TComboBox.Create(Setup);
          With WaitLists[n] do
            begin
              Top := 90 + 120 * (n mod 5);
              Left := 180 + 300 * (n div 5);
              Width := 110;
              Height := 110;
              Text := '<Please Select>';
              for i := 0 to high(Waits) do
                Items.Add(Waits[i]);
            end;
        end;

    end;

    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    procedure ShowFormModal;
    begin
      Setup.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    begin
      SafeInitForm;
      SafeShowFormModal;
    end.

    This is the output of "A" which is our array of actions, this is for the example shown above with the superheating, the 3rd parameter shows what it is doing, the others show the options chosen.
    Code:
    0:
    ('<Select Spell>', '<Click Option>', 6, 1, -1, 0, 0)
    1:
    ('<Select Spell>', '<Click Option>', 6, 2, -1, 0, 0)
    2:
    ('superheat item', '<Click Option>', 2, -1, -1, 0, 0)
    3:
    ('<Select Spell>', '<Click Option>', 0, 1, -1, 0, 0)
    4:
    ('<Select Spell>', '<Click Option>', 4, 1, 30000, 0, 0)
    5:
    ('<Select Spell>', '<Click Option>', 7, 3, -1, 0, 0)
    6:
    ('<Select Spell>', '<Click Option>', 7, 2, -1, 0, 0)
    7:
    ('<Select Spell>', '<Click Option>', 7, 1, -1, 0, 0)
    Last edited by putonajonny; 03-11-2012 at 07:09 PM.

  2. #2
    Join Date
    Nov 2011
    Location
    Louisiana
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Looks pretty freaking sweet! Will be great for everything you can do standing at a bank.

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

    Default

    Wow, awesome job! This is pretty shweet!
    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.


  4. #4
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

  5. #5
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    2,254
    Mentioned
    21 Post(s)
    Quoted
    238 Post(s)

    Default

    Wow nice job dude, this will help a lot of people out when they are searching for how to do a specific task.

  6. #6
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks for the support, added more parameters for the spells and the spells are now in alphabetical order for ease of use, if you have any ideas send them my way, would a drop item option be useful? This could be achieved easily by the right click item option.

  7. #7
    Join Date
    Jan 2012
    Posts
    537
    Mentioned
    1 Post(s)
    Quoted
    16 Post(s)

    Default

    its amazing, that trully teased us

  8. #8
    Join Date
    May 2008
    Location
    the world 0_o
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ohhh i like good job! This could potentially be super beast if you want, I could look into maybe making your form nicer

  9. #9
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Updated the original post with some new images of the "Print To String" feature I just added, not uploaded the code yet though.

    Thanks for the support from everybody, I know I am being slow with this but I want to make sure this works well.

    Quote Originally Posted by shstiger2009 View Post
    Looks pretty freaking sweet! Will be great for everything you can do standing at a bank.
    Thanks it can also be used for things like high alching or any other spells on items.

    Quote Originally Posted by Kyle Undefined View Post
    Wow, awesome job! This is pretty shweet!
    Thanks for your support, from such a great Dev.

    Quote Originally Posted by ashaman88 View Post
    wow this looks like it could be pretty cool, keep up the good work!
    Thank you..

    Quote Originally Posted by cause View Post
    Wow nice job dude, this will help a lot of people out when they are searching for how to do a specific task.
    Yeah I wanted to create something really general, I was given the idea in a request thread.

    Quote Originally Posted by wister1 View Post
    its amazing, that trully teased us
    Thanks.

    Quote Originally Posted by Paradoxium View Post
    ohhh i like good job! This could potentially be super beast if you want, I could look into maybe making your form nicer
    That would be great, even just a background image would be great...

  10. #10
    Join Date
    Jun 2011
    Location
    Anywhere that has WIFI
    Posts
    669
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This will be insanely useful! When it gets released anyway! Can't wait to use it!

  11. #11
    Join Date
    Feb 2007
    Location
    Lux Aeterna
    Posts
    171
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by putonajonny View Post
    Yeah I wanted to create something really general, I was given the idea in a request thread.
    Who gave you the idea?
    Last edited by Mushini; 03-11-2012 at 07:23 PM.
    Triggers..

  12. #12
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Jokester View Post
    This will be insanely useful! When it gets released anyway! Can't wait to use it!
    Thanks for the support

    Quote Originally Posted by Mushini View Post
    Who gave you the idea?
    http://villavu.com/forum/showpost.ph...0&postcount=22 except without the simple

  13. #13
    Join Date
    Nov 2011
    Posts
    261
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Wow looks awesome.... looking forward to testing this script out when you beta it.... fascinates me how this concept would work.

  14. #14
    Join Date
    Jan 2012
    Posts
    36
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Looks amazing! I'll try this in my script

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
  •