Results 1 to 4 of 4

Thread: [First Script] Fire Runecrafter [NEED HELP, broken]

  1. #1
    Join Date
    Dec 2014
    Posts
    48
    Mentioned
    2 Post(s)
    Quoted
    28 Post(s)

    Default [First Script] Fire Runecrafter [NEED HELP, broken]

    This is my first attempted script - it crafts fire runes in Al Kharid and uses the Duel Arena bank.
    Currently, the script must be started at Duel Arena bank
    This script uses Preset 1 to bank, which is 1 fire tiara (worn) and 28 rune essence in inventory


    Some of the things I would like help adding/improving are:
    ([most important) looping all procedures together.
    At the moment, the script will only perform one run (if successful at all), then it will stop at Duel Arena Bank. Advice on how to get it to repeat by banking again and continue running, is appreciated.


    • failsafes
    This script has quite a few infinite loops and I'm wondering how to manage all of them so my character doesn't get stuck doing something?

    • walking help
    I found SPS to be very unreliable for the walking in Al Kharid, so I ended up using DTMs for all walking procedures. This can also be unreliable at times, especially if a white player dot is on top of the minimap icons used. I wonder if anyone has a better alternative for walking?

    • antiban
    currently, the script has no antiban and I would like to know how to add it

    • anything else
    if you know how the script logic or speed can be improved, please do tell! At the moment, the script is a bit slow and appears bot-like at times


    Thank you for any help and feedback offered, and a big thanks to The Mayor's tutorial, from which a large portion of the code was based.
    Attached Files Attached Files
    Last edited by meep152; 02-09-2015 at 10:45 PM.

  2. #2
    Join Date
    Apr 2012
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    11 Post(s)

    Default

    I'm not an expert by any means, but I'll try to help with what I can.

    To loop the procedures together, you need to add a repeat into your main loop. Something like this:
    Simba Code:
    // main loop
    begin
      clearDebug();
      smartEnableDrawing := true;
      setupSRL();
      declarePlayers();
      //SPS.setup('KHARID_MAP2', RUNESCAPE_OTHER);  //script tries to use DTMs to walk now

      if not isLoggedIn() then
      begin
        players[currentPlayer].login();
        exitTreasure();
        minimap.clickCompass();
      end;
      repeat
        openBank();
        withdrawEss();
        walkAltar();
        enterAltar();
        craftRunes();
        exitAltar();
        walktoBank();
        end;
    End.

    For failsafes: I don't know a lot about this. I would look at some of the scripting guides, as they typically implement lots of failsafes.

    For antiban: some scripts create a function called antiban with various features in it, such as move mouse offscreen, change camera angle, check xp, etc. Then the antiban procedure is called at semirandom intervals in the main loop (usually set by a user threshold for frequency). A lot of the popular free scripts have fairly elaborate antiban procedures, I would take a look there for some ideas. You could also add random time intervals between your functions in the main loop.

    Hopefully some of that helps!

  3. #3
    Join Date
    Dec 2014
    Posts
    48
    Mentioned
    2 Post(s)
    Quoted
    28 Post(s)

    Default

    Thank you! That information did help for sure and now Ive added a few timers to break out of "repeat" loops which the character would otherwise get stuck on. I also managed to get all the procedures to loop together thanks to your help.

    I've placed my updated script in the original post; I'm still looking for ways to add antiban and I might want to add a teleport failsafe since the script ocassionally gets stuck when banking or entering the altar. Other than that, I got the script to run for 40 minutes without any problems. It's a start, woo!

  4. #4
    Join Date
    Jul 2014
    Location
    My computer
    Posts
    78
    Mentioned
    8 Post(s)
    Quoted
    21 Post(s)

    Default

    A couple things I noticed. First the program name needs to be all one word and you can't use . in it, so it should be something like
    Simba Code:
    program fireRunecrafterV1_1;
    or something like that. I couldn't get it to compile until I changed it. Also I've found it really useful to make normal procedures boolean functions, that way if your function messes up, say if you're trying to craft the runes and it fails, it can return false and you can use that as a way to either break out of your main loop, or go do something else to try and fix it.

    for example instead of:
    Simba Code:
    repeat
      openBank();
      withdrawEss();
      //etc
    until (false);

    it could be:
    Simba Code:
    repeat
      if (not openBank()) then
        break; //breaks you out of your infinite main loop
      if (not withdrawEss()) then
        break;
      //etc
    until (false);
    All you have to do is change your procedures to boolean functions and have them exit true/false appropriately


    As for antiban you can just make a procedure with a case statement and call it in your script.

    Example:

    Simba Code:
    procedure antiban(seed: integer);
    begin
      case random(seed) of
        0..9:  //change these to whatever you want to change likelihood of calling
          //do something
        10..19: //change these to whatever you want to change likelihood of calling
          //do something else
        20..29: //change these to whatever you want to change likelihood of calling
          //do something even different
        //etc
      end;
    end;

    and to call it you would do:

    Simba Code:
    procedure foo();
    begin
      //some stuff that does some stuff
      antiban(100); //change 100 to whatever number you want
      //some more stuff that does some more stuff
    end;


    Hope that's helpful and not too confusing
    We must stop constantly fighting for human rights and equal justice in an unjust system, and start building a society where equal rights are an integral part of the design. --Jacque Fresco

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
  •