Results 1 to 23 of 23

Thread: Pick items in bank

  1. #1
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Pick items in bank

    I learned how to open the bank but now i need to learn how to pick up items

    I want to pick essenses so my inventory is full(pick all)

    Can anyone teach me how to do ?

    I know i am a newbie at scar and that i am maybe annoying but i need help to start learning.
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  2. #2
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Wizzups from srl essence miner.

    Uses bitmaps to find ess + withdraws all.

    Hope you can understand it as its a boolean function...

    Deleted the irelavant stuff in it for you.

    SCAR Code:
    Function BankStuff: Boolean;

    Var
      RuneEss, PureEss: Integer;
    Begin
      If Not BankScreen Then Exit;
      RuneEss := BitmapFromString(8, 12, 'z78DA8DCD3112C3200C44D1' +
           '2BE1B02B9B1288B9FF91222315149107EFCCAFF4B08037BB584F0' +
           'E0E6F9143D724EBAC5F79BE0F1BABF7DDCEB25374B3925858BCC1' +
           '3BBC78E82AA1DBB07EBFAAC8DA3D3130BC1B8A191DFD8F8A6C424' +
           '57515D945E1C685D35564973FA23DD4D48ED5ABACDB560092CED4' +
           'BB9DF73F7ACE7D1F');
      PureEss := BitmapFromString(11, 10, 'z78DAA5CF490E03211003C' +
           '02FB1B56D8E0CCBFF9F1492CC012962B2B5251F4B6E451616192B' +
           'ABC8CEA62CC771F6A120AFA638D39594B213841C342F27151536A' +
           '6994110F214A59DB9D1783032FCE39018E8CCF474BF693434B48F' +
           '9C555B1CBAF98A185050BED0963DE8B8DFA3DF689BEF90E1670EA' +
           '4994F9C65D5D38159B736596763AB5D3A362C5B46B46AF5D4AE57' +
           'BD3837C02891A6');
     
     
      ClickAllItemsBmpTolWait('All', RuneEss, 15, 1500);
      ClickAllItemsBmpTolWait('All', PureEss, 15, 1500);
      Else Deposit(2, 28, 2);
      FreeBitMap(RuneEss);
      FreeBitMap(PureEss);
      If BankScreen Then CloseBank;
    End;

  3. #3
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Erm,your script make the character DEPOSIT essense,i want to know how to withdraw them and how to make the bitmap to do so(because there are numbers over the item)
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  4. #4
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    See my BlackList tuts

    That will get you the location of the items, by numbered bankslot. Then convert that number to column and row with

    row:=((WhichSlot-1)/8)+1;
    column:=((WhichSlot+7)mod 8)+1;

    and then use

    {************************************************* ******************************
    procedure Withdraw(Col, Row, Amount: Integer);
    by: Odie5533/Stupid3ooo
    Description: Withdraws Amount at Column/Row.
    ************************************************** *****************************}

    From SRL.


    (I will make WithdrawBlackList eventually, so it will be all in one step)

  5. #5
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Whoa....That blacklist tutorial fucks me up,i don't understand half of the thing in your tutorial(while i do understand for the bitmap things and for walking) because the explainations are pretty rough,could you explain it to me a little bit less rough?

    making a DTM containing points on the black(65536) outline of the item
    eh?I don't see any DTM in your tutorial...
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  6. #6
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Ok try this out. This is like WithDraw in SRL cept it uses bankslots. I will edit with a better explanation of how to find which bankslot using BlackLists in a little while. Get comfortable with this first.

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}




    procedure MouseSlot(SlotNumber,ClickType:integer);
    begin
      case ClickType of
        0: mmouse(79+(((SlotNumber+7)mod 8)*47)+ random(31),
                  62+(((SlotNumber-1)/8)*38)+random(31),0,0);
        1: mouse(79+(((SlotNumber+7)mod 8)*47)+ random(31),
                  62+(((SlotNumber-1)/8)*38)+random(31),0,0,true);
        2: mouse(79+(((SlotNumber+7)mod 8)*47)+ random(31),
                  62+(((SlotNumber-1)/8)*38)+random(31),0,0,false);
      end;
    end;

    procedure WithdrawBankSlot(WhichSlot, Amount: Integer);
    var
      rx, ry: Integer;
    begin
      if (BankScreen) then
      begin
        if (Amount = 1) then
        begin
          MouseSlot(WhichSlot,1);
        end
        else
        begin
          MouseSlot(WhichSlot,2);
          GetMousePos(rx,ry);
          if (Amount = 1) or (Amount = 5) or (Amount = 10) or (Amount = 0) then
          begin
            if (Amount = 5) then
              ChooseOption(rx, ry, 'Withdraw 5');
            if (Amount = 10) then
              ChooseOption(rx, ry, 'Withdraw 10');
            if (Amount = 0) then
              ChooseOption(rx, ry, 'Withdraw All');
          end
          else
          begin
            ChooseOption(rx, ry, 'Withdraw X');
            Wait(1000 + Random(100));
            TypeSend(IntToStr(Amount) + Chr(13));
          end;
        end;
      end;
    end;



    begin
      SetupSRL;
      WithDrawBankSlot(5,5);
    end.

  7. #7
    Join Date
    Feb 2007
    Location
    Toronto, Ontario, Canada
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You should really check out one of the DTM tutorials. Believe me, they help. Howver, as a quick run through, when you open the DTM editor in SCAR (Tools --> DTM Editor), you first pick a point in the middle of the object, then make points radiating out from the inner point, along the edges. This tells SCAR the shape of the object it is looking for. All items that are in your inventory are handily surrounded by a one-pixel-wide black line that is colored 65536. You should make your radiating points at intervals along this surrounding edge. Just make sure that there is a black line in the middle of the zoomed-in box in the upper-left corner, then make a point. As I said though, read the tuts.

  8. #8
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I know how to use DTM,i just asked him why he ask for DTM in his tutorial when i don't see any in the tutorial

    0: mmouse(79+(((SlotNumber+7)mod 8)*47)+ random(31),
    62+(((SlotNumber-1)/8)*38)+random(31),0,0);
    1: mouse(79+(((SlotNumber+7)mod 8)*47)+ random(31),
    62+(((SlotNumber-1)/8)*38)+random(31),0,0,true);
    2: mouse(79+(((SlotNumber+7)mod 8)*47)+ random(31),
    62+(((SlotNumber-1)/8)*38)+random(31),0,0,false);
    I don't understand well how this work,i usually use basic mmouse

    WithDrawBankSlot(5,5)
    Why 5,5?


    For the rest i understand it
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  9. #9
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    That stuff is just for clicking in bankslots, don't worry about it.

    The first 5 is the bank slot number. The second is the amount you want to withdraw from that bankslot.

    Here, I commented the mainloop, and I made a BlackList of ess for you.
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    var MyList:TPointArray;
    var blRuneEss,SlotList:array of integer;



    {*******************************************************************************
    function Create40PercentTPA:TPointArray;
    By: Boreas
    Note: Purely an internal function, used in setup.
    Description: Returns a TPointArray containing the relative (to x1,y1 of a BSlot)
    for 385 points (out of 31*31, hence 40%). Only needs to be done once, to create
    the list of points to check for 65536. Only takes like 15ms, and I didn't
    feel like typing them all out.
    *******************************************************************************}

    function Create40PercentTPA:TPointArray;
    var Counter,hx,hy:integer;
      var TPointsToCheck:array [0..384] of TPoint;
    begin
      repeat
        hy:=15;
        hx:=hx+1;
        repeat
          hy:=hy+1;
          if (((hx mod 4)=0) or ((hy mod 4)=0)) then
          begin
            TPointsToCheck[Counter].x:=hx;
            TPointsToCheck[Counter].y:=hy;
            Counter:=Counter+1;
          end;
        until hy=31;
      until hx=31;
      result:=TPointsToCheck;
    end;

    {*******************************************************************************
    function CreateItemBlackList(WhichBankSlot:integer;WhichList:TPointArray):array of integer;
    By: Boreas
    Description: Looks at the points in the list for an item, and returns an array
    contatining the indexes of the points that are black.
    Usage: WhichBankSlot-just what it sounds like. WhichList-the TPointArray
    containing positions relative to the x1,y1 of a bankslot which you want to check
    *******************************************************************************}


    function CreateItemBlackList(WhichBankSlot:integer;WhichList:TPointArray):array of integer;
    var Counter,Counter2,Tmpx1,Tmpy1,ListLength:integer;
    var TmpArray:array of integer;
    begin
        Tmpx1:=79+((((WhichBankSlot+7)mod 8))*47);
        Tmpy1:=62+((((WhichBankSlot-1)/8))*38);
      ListLength:=getarraylength(WhichList)-1;
      setarraylength(tmparray,1);
      for Counter:= 0 to ListLength do
      begin

        if GetColor(Tmpx1+WhichList[Counter].x,Tmpy1+WhichList[Counter].y)=65536 then
        begin
          TmpArray[Counter2]:=Counter;
          Counter2:=Counter2+1;
          setarraylength(TmpArray,Counter2+1);

        end;
      end;
      result:=TmpArray;
    end;
    {*******************************************************************************
    function CompareIntArrays(FirstIntArray,SecondIntArray:array of integer):boolean;
    By: Boreas
    Description: Returns true both arrays are the same
    ******************************************************************************}

    function CompareIntArrays(FirstIntArray,SecondIntArray:array of integer):boolean;
    var Counter:integer;
    begin
      if not(getarraylength(FirstIntArray)=getarraylength(SecondIntArray)) then
        result:=false;


      if (getarraylength(FirstIntArray)=getarraylength(SecondIntArray)) then
      begin
        result:=true;
        repeat
          if not(FirstIntArray[Counter]=SecondIntArray[Counter]) then
            result:=false;
          Counter:=Counter+1;
        until ((Counter=getarraylength(FirstIntArray)) or (result=false));
      end;
    end;

    //in misc/arrayloader.scar by moparisthebest
    function intArrayToStr(intArray: array of Integer): string;
    var
      i, arrayLength: Integer;
    begin
      arrayLength := GetArrayLength(intArray);
      repeat
        Result := Result + IntToStr(intArray[i]);
        if (not (i = (arrayLength - 1))) then
          Result := Result + ' ';
        i := i + 1;
      until (i = arrayLength)
    end;

    //in misc/arrayloader.scar by moparisthebest
    function strToIntArray(intArray: string): array of Integer;
    var
      i, spacePos: Integer;
    begin
      repeat
        SetArrayLength(Result, i + 1);
        spacePos := Pos(' ', intArray);
        if (not (spacePos = 0)) then
        begin
          Result[i] := StrToInt(Copy(intArray, 1, spacePos - 1));
        end
        else
        begin
          Result[i] := StrToInt(Copy(intArray, 1, Length(intArray)));
          break;
        end;
        Delete(intArray, 1, spacePos);
        i := i + 1;
      until (False)
    end;

    {*******************************************************************************
    function InIntArray(TheInt:integer;TheArray:array of integer):boolean;
    By: Boreas
    Description: Returns true if TheInt is a member of TheArray
    ******************************************************************************}

    function InIntArray(TheInt:integer;TheArray:array of integer):boolean;
    var i:integer;
    begin
      repeat
        if TheArray[i]=TheInt then
          result:=true;
        i:=i+1;
      until ((i=getarraylength(TheArray)) or (result));
    end;

    {*******************************************************************************
    function FindAllSlotsBlackListSkip(BlackList:array of integer; PointList:TPointArray; SkipEm:array of integer):array of integer;
    By: Boreas
    Description: Returns the BankSlots containing the BlackList found with the
    PointList. Skips the slots in SkipEm. Use [0] to skip none.
    ******************************************************************************}

    function FindAllSlotsBlackListSkip(BlackList:array of integer; PointList:TPointArray; SkipEm:array of integer):array of integer;
    var slot,counter:integer;
    tmpBlackList, tmpresult:array of integer;

    begin
      for slot:=1 to 48 do
      begin
        if not(InIntArray(slot,SkipEm)) then //is there a better way?
        begin
          tmpBlackList:=CreateItemBlackList(slot,PointList);
          if CompareIntArrays(BlackList,tmpBlackList) then
          begin
            setarraylength(tmpresult,counter+1);
            tmpresult[counter]:=slot;
            counter:=counter+1;
          end;
        end;
      end;
      result:=tmpresult;
    end;
    {*******************************************************************************
    procedure MouseSlot(SlotNumber,ClickType:integer);
    By: Boreas
    Description: Clicks give bank slot
    ClickType: 0 for no click (just move), 1 for left, 2 for right
    ******************************************************************************}

    procedure MouseSlot(SlotNumber,ClickType:integer);
    begin
      case ClickType of
        0: mmouse(79+(((SlotNumber+7)mod 8)*47)+ random(31),
                  62+(((SlotNumber-1)/8)*38)+random(31),0,0);
        1: mouse(79+(((SlotNumber+7)mod 8)*47)+ random(31),
                  62+(((SlotNumber-1)/8)*38)+random(31),0,0,true);
        2: mouse(79+(((SlotNumber+7)mod 8)*47)+ random(31),
                  62+(((SlotNumber-1)/8)*38)+random(31),0,0,false);
      end;
    end;
    {*******************************************************************************
    procedure WithdrawBankSlot(WhichSlot, Amount: Integer);
    By: Boreas
    Description: Withdraws specified amount from specified bankslot
    To withdraw all, use 0 as amount
    Based on Withdraw except it does BankSlots instead of row and column
    ******************************************************************************}

    procedure WithdrawBankSlot(WhichSlot, Amount: Integer);
    var
      rx, ry: Integer;
    begin
      if (BankScreen) then
      begin
        if (Amount = 1) then
        begin
          MouseSlot(WhichSlot,1);
        end
        else
        begin
          MouseSlot(WhichSlot,2);
          GetMousePos(rx,ry);
          if (Amount = 1) or (Amount = 5) or (Amount = 10) or (Amount = 0) then
          begin
            if (Amount = 5) then
              ChooseOption(rx, ry, 'Withdraw 5');
            if (Amount = 10) then
              ChooseOption(rx, ry, 'Withdraw 10');
            if (Amount = 0) then
              ChooseOption(rx, ry, 'Withdraw All');
          end
          else
          begin
            ChooseOption(rx, ry, 'Withdraw X');
            Wait(1000 + Random(100));
            TypeSend(IntToStr(Amount) + Chr(13));
          end;
        end;
      end;
    end;

    begin
    //This sets up srl, duh
    setupsrl;
    //BlackLists are fast because they don't look at every pixel
    //This decides how much they look at
    MyList:=Create40PercentTPA;
    //This is the BlackList for Ess, because I'm in a good mood
    blRuneEss:=strToIntArray('0 5 10 21 52 59 81 109 137 143 147 162 174 184 185 196 0');
    //This creates a list of all bankslots with that BlackList
    SlotList:=findallslotsblacklistskip(blRuneEss,MyList,[0]);
    //Lucky for you, runes don't have the same BlackList as ess
    //so there should only be one slot in the list,
    //so you don't need to use colors
    if getarraylength(SlotList)>1 then
    begin
      writeln('There are '+inttostr(getarraylength(SlotList))+' possible places where it could be');
      writeln('Since we are not using BlackLists with color (the second tut),');
      writeln('we will just pick the first one, and hope for the best');
    end;
    //So SlotList[0] is the first (and only) slot in the list
    //and 5 is how many you want to withdraw for example
    //use 0 for all
    WithDrawBankSlot(SlotList[0],5);

    end.

  10. #10
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So this will work and should withdraw essenses?thanks
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  11. #11
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    I just wrote it and only tested a couple times, try it.

  12. #12
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    THANKS,it WORKS

    BTW:Could you help me in my firecraft script,i need help about the radial walk because most of roads in al kharid are the same color as the house grounds in minimap
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

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

  14. #14
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I've just said i knew how to use DTM,but i don't like to use it :P
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  15. #15
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    King: You're welcome . Make help threads on specific problems, and I may take a look, like I did this one.

  16. #16
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Now when i use it it says me that:

    [Runtime Error] : Out Of Range in line 246 in script

    SCAR Code:
    WithDrawBankSlot(SlotList[0],5);

    what is the problem boreas?
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  17. #17
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    What did you do to create SlotList?

  18. #18
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Boreas,i have used the script you posted above without changing anything to it.
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  19. #19
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Make sure you fixbank and that the ess is visible (in the top 48 spots)

  20. #20
    Join Date
    Mar 2007
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Fixbank?Is that a function?
    Dormcheck is a scam,i've posted 1000 messages and i never got paid my 10 bucks.
    http://www.fenjer.com/adnan/SRLStats/348.png

  21. #21
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Yes, it scrolls the bank to the top, so that the coords will line up with how BlackLists are calibrated.

  22. #22
    Join Date
    Oct 2006
    Location
    Ireland
    Posts
    855
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could always use withdraw(1,1,28)

    The first one being the column, second being row, thrid is the amount.

  23. #23
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    But that would mean the ess would have to be been in a certain place.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Best way to take items from the bank?
    By AbsTrACt'^.| in forum OSR Help
    Replies: 3
    Last Post: 05-23-2008, 07:22 PM
  2. cabbage 'pick & bank'
    By exppo in forum First Scripts
    Replies: 10
    Last Post: 02-23-2008, 04:03 PM
  3. Items Cord in bank
    By wtf i sp4nk in forum OSR Help
    Replies: 4
    Last Post: 05-27-2007, 02:52 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
  •