Results 1 to 5 of 5

Thread: Bank Function Help

  1. #1
    Join Date
    Apr 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Bank Function Help

    Im working on an autofisher script for catherby and shilloh village mainly but possibly other areas as well. Im sure I can get the fishing scripting down only problem is I want it to be able to bank if you edit the script and set it to true. Problem is Im a newb to scripting so Im reading tuts trying to set up a basic auto fisher and I have no clue how to add a bank function. I was browsing around the web looking for tuts on how to add it and I came across a script and want to know if mine should be set up like this or not and what would I have to add to make it so you could turn it on or off.

    Portion of a script I found (I think this is the banking portion):
    Code:
    Procedure Callibrate;
    begin
     if (FindSymbol(x, y, 'bank')) then
     Mouse(x, y, 0, 0, true);
    end;
    
    Procedure FindMMColors;
    begin
     BColor := GetSymbolColor(x, y, 'bank');
     WriteLn(' Bank Symbol Color: ' +inttostr(BColor));
    end;
    What I want to do though is have it so that in the script it has the following commands or something similar if its possible so that it reads

    Bank= (True/False)
    Drop= (True/False)

    True meaning thats what you want to do and false meaning thats not what you want to do. And so no one says Im leeching this script portion It is not mine and was not coded by me as I stated Im a newb to SCAR scripting and trying to set up a basic autofisher with a banking/dropping function. Also if this is not a banking function script and you are feeling generous and wish to code it for me, give me an already existing code, or offer me some tutorials that will help me code it please feel free to do so.

    Thanks,

    Zammy Pl0x
    Zammy Pl0x = Future SCAR master Scripter

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

    Default

    a boolean consists of 2 outcomes true and false so u dont need bank and drop only bank
    for example
    if bank = true then bank;
    if bank = false then drop;
    is this what you was looking for?

  3. #3
    Join Date
    Feb 2009
    Location
    UK
    Posts
    89
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zammy Pl0x;
    Zammy Pl0x = Future SCAR master Scripter
    BTW, lol at your humility!

    Quote Originally Posted by pur3b100d View Post
    a boolean consists of 2 outcomes true and false so u dont need bank and drop only bank
    for example
    if bank = true then bank;
    if bank = false then drop;
    is this what you was looking for?
    I agree with pur3b100d, in the player setup I would have a boolean variable called Bank which could either set to True or False, if True then it woud bank else it would drop the fish.

    Now for the banking to work you will have to move the character first to a bank using map walking which could be tricky if working with several locations. Next you would have to code the script so it opens a bank booth, deposits all fished items and closes the bank (look at core\Bank.scar for functions to do with banking). You would also have to move the character back to fishing spot using map walking.

    Here is a simple banking procedure which opens Al Kharid Bank and deposits all items from slot 2 to slot 28:
    SCAR Code:
    procedure Banking;
    begin
      c := 0; //Sets failsafe variable to 0.
      repeat
        FindObjCustom(x, y, ['ank', 'ooth'], [7829886, 8693443], 5); //Searches the screen for any colors within 5 tolerance of 7829886 or 8693443 and also contain uptext of 'ank' and 'ooth'
        c := c + 1; //Adds one to failsafe variable.
      until (IsUpText('ooth')) OR (c > 9);//Will repeat trying to find bank both until it finds it or it c > 9.
      if (c > 9) then  //if it failed to find the bank booth after 10 tries then
      begin
        Writeln('Could not find bank booth.'); //Outputs text to debug box.
        LogOut; //Logs out current player.
        Exit; //Exits the procedure.
      end else
      begin
        Mouse(x, y, 2, 2, False); //Right clicks on bank booth.
        Wait(350 + Random(650)); //Random wait.
        ChooseOption('Use-quickly'); //Chooses 'Use-quickly' option.
        Wait(1850 + Random(650)); //Random wait.
        Deposit(2, 28, True); //Deposits all items from slot 2 to slot 28.
        Wait(650 + Random(350)); //Random wait.
        CloseBank; //Closes bank screen.
      end;
    end;

    This doesn't include map walking, I suggest reading this to learn how to map walk.
    Last edited by Gearsnare; 04-13-2009 at 02:03 AM.
    SCAR Code:
    if (YourActivity = 'ReadingThis') then
        Inc(ViewCount);

  4. #4
    Join Date
    Apr 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the help and yes what I was looking for is a basic bank funtion. And true I dont actually need a bank and drop boolean. Like I said I am a newb to this working on my first script atm. And hopefully I will be a master scar scripter one day.
    Zammy Pl0x = Future SCAR master Scripter

  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    89
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zammy Pl0x View Post
    Thanks for the help and yes what I was looking for is a basic bank funtion. And true I dont actually need a bank and drop boolean. Like I said I am a newb to this working on my first script atm. And hopefully I will be a master scar scripter one day.
    With enough practice you could be, I've recently started scripting and it's really quite easy once you've made a few simple things. I find making scripts is the best way to learn and reading tutorials for different ideas, also look at all the scripts to see how other people do certain things such as banking.

    Good luck on your scripting journey!
    SCAR Code:
    if (YourActivity = 'ReadingThis') then
        Inc(ViewCount);

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
  •