Results 1 to 13 of 13

Thread: Very new to scripting

  1. #1
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default Very new to scripting

    Well, I am really really new to scripting and have only ever looked at one script, and I have been spending a lot of time trying to make a decent dhide body crafter. I have been using S1n's dhide crafter as a base and started with editing it. Now right now I have been stuck with my own banking problem, I'm not sure where to go to.

    Simba Code:
    if BankScreen then
      begin
        wait(RandomRange(200,400));
        if FindDTM(dhidebodyDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
          begin
          MouseItem(RandomRange(1,3),mouse_Right);
          wait(RandomRange(400,600));
          ChooseOption('27');
          end;
        //if FindDTM(dhideDTM,x,y,MIX1,MIY1,MIX2,MIY2)
          //CloseBank;
        //end;
        if Find
        Mouse(RandomRange(440,460), RandomRange(230,250),0,0,False);
        wait(RandomRange(400,600));
        ChooseOption('27');
        wait(RandomRange(400,600));
        CloseBank;
      end;
    end;

    With the empty "if Find" one I am trying to make it so that when the script banks if it see's that the inventory is empty it will continue on to bank, if it see's there are dhidebodies in the inventory it will bank them, then continue to bank, if it see's there are dhides left, it will just close the bank and finish making them.

    Also, I know that I shouldn't use cords because it will not be able to find find other peoples hides, but the DTM I make for the bank dhides outdates extremely quickly because of the amount of dhides I have, probably haven't set my tolerances correctly on it or something.

  2. #2
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    if (invempty) then

    i understand now. wat a lot of people do is statically withdraw the items. withdraw(); is a common procedure. you can first check colors of the item within a certain slot. and if that color matches up with your dhide color, then use the withdraw procedure. (like use a tpa, and go by the size of the tpa)

    edit: or if you want, use withdrawItem();
    edit2: maybe i dont understand... lol im constantly confusing myself now :/
    Last edited by x[Warrior]x3500; 03-08-2012 at 11:08 PM.

  3. #3
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    To know if there's anything in the inventory, just do

    pascal Code:
    if (not(InvEmpty))then
      // Do whatever;

    I wouldn't add logic to see if there are uncrafted dhides in the inv, as it slows down xp to close the bank and make one more dhide and then open the bank again. Just deposit the inventory and then withdraw.

    EDIT: And for the DTM, buy a bunch of dhides and get the DTM from a point just below the amount text. Bitmap finding may even be better for this, but that's up to you.

  4. #4
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    I'm SO unproud of that script ;s
    Any script of mine pre-member other than Maples and Miner are extremely ghetto and work horridly. (They work, just aren't efficient).

  5. #5
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Quote Originally Posted by Sin View Post
    I'm SO unproud of that script ;s
    Any script of mine pre-member other than Maples and Miner are extremely ghetto and work horridly. (They work, just aren't efficient).
    Actually the crafter no longer works :P DTM's are all outdated and I couldnt be bothered to update them and not get credit for it . Although the edited version I am running right now works pretty well with 1100-1200 bodies per hour.

    To know if there's anything in the inventory, just do

    pascal Code:

    if (not(InvEmpty))then
    // Do whatever;



    I wouldn't add logic to see if there are uncrafted dhides in the inv, as it slows down xp to close the bank and make one more dhide and then open the bank again. Just deposit the inventory and then withdraw.

    EDIT: And for the DTM, buy a bunch of dhides and get the DTM from a point just below the amount text. Bitmap finding may even be better for this, but that's up to you.
    That probably wont work considering I need to keep inventory #28 open for thread >.<

    I had 60k+ Blue hides when I started, but for some reason after every few thousand it outdated the DTM for it, so I just hard coded it to the position of my hides.

    It shouldn't slow it down because I have the wait time set to be able to create an inventory before banking

    Simba Code:
    procedure Declaration;
    begin
        writeLn('We are crafting bodies');
        dhidebodyDTM := DTMFromString('mfgEAAHicrcxJCoAwEAXR1pVRUHAGB4xew1MJ4vWtwHflUhteAg3VpZk1aFEhRwqHRH/YFagxYMIiK2ZsuuPUZ2rCzV7dCK/Ga/fc7NSF5joP3viz3f6Z6CfvuQErCATf');
        TimeToWait := RandomRange(14500,16000);
    end;

    Almost all of the methods are borrowed from S1n, however I don't really expect to release this script considering that fact

  6. #6
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    if(InvCount>1)then

  7. #7
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Another Question if anyone has time,

    Simba Code:
    procedure WithdrawDhide;
    var
    x,y,x2,y2,x3,y3:integer;
    begin
    SetAngle(SRL_ANGLE_HIGH);
    OpenBankChestEdge(SRL_BANK_SW);
    repeat
      wait(100);
    until(PinScreen or BankScreen);
    if PinScreen then
      begin
        InPin(Players[CurrentPlayer].Pin);
        wait(RandomRange(900,1100));
      end;
    if BankScreen then
      begin
        wait(RandomRange(200,400));
      if FindDTM(dhidebodyDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
      begin
        MouseItem(RandomRange(1,3),mouse_Right);
        wait(RandomRange(400,600));
        ChooseOption('27');
        wait(RandomRange(200,600));
      end;
    if FindDTM(dhideDTM,x,y,MIX1,MIY1,MIX2,MIY2)then
      begin
        CloseBank;
      end;
      if(InvCount=1)then
      begin
        Mouse(RandomRange(440,460), RandomRange(230,250),0,0,False);
        wait(RandomRange(400,600));
        ChooseOption('27');
        wait(RandomRange(400,600));
        CloseBank;
      end;
      if(InvCount>10)then
      begin
      CloseBank;
      end;
      end;
    end;

    This works, but it is very very slow, I think it is slow because of the if(InvCount=1) then line seems like it takes forever, the rest of them seem to run quickly and smoothly. Is there anyway to speed up, or another function that will work quicker?

  8. #8
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    well if you want to do it a makeshift way, when u do dhides, it goes from the top left to the bottom right in your inv. so, you can just check the inv slot #27 to see if it has a color different than the inv background. that will tell u if you have any additional items, besides slot 28.

  9. #9
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Thanks warrior, any chance you could show me how to do that? Like which Inventory function (please tell me if I am using this incorrectly) to use. and right now I have the thread in inventory top row right most column.

  10. #10
    Join Date
    Feb 2012
    Location
    SRL Jail
    Posts
    1,319
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sin View Post
    I'm SO unproud of that script ;s
    Any script of mine pre-member other than Maples and Miner are extremely ghetto and work horridly. (They work, just aren't efficient).
    Not to be mean or disrespecful, but yes, this script was freaking atrocious.

  11. #11
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    try this out:

    Simba Code:
    function isSlot27Open():boolean;
    var
     x,y:integer;
    begin
      result:=false;
      if(findcolortolerance(x,y,2963520,707,451,707,451,3))then
        result:=true;
    end;

  12. #12
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    That looks like it would work, but how exactly do I implement it, as the title says, I am extremely new to this and as of two days ago I had 0 knowledge on the subject. At the moment the only thing I have really been able to do is extremely basic.

    Where I implemented it, it continues to return the error, "Identifier expected"

  13. #13
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    instead of:
    Simba Code:
    if(InvCount=1) then

    you would use:
    Simba Code:
    if(isSlot27Open)then

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
  •