Page 1 of 4 123 ... LastLast
Results 1 to 25 of 81

Thread: Soulsplit fighter

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default Soulsplit fighter

    Ultimate Soulsplit Fighter

    Requested by too many people


    Features


    - Ability to choose whether to right click
    - Ability to choose whether to check for uptext
    - Checks if the monster is in combat
    - Ability to load monster from the monster profile database
    - Automatically downloads the latest list of monsters (and all of their needed information)
    - Script auto updates
    - Long run times (auto login of course)
    - Auto downloads profiles
    - Calculates XP 100% accurately
    - Displays online friends
    - Custom skill level tracking
    - Prayer support (pray pots and super restore)
    - Displays combat level, weapon name, and weapon attack mode
    - use Custom attack mode




    Instructions

    Instructions

    - Download SRLRSPS from https://github.com/officerBarbrady/srlRSPS
    - Open up the .zip and copy the file named 'RSPS' into c:simba/includes

    - Set the script interpreter to lape
    - Turn auto retaliate on
    - Graphics settings to oldschool/max brightness


    Settings:




    - To view a list of available monsters, set _displayMonsters to true like so:



    Note: You must set this variable back to false to run the script

    This will display all of the monsters and their IDS:

    Example
    Code:
    ID: 1  Cave crawler
    ID: 2  Cave bug
    ID: 3  Oomlie bird
    ID: 4  Grizzly bear
    ID: 5  Giant spider
    ID: 6  Sekeleton
    ID: 7  Moss Gaint
    ID: 8  Monkey Zombie
    ID: 9  Ghost
    ID: 10  Cave Slime
    ID: 11  Killerwatt
    ID: 12  Ice Giant
    ID: 13  Elf Warrior
    ID: 14  Earth Warrior
    ID: 15  Jelly
    ID: 16  Pyrefiend


    To make the script attack your preferred monster, change monsterID to the ID of the monster. So if I wanted to kill Monkey zombies, I would change it to 8. If you set auto load to false, then the script will use the default monster, which is cave crawlers.

    Explanation of the other constants:
    Note: All variable names are in bold

    _timeout This is the amount of time that must pass while in a fighter before the script moves on if it keeps detecting that we are in combat

    _loot Always leave this as false, this feature is not finished

    _rightClick This determines whether or not the script will right click attack

    _useUptext This determines whether or not the script will check the uptext. If you are right clicking, it is advised to leave this as false. Otherwise, if you are left clicking it is best to leave it on true so the script does not blindly click

    _checkCombat If this is true then the script will check if a monster is in combat before attacking it. It is advised to leave it as false if you are in a multi combat area.

    _updateTotal This will update your total level when set to true. _update_total is the time in milliseconds it will update. So if set to 20000, it will update your total every 20 seconds.

    *_pray When set to true it will use prayer. To edit the prayers it uses, change _use_prayers to the name of the prayers. You must spell the prayer names with their exact name as spelled on the prayer book. Only normal prayers are supported. _check_prayer_every is the amount of time in milliseconds in which it will check if the prayers are still activated. _pray_at is the prayer level in which the script will search for prayer potions in your inventory and click them.

    *_trackSkills Setting this variable to true means that it will track the skills throughout the runtime of the script. At the end of the script, it will display the start and finish levels in the skills you chose to track. You must enter the name of the skill in the string array _track_skills. _update_every is the amount of time in milliseconds in which it will update the tracked skills.

    displayOnlineFriends Setting this variable to true means that the script will display your online friends in the progress report. update_friends_every is the amount of time in milliseconds in which it will update this list.

    display_task The script has specific tasks, such as update total, pray, update stats, and check online friends. If you set this to true, then it will display the amount of time until each of the tasks will be updated.

    attack_mode This is the attack mode the script will use. The number must be 0, 1, 2, or 3. The attack mode corresponds with this chart:


    * See guide below on how to insert TStringArrays




    How to insert TStringArrays:

    Say we have the variable '_use_prayers'. Every string you want to insert, must be inside of ' '. Every time you want to add a string, add a comma: ','.

    Example


    1 prayer:
    Simba Code:
    _use_prayers = ['Ultimate Strength'];
    2 prayers:
    Simba Code:
    _use_prayers = ['Ultimate Strength', 'Steel skin'];
    3 prayers:
    Simba Code:
    _use_prayers = ['Ultimate Strength', 'Steel skin', 'Incredible reflexes'];
    4 prayers:
    Simba Code:
    _use_prayers = ['Ultimate Strength', 'Steel skin', 'Incredible reflexes','Protect item'];


    Please note that you upper case and lower case does not matter in this script.

    Credits

    Janilabo
    Rasta Magicion
    Nava2
    MasterBB


    Code:
    Overall Progress
    -   Time running: 1 Hours, 46 Minutes and 54 Seconds
    -   State: Fighting Monkey Zombie
    -   353 Monkey Zombie Killed 
    -   Start XP: 5,397,878 XP gained: 2764876
    Hourly Progress
    -   XP: 1551664
    -   Kills: 198
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by sharkyscape View Post
    monkey zombies is broken im at the monkey's in low lvl dung i start the script but it doesnt detect them it spams in the simba bot cannot find any monsters and lags my pc needs fixed

    works with cave crawlers

    its not checking for charm drops i have noticed this

    will not last long once all monsters r dead it goes crazy and spams that it cant find any monsters

    i fixed the spam by searching for did not find monster and added on the line after that wait(500); it will no longer spam ur pc and cause it lag but it will check frequent enough maybe have the camera rotate if theres no monsters found cause usualy if they arent on the screen they r somewhere nearby
    C'mon now man. You're a junior member here, you should at least take the time to make a well spoken post that makes sense and can be a useful bug report.
    Also, it would be nice to give a simple "thanks" for the time that this script took to make, as i'm sure it required a lot of time and effort to write.
    Last edited by Kyle; 02-16-2014 at 05:02 PM.
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  3. #3
    Join Date
    Feb 2014
    Posts
    20
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    It cant find the Monkey Zombies

    EDIT V2: Updated the colors in the script settings myself and works perfect now.
    Last edited by jst94; 02-16-2014 at 06:47 PM.

  4. #4
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    @jst94; @sharkyscape;

    Code:
    Overall Progress
    -   Time running: 4 Hours, 20 Minutes and 19 Seconds
    -   State: Waiting to get into combat
    -   1079 Monkey Zombie Killed 
    -   Start XP: 14,921,518 XP gained: 8526926
    Hourly Progress
    -   XP: 1965287
    -   Kills: 249
    Botted there 4 hours straight, means that you have the wrong graphics settings

    Is your brightness all the way up?

  5. #5
    Join Date
    Feb 2014
    Posts
    20
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    Yep was my brightness

    Thanks script works like a charm

  6. #6
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by jst94 View Post
    Yep was my brightness

    Thanks script works like a charm
    Np, and you got the latest include right? Because I just chucked like 300 lines off the script and put those functions into the include

  7. #7
    Join Date
    Feb 2014
    Posts
    20
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    Yeah got the latest include.

    Botted for over 24h and got me 58-91 str on a extreme

  8. #8
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by jst94 View Post
    Yeah got the latest include.

    Botted for over 24h and got me 58-91 str on a extreme
    Great glad to see it helped you

  9. #9
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by sharkyscape View Post
    thx for the bot doing great now that ik how to use it

    although i still dont understand how to get the looting working i set _loot = true; but it doesnt check for drops

  10. #10
    Join Date
    Jun 2012
    Posts
    56
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    oh ok i didnt notice that sorry

    giant spiders arent getting detected i tried on every graphic setting edit: i forgot to save the script when i changed it to 5 edit2: they get detected but i just watched it sit there when there was like 8 spiders on the screen saying it cant find any monsters

  11. #11
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    this script looks so awesome, I wish I could come up with something like this but I know it takes years of practice. I just wished it supported skeletal wyverns

  12. #12
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    when i start the script I get this
    Exception in Script: Unable to find file 'RSPS/srlRSPS.Simba' used from 'C:\Users\Jakek\Downloads\Soulsplit fighter V1 (1).simba

  13. #13
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    script doesn't work for me.

    Creds to DannyRS for this wonderful sig!

  14. #14
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    script doesn't work for me.
    - Time running: 6 Hours, 41 Minutes and 36 Seconds
    - State: Waiting to get into combat
    - 1287 Monkey Zombie Killed [192] per hour
    - Start XP: 37,548,648 XP gained: 8586178 [1282759] per hour
    - Current TAB: TAB_IGNORE
    - Levels gained: 22 Start Total: 1142 Next update in: 2 Minutes and 41 Seconds

  15. #15
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    - Time running: 6 Hours, 41 Minutes and 36 Seconds
    - State: Waiting to get into combat
    - 1287 Monkey Zombie Killed [192] per hour
    - Start XP: 37,548,648 XP gained: 8586178 [1282759] per hour
    - Current TAB: TAB_IGNORE
    - Levels gained: 22 Start Total: 1142 Next update in: 2 Minutes and 41 Seconds
    pls i was trolling, you fkign show-off

    Creds to DannyRS for this wonderful sig!

  16. #16
    Join Date
    Jan 2014
    Posts
    147
    Mentioned
    7 Post(s)
    Quoted
    75 Post(s)

    Default

    Your RSPS include is missing prayer.simba for its latest release making it un-usable

  17. #17
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by uhit View Post
    Your RSPS include is missing prayer.simba for its latest release making it un-usable
    I forgot to push that just now pushed the updates


    Everything is updated, lots more features

    next update will have potion and food support

  18. #18
    Join Date
    Jan 2014
    Posts
    147
    Mentioned
    7 Post(s)
    Quoted
    75 Post(s)

    Default

    Exception in Script: Runtime error: "You passed a wrong xs to a finder function: -11. That is below 0, thus out of bounds." at line 324, column 31 in file "C:\Simba\Includes\RSPS\core\prayer.Simba"

    Received this update after 5mins runtime

  19. #19
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by uhit View Post
    Exception in Script: Runtime error: "You passed a wrong xs to a finder function: -11. That is below 0, thus out of bounds." at line 324, column 31 in file "C:\Simba\Includes\RSPS\core\prayer.Simba"

    Received this update after 5mins runtime
    Sec I think I know what that is.


    Are you using any prayers?

  20. #20
    Join Date
    Jan 2014
    Posts
    147
    Mentioned
    7 Post(s)
    Quoted
    75 Post(s)

    Default

    Just the attack/str boosting ones.

    Got unlim prayer so why not. If I need to turn it off then I will. I'm experimenting with the script code atm :3

  21. #21
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by uhit View Post
    Just the attack/str boosting ones.

    Got unlim prayer so why not. If I need to turn it off then I will. I'm experimenting with the script code atm :3
    which attack/str boosting ones?

  22. #22
    Join Date
    Jan 2014
    Posts
    147
    Mentioned
    7 Post(s)
    Quoted
    75 Post(s)

    Default

    ultimate str. I turned it off but it still gave the error

  23. #23
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by uhit View Post
    ultimate str. I turned it off but it still gave the error
    can you copy and paste your exact script here in simba tags please?

  24. #24
    Join Date
    Jan 2014
    Posts
    147
    Mentioned
    7 Post(s)
    Quoted
    75 Post(s)

    Default

    Simba Code:
    {$I RSPS/srlRSPS.Simba}
    {$I RSPS/core/prayer.Simba}


    const

      _timeout = 30000;

      _loot = false;
      _loot_distance = 5;

      _rightClick = false;
      _useUptext = true;
      _checkCombat = true;
      _autoLoad = true;
      _displayMonsters = false;

      _updateTotal = true;
      _update_total = 170000;

      _pray = false;
      _use_prayers = ['Eagle eye'];
      _check_prayer_every = 500000;
      _pray_at = 15;

      _trackSkills = false;
      _track_skills = ['Attack','HitPoints'];
      _update_every = 100000;

      monsterID = 7;


      // do not touch
      scriptVersion = 10;

    type
      _monster = record
        color, tol:tintegerarray;
        health, filter:integer;
        hue, sat:textendedarray;
        uptext:tstringarray;
        name:string;
      end;

      _loot_item = record
        options:TStringArray;
        name:string;
        Value, count:Integer;
      end;

      tStatInfo = record
        skillLevel:array[0..20] of integer;
        skillName:TStringArray;
      end;

      tCustomStatInfo = record
        skillLevels:TIntegerArray;
        skillName:TStringarray;
      end;

      _eventTimer = record
        eventName:string;
        lastTime, _maxTime:integer;
        onTimeup:procedure;
        activated:boolean;
      end;

      _eventTimerArray = array of _eventTimer;

      _loot_array = array of _loot_item;

    var
      timeout, loot_distance, startXP, lastCheck, currentTotal:integer;
      loot, rightClick, checkCombat, useUptext:boolean;
      customSkills, currentSkills:tCustomStatInfo;
      startXPString:string;
      myTimers:_eventTimerArray;
      _pickUps:_loot_array;

    procedure _loot_array.init;
    begin
      setLength(self, 3);
      with self[0] do
      begin
        name := 'Gold charm';
        options := ['ake old','ld cha'];
        value := 0;
      end;
      with self[1] do
      begin
        name := 'Green charm';
        options := ['ake Gr','en cha'];
        value := 0;
      end;
      with self[2] do
      begin
        name := 'Coins';
        options := ['ake Coi','oins'];
        value := 1;
      end;
    end;

    var
      _ss:_rsps_server;
      m:_monster;
      debug:boolean;
      failed, kills, startTotal:integer;

    procedure _monster.init;
    begin
      with self do
      begin
        color := [9148055];
        tol := [15];
        health := 22;
        filter := 140;
        hue := [0.10];
        sat := [0.15];
        uptext := ['ave','rawl','raw'];
        name := 'Cave crawler';
      end;
    end;

    function findFile(path, ext, name:string):boolean;
    var
      s:TStringArray;
      i:Integer;
    begin
      s := GetFiles(path, ext);
      for i := 0 to high(s) do
        result := (s[i] = (name +'.' + ext));
    end;

    function hasprofile():boolean;
    begin
      result := fileExists(appPath + 'SSfighterSettings\_soulsplit.monsterProfiles.txt');
    end;

    function hasSettingsFile():boolean;
    begin
      result := fileExists(appPath + 'SSfighterSettings\_soulsplit.settings.txt');
    end;

    function ss_in:boolean;
    begin
      result := getColor(426, 543) = 16777215
    end;

    procedure ss_login;
    begin
      if ss_in then
        exit
      else begin
        mouse(489, 466);
        if waitFunc(@ss_in, 40, 6000) then
          wait(6000);
      end;
    end;

    function getFileString:String;
    var
      tmpFile:integer;
      str:string;
    begin
      tmpFile := openFile(appPath + 'SSfighterSettings\_soulsplit.monsterProfiles' + '.txt', true);
      try
        ReadFileString(tmpFile, str, 20000);
      finally
        result := str;
        closeFile(tmpFile);
      end;
    end;

    procedure printLoaded;
    var
      str, info:string;
      i, t:integer;
    begin
      t := getSystemTime();
      str := getFileString();
      repeat
        i := i + 1;
        info := between('<monster' + toStr(i) + '>', '</monster>', str);
        if length(info) < 10 then
          exit();
        writeln('ID: ' , i , '  ', between('<name>','</name>', info));
      until ((getSystemTime - t) > 2000);
    end;

    procedure printInfo(search:string;lineTime:integer);
    var
      str, info:string;
      i, t:integer;
    begin
      t := getSystemTime();
      str := getFileString();
      str := between('<' + search + '>', '</' + search + '>', str);
      repeat
        i := i + 1;
        info := between('<' + toStr(i) + '>', '</>', str);
        if length(info) <  1 then
          exit();
        writeln(info);
        wait(lineTime);
      until ((getSystemTime - t) > 15000);
    end;

    procedure printInfo(search:TStringArray;time, lineTime:integer);overload;
    var
      i:integer;
    begin
      for i := 0 to high(search) do
      begin
        printInfo(search[i], lineTime);
        wait(time);
      end;
    end;

    procedure _monster.load(id:integer);
    var
      profileString, monsterInfo:String;
      tmpFile:Integer;
    begin
      profileString := getFileString();
      monsterInfo := between('<monster' + toStr(id) + '>', '</monster>', profileString);
      if length(monsterInfo) < 1 then
      begin
        writeln('Invalid monster ID! ' , id);
        exit();
      end;
      with self do
      begin
        Color := between('<color>', '</color>', monsterInfo).toIntegerArray();
        tol := between('<tol>', '</tol>', monsterInfo).toIntegerArray();
        health := StrToInt(between('<health>', '</health>', monsterInfo));
        hue := between('<hue>', '</hue>', monsterInfo).toExtendedArray();
        sat := between('<sat>', '</sat>', monsterInfo).toExtendedArray();
        uptext := between('<uptext>', '</uptext>', monsterInfo).toStringArray();
        name := between('<name>', '</name>', monsterInfo);
      end;
    end;

    function getSettingsString():string;
    var
      tmpFile:integer;
      str:string;
    begin
      tmpFile := openFile(appPath + 'SSfighterSettings\_soulsplit.settings' + '.txt', true);
      try
        ReadFileString(tmpFile, str, 20000);
      finally
        result := str;
        closeFile(tmpFile);
      end;
    end;

    procedure loadSettingsFromFile;
    var
      profileString, settingsInfo:String;
    begin
      profileString := getSettingsString();
      settingsInfo := between('<settings>', '</settings>', profileString);
      if (length(settingsInfo) > 10) then
      begin
        timeout := StrToInt(between('<timeout>', '</timeout>', settingsInfo));
        loot_distance := StrToInt(between('<lootdist>', '</lootdist>', settingsInfo));
        loot := between('<loot>', '</loot>', settingsInfo).toBoolean();
        rightClick := between('<rightClick>', '</rightClick>', settingsInfo).toBoolean();
        useUptext := between('<useUptext>', '</useUptext>', settingsInfo).toBoolean();
        checkCombat := between('<checkCombat>', '</checkCombat>', settingsInfo).toBoolean();
      end else
        writeln('Error loading settings!');
    end;

    function localVersion():integer;
    var
      profileString, settingsInfo:String;
    begin
      profileString := getFileString();
      if length(profileString) > 1 then
      try
        result := StrToInt(between('<revision>','</revision>', profileString));
      except
        result := -1;
      end
      else
        writeln('Unable to get current revision');
    end;

    function GetProfileVersion():integer;
    begin
      try
        result := StrToInt(getPage('http://pastebin.com/raw.php?i=r9hGvtAu'));
      except
        result := -1;
      end;
    end;

    function getOnlineProfiles():string;
    begin
      result := getPage('http://pastebin.com/raw.php?i=WFS9KJtK');
    end;

    procedure updateProfile;
    var
      tmpFile:integer;
    begin
      try
        tmpFile := rewriteFile(appPath + 'SSfighterSettings\_soulsplit.monsterProfiles.txt', true);
        writeFileString(tmpFile, getOnlineProfiles());
        closeFile(tmpFile);
        writeln('Monster profiles updated');
      except
        writeln('Error updating profile');
      end;
    end;

    function getScriptVersion():integer;
    begin
      try
        result := StrToInt(getPage('http://pastebin.com/raw.php?i=yf87fYMd'));
      except
        result := -1;
      end;
    end;

    function getScriptText():string;
    begin
      result := getPage('http://pastebin.com/raw.php?i=JX6THqXD');
    end;

    procedure updateScript(rev:integer);
    var
      tmpFile:integer;
      path:string;
      sucess:boolean;
    begin
      path := appPath + 'scripts\Soulsplit fighter V' + toStr(rev) + '.simba';
      writeln('Saving latest script at ' , path);
      try
        tmpFile := createFile(path);
        closeFile(tmpFile);
        tmpFile := rewriteFile(path, true);
        writeFileString(tmpFile, getScriptText());
        sucess := true;
      except
        writeln('Error writing script to file');
      finally
        closeFile(tmpFile);
      end;
      if sucess then
      begin
        writeln('please use the script at ', path);
        terminateScript;
      end;
    end;


    procedure UpdateScriptFiles;
    var
      latestProfileVersion, latestScriptVersion, tmpFile:integer;
    begin
      if (not hasProfile) then
      begin
        Writeln('Profiles file not found attempting to download...');
        try
          tmpFile := createFile(appPath + 'SSfighterSettings\_soulsplit.monsterProfiles.txt');
          closeFile(tmpFile);
          UpdateScriptFiles;
          exit();
        except
          Writeln('Error downloading monster profiles');
        end;
      end else
      begin
        latestProfileVersion := GetProfileVersion();
        Writeln('Current profiles version: ' , localVersion(), ' latest: ' , latestProfileVersion);
        if (latestProfileVersion > localVersion()) then
          updateProfile
        else if (latestProfileVersion = localVersion()) then
          writeln('Monster profiles up to date')
        else
          writeln('Local version is newer then online version');
      end;
      latestScriptVersion := getScriptVersion();
      writeln('Current script version: ' , scriptVersion, ' Latest script version: ' , latestScriptVersion);
      if (scriptVersion < latestScriptVersion) then
      begin
        writeln('Updating script..');
        updateScript(latestScriptVersion);
      end else
      begin
        if (scriptVersion = latestScriptVersion) then
          writeln('Script up to date')
        else
          writeln('Local version is newer then online version');
      end;
    end;

    procedure createSettingsFile();
    var
      tmpFile:integer;
    begin
      tmpFile := createFile(appPath + 'SSfighterSettings\_soulsplit.settings.txt');
      closeFile(tmpFile);
    end;

    procedure saveSettings();
    var
      path:string;
      tmpFile:integer;
    begin
      path := appPath + 'SSfighterSettings\_soulsplit.settings.txt';
      try
        tmpFile := rewriteFile(path, true);
        writeFileString(tmpFile, '<settings>');
        writeFileString(tmpFile, '<timeout>' + toStr(_timeout) + '</timeout>');
        writeFileString(tmpFile, '<loot>' + toStr(_loot) + '</loot>');
        writeFileString(tmpFile, '<lootdist>' + toStr(_loot_distance) + '</lootdist>');
        writeFileString(tmpFile, '<debug>' + toStr(debug) + '</debug>');
        writeFileString(tmpFile, '<rightClick>' + toStr(_rightClick) + '</rightClick>');
        writeFileString(tmpFile, '<checkUptext>' + toStr(_useUpText) + '</checkUptext>');
        writeFileString(tmpFile, '<monsterID>' + toStr(monsterID) + '</monsterID>');
        writeFileString(tmpFile, '</settings>');
        writeln('Saved settings to ' , path);
      except
        writeln('Error saving script settings');
      finally
        closeFile(tmpFile);
      end;
    end;

    procedure updateSettingsFiles;
    begin
    if (not directoryExists(appPath + 'SSfighterSettings')) then
      begin
        writeln('Could not find settings folder creating one now');
        if createDirectory(appPath + 'SSfighterSettings') then
          writeln('Directory created');
      end;
      if (not hasSettingsfile) then
      begin
        writeln('Creating settings file');
        createSettingsFile();
        saveSettings();
      end;
    end;

    procedure loadScriptVars;
    begin
      UpdateScriptFiles;
      if _autoLoad then
      begin
        loadSettingsFromFile();
        m.load(monsterID);
      end else
      begin
        timeout := _timeout;
        loot_distance := _loot_distance;
        loot := _loot;
        rightClick := _rightClick;
        useUpText := _useUptext;
        checkCombat := _checkCombat;
        m.init();
      end;
    end;

    function center(bx: TBox): TPoint;
    begin
      if ((bx.X1 > bx.X2) or (bx.Y1 > bx.Y2)) then
      begin
        if (bx.X1 > bx.X2) then
          Swap(bx.X1, bx.X2);
        if (bx.Y1 > bx.Y2) then
          Swap(bx.Y1, bx.Y2);
      end;
      Result := Point(Round(bx.X1 + ((bx.X2 - bx.X1) div 2)), Round(bx.Y1 + ((bx.Y2 - bx.Y1) div 2)));
    end;

    function perHour(what:integer):integer;
    begin
      result := Round(what * (3600.0 / (GetTimeRunning / 1000.0)));
    end;

    procedure _monster.progress(state:string);
    var
      i:integer;
    begin
      clearDebug();
      writeln('-  Time running: ' , timeRunning);
      writeln('-  State: ', state);
      writeln('-  ', kills, ' ', self.name, ' Killed [', perHour(kills),'] per hour ' , 'Levels gained: ' , (currentTotal - startTotal));
      writeln('-  Start XP: ' , startXPString, ' XP gained: ', (ss_getXpBarTotal - startXP), '  [', perHour(ss_getXpBarTotal - startXP),'] per hour');
      for i := 0 to high(myTimers) do
        writeln('-    Task [',i,']', myTimers[i].eventName, ' next update in ' , msToTime(myTimers[i]._maxTime - (getSystemtime - myTimers[i].lastTime), 0));
    end;

    procedure _loot_array.pickUp();
    var
      _dots:TPointArray;
      options:array of TOptions;
      i, k, e, _count:integer;
      opt_strs:TStringArray;
      _ls:TPoint;
      moved:boolean;
    begin
      _dots := GetMiniMapDotsIn('item',539, 61, 708, 217);//getRedDots();
      filterpointspie(_dots, 0, 360, 0, loot_distance * 4, 627, 138);
      sortTPAFrom(_dots, point(627, 138));
      setLength(_dots, 2);
      for i := 0 to high(_dots) do
      begin
        if moved then
          exit();
        _ls := ss_MMtoMsPoint(_dots[i]);
        mouse(_ls.x, _ls.y, 0, 0, mouse_right);
        options := _ss.getOptions();
        setLength(opt_strs, length(options));
        for k := 0 to high(options) do
          opt_strs[k] := options[k].Str;
        writeln('k=' , k);
        k := 0;
        writeln(k);
        //setLength(LookFor, 3);
        writeln(opt_strs);

        for k := 0 to high(self) do
        begin
          writeln(self[k].options);
          if isText(opt_strs, self[k].options) then
            _count := _count + 1;
        end;
        for k := 0 to _count do
        begin
          if moved then
            mouse(258, 230, 0, 0, mouse_right);
          for e := 0 to high(self) do
            if not _ss.waitOptionMulti(self[e].options, 150) then
              if debug then
                writeln('Did not find ' , self[e].options)
            else
              moved := true;
        end;
      end;
    end;

    function healthBar(b:tbox):boolean;
    var
      red, green, bar:tpointarray;
      healthbar:t2dpointarray;
      i:integer;
      bx:tbox;
    begin
      if ((mainscreen.bounds.x1 + (b.x1 - 2)) < 0) then
        exit(false);
      findColors(green, 65280, b.x1 - 2, b.y1-7, b.x2, b.y2);
      findColors(red, 255, b.x1 - 2, b.y1 - 7, b.x2, b.y2);
      bar := mergeAtpa([green, red]);
      if (length(bar) > 0) then
      begin
        healthbar := clustertpa(bar, 1);
        if (length(healthbar) = 0) then
          exit(false);
        for i := 0 to high(healthbar) do
        begin
          bx := gettpabounds(healthbar[i]);
          if ((bx.x1 - bx.x1) > 25) then
            exit(true);
        end;
      end;
    end;

    function specOn:boolean;
    var
      tpa:TPointArray;
    begin
      result := false;
      findcolorstolerance(tpa, 1210821, 471, 221, 509, 259, 53);
      if (length(tpa) > 25) then
        exit(true);
    end;

    function specPercentage:extended;
    var
      greentpa:tpointarray;
      barOpen:boolean;
    begin
      if specOn then
      begin
        mouse(491, 241);
        wait(200);
      end;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.55, 0.59);
      findcolorstolerance(greentpa, 4176530, 475, 224, 507, 258, 38);
      ColorToleranceSpeed(1);
      SetColorSpeed2Modifiers(0.02, 0.02);
      if (length(greentpa) > 1) then
        result := ((length(greentpa) / 917) * 100)
      else
        result := 0;
    end;

    function differentCount(time:integer): Boolean;
    var
      _white_count:integer;
    begin
      if not ss_xpBarOpen then
        mouse(534, 117);
      _white_count := countColorTolerance(16777215, 410, 110, 508, 123, 5);
      wait(time);
      result := (_white_count <> countColorTolerance(16777215, 410, 110, 508, 123, 5));
    end;

    function inCombat:boolean;
    begin
      result := differentCount(3300);
    end;

    procedure holdKey(ID, time:Integer);
    begin
      keyDown(ID);
      wait(time);
      keyUp(ID);
    end;

    procedure rotateCompass;
    var
      currentAngle:Extended;
      t:Integer;
    begin
      currentAngle := map.GetCompassAngleDegrees();
      t := getSystemTime;
      repeat
        holdKey(37, 120);
      until ((map.GetCompassAngleDegrees() - currentAngle) > 60) or ((map.GetCompassAngleDegrees() - currentAngle) < 60) or ((GetSystemTime - t) > 2500);
    end;

    function _monster.find:boolean;
    var
      mtpas, matpa:t2dpointarray;
      mtpa:tpointarray;
      i, x, y:integer;
      bx:tbox;
      dx, dy, dx2, dy2:integer;
    begin
      ColorToleranceSpeed(2);
      setLength(mtpas, length(self.color));
      for i := 0 to high(self.color) do
      begin
        SetColorSpeed2Modifiers(self.hue[i], self.sat[i]);
        findColorsTolerance(mtpas[i], self.color[i], mainscreen.bounds, self.tol[i]);
      end;
      ColorToleranceSpeed(1);
      SetColorSpeed2Modifiers(0.02, 0.02);
      if (length(mtpas) > 1) then
        mtpa := mergeAtpa(mtpas)
      else
        mtpa := mtpas[0];
      if (length(mtpa) > 0) then
      begin
        matpa := clustertpa(mtpa, 4);
        filtertpasbetween(matpa, 0, self.filter);
        SortATPAFromFirstpoint(matpa, Point(256, 216));
        if debug then
          debugatpa(matpa, 'bmp');
        for i := 0 to high(matpa) do
        begin
          if (checkCombat) then
          begin
            bx := gettpabounds(matpa[i]);
            if not healthBar(bx) then
              continue;
          end;
          if (i > 2) then
            exit(false);
          if useUptext then
            if (_ss.waitUpTextMulti(self.uptext, 150)) then
              continue
            else
              if debug then
                writeln('Uptext ' , self.uptext, ' not found');
          MiddleTPAEx(matpa[i], x, y);
          if rightClick then
          begin
            Mouse(x, y, 0, 0, Mouse_right);
            if _ss.waitOptionMulti(['ttack', 'Atta' ], 1200) then
              exit(true);
          end else
          begin
            mouse(x, y);
            exit(true);
          end;
        end;
      end;
    end;

    function diff300:boolean;
    begin
      result := differentCount(300);
    end;

    procedure updateTotal();
    begin
      if ((getSystemTime - lastCheck) > _update_total) then
      begin
        currentTotal := getTotalLevel();
        markTime(lastCheck);
        openTab(random(14));
      end;
    end;

    function rsps_inventory.clickColor(color, tol:integer):boolean;
    var
      i, x, y:integer;
    begin
      openTab(TAB_INV);
      for i := 0 to high(self.slots) do
        if findColorTolerance(x, y, color, self.slots[i], tol) then
        begin
          self.interactItem(i, mouse_left);
          wait(50 + random(250));
          exit(true);
        end;
    end;

    function rsps_inventory.clickColor(colors, tols:TIntegerArray):boolean;overload;
    var
      i:integer;
    begin
      if (length(colors) <> length(tols)) then
        exit();
      for i := 0 to high(colors) do
        if self.clickColor(colors[i], tols[i]) then
          exit(true);
    end;

    procedure checkPrayer;
    begin
      if (map.getPrayer() < _pray_at) then
        inventory.clickColor([9750065, 6897065], [5, 5]);
      normals.activatePrayer(_use_prayers);
      openTab(random(14));
      wait(random(300));
    end;

    procedure tStatInfo.printSkillInfo;
    var
      i:integer;
    begin
      for i := 0 to high(self.skillLevel) do
        writeln(self.skillName[i],  ' = ' , self.skillLevel[i]);
    end;

    procedure tStatInfo.setSkillNames;
    begin
      self.skillName := ['Attack','Strength','Defense','Range',
      'Prayer','Magic','Runecrafting','Hitpoints', 'Agility','Herblore',
      'Theiving','Crafting','Fletching','Slayer','Mining','Smithing',
      'Fishing','Cooking','Firemaking','Woodcutting','Farming'];
    end;

    procedure tStatInfo.getSkills;
    var
      i, k, basex, basey, c:integer;
    begin
      self.setSkillNames();
      openTab(TAB_STATS);
      basex := 586;
      basey := 300;
      for i := 0 to 2 do
        for k := 0 to 6 do
        begin
          try
            self.skillLevel[c] := StrToInt(getSimpleText([65535], basex + (i * 54), basey + (k * 32), basex + 14 + (i * 54), basey + 11 + (k * 32), 'statchars07'));
          except
            self.skillLevel[c] := -1;
          end;
          c := c + 1;
        end;
    end;

    function getStatID(name:string):integer;
    var
      p:tStatInfo;
      i:integer;
    begin
      p.setSkillNames();
      for i := 0 to high(p.skillName) do
        if (lowercase(p.skillName[i]) = lowercase(name)) then
          exit(i);
    end;

    function getStatID(names:tstringarray):TIntegerArray; overload;
    var
      i:integer;
    begin
      setLength(result, length(names));
      for i := 0 to high(names) do
        result[i] := getStatID(names[i]);
    end;

    function getStatLevel(ID:integer):integer;
    var
      p:tStatInfo;
    begin
      p.getSkills();
      result := p.skillLevel[ID];
    end;

    function getStatLevel(IDs:TIntegerArray):TIntegerArray; overload;
    var
      i:integer;
    begin
      setLength(result, length(IDs));
      for i := 0 to high(IDs) do
        result[i] := getStatLevel(IDs[i]);
    end;

    function getStatLevel(name:string):integer; overload;
    begin
      result := getStatLevel(getStatID(name));
    end;

    function getStatLevel(names:tStringarray):TIntegerArray; overload;
    begin
      result := getStatLevel(getStatID(names));
    end;

    procedure tCustomStatInfo.setUp(skillNames:TStringArray);
    var
      i:integer;
    begin
      setLength(self.skillName, length(skillNames));
      setLength(self.skillLevels,length(skillNames));
      for i := 0 to high(skillNames) do
        self.skillName[i] := skillNames[i];
    end;

    procedure tCustomStatInfo.compare(var p:tCustomStatInfo);
    var
      i:integer;
    begin
      p.setUp(self.Skillname);
      for i := 0 to high(self.skillLevels) do
        p.skillLevels[i] := (self.SkillLevels[i] - getStatLevel(self.skillName[i]));
    end;

    procedure tCustomStatInfo.update();
    begin
      self.skillLevels := getStatLevel(self.skillName);
    end;

    procedure updateStats();
    begin
      currentSkills.update();
    end;

    procedure _eventTimerArray.update;
    var
      i:integer;
    begin
      for i := 0 to high(self) do
      begin
        if (self[i].activated) then
          if ((getSystemTime - self[i].lastTime) > self[i]._maxTime) then
          begin
            self[i].onTimeUp();
            markTime(self[i].lastTime);
          end;
      end;
    end;

    procedure printGainedLevels;
    var
      i:integer;
    begin
      writeln('============Script finish report============');
      for i := 0 to high(customSkills.skillLevels) do
        writeln(customSkills.skillName[i] , ' Start: ' , customSkills.skillLevels[i], ' Finish: ' , currentSkills.skillLevels[i], ' Gained: ' , (customSkills.skillLevels[i] - currentSkills.skillLevels[i]));
      writeln('Total levels gained ' , (startTotal - currentTotal));
    end;

    procedure _eventTimerArray.init;
    var
      i:integer;
    begin
      setLength(self, 3);
      with self[0] do
      begin
        eventName := 'Check total';
        _maxtime := _update_total;
        activated := _updateTotal;
        onTimeUp := @checkPrayer;
      end;
      with self[1] do
      begin
        eventName := 'Check prayer';
        _maxtime := _check_prayer_every;
        activated := _pray;
        onTimeUp := @checkPrayer;
      end;
      with self[2] do
      begin
        eventName := 'Check levels';
        activated := _trackSkills;
        _maxtime := _update_every;
        onTimeUp := @updateStats;
      end;
      for i := 0 to high(self) do
        markTime(self[i].lastTime);
    end;

    procedure _ssFight;
    var
      t, reply:integer;
    begin
      ss_login;
      myTimers.update();
      if (failed > 40) then
      begin
        m.progress('Script failed');
        reply := messageBox('The script has failed more then 5 times, would you like to enter Debug mode?', 'ATTENTION', 2);
        writeln('The script has failed more then 5 times');
        if (reply = 4) then
        begin
          debug := true;
          failed := 0
        end
        else if (reply = 3) then
          terminateScript
        else
          failed := 0;
      end else begin
        if (m.find) then
        begin
          m.progress('Waiting to get into combat');
          if waitFunc(@diff300, 50, 4500) then
          begin
            failed := 0;
            marktime(t);
            while (inCombat) do
            begin
              if (not ss_in) then
                exit();
              myTimers.update();
              m.progress('Fighting ' + m.name);
              wait(100 + random(100));
              if (timeFromMark(t) > _timeout) then
                exit();
            end;
              if (not differentCount(10)) then
              begin
                m.progress('Killed ' + m.name);
                kills := kills + 1;
                if _loot then
                begin
                  m.progress('Looting');
                  _PickUps.pickUp();
                  exit();
                end else
                  exit();
              end;
          end else
            m.progress('Unexpected out of combat');
        end else
          m.progress('did not find monster rotating compass');
          rotateCompass;
            exit();
          m.progress('Failsafe, waiting, failedcount = ' + toStr(failed));
          failed := failed + 1;
          if (failed < 2) then
            exit();
          wait(random(3000));
      end;
    end;

    procedure updateSettingsStuff();
    begin
      if (not hasSettingsFile) then
        updateSettingsFiles;
      saveSettings();
      loadScriptVars;
     // if _displayMonsters then
     // begin
     //   printLoaded();
      //  exit();
     // end;
      //printInfo(['news','authors','mentions','instructions'], 400, 50);
    end;

    procedure start();
    begin
      clearDebug();
      m.init;
      if (_trackSkills) then
        customSkills.setUp(_track_skills);
      debug := false;
      myTimers.init();
      _ss.init('soulsplit');
      mousespeed := 35;
      updateSettingsStuff();
      ss_login;
      startXP := ss_getXPBarTotal();
      startXPString := ss_getXPBarTotalString();
      startTotal := getTotalLevel();
      currentTotal := getTotalLevel();
      if (_pray) then
      begin
        normals.init('normal');
        normals.activatePrayer(_use_prayers);
      end;
      if (_trackSkills) then
      begin
        customSkills.update();
        currentSkills.setUp(_track_skills);
        updateStats();
      end;
      addOnTerminate('printGainedLevels');
    end;

    begin
      start();
      repeat
        _ssFight;
      until isKeyDown(113);
    end.

  25. #25
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by uhit View Post
    ...
    Did you select the SS client?

Page 1 of 4 123 ... LastLast

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
  •