Results 1 to 19 of 19

Thread: Simba(or Slushpuppy ^.^) Sound Library

  1. #1
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

    Default Simba Sound Library

    Simba Sound Library

    This is an addon tool designed to aid developers in adding realism to their scripts.

    In Runescape, any activity performed by your character is accompanied by a distinct sound feedback. By capturing this feedback, you can accurately determine if your character is doing a particular task.

    By using sound and color, scripts can be more accurate, realistic and productive.


    I do plan to add sound waves matching in the future-when real life grants me such opportunity


    Users:

    Setup runescape account and your sound mixer as described:


    Download the soundlib.zip attached to this topic and extract, then save it to C:\Simba\Plugins



    Developers:




    API:
    Code:
    {
    
    SSL_init(PID : Integer,Interval : Integer); 
    
    This procedure initiates the library. This function can only be called after SetupSRL. 
    
    - PID : Process ID of java.exe which can be retrieved from Smart_CurrentClient integer
    
    - Interval  : The time period, in milliseconds, which the library tries to capture sound. 
    
      }
    
    SSL_hasSound : Boolean;
    
    This function checks for the presence of sound data from PID. Returns True/False


    How to use this library in your scripts

    Simba Code:
    {$DEFINE SMART}
    {$DEFINE SMART8}

    {$I SRL/SRL.Simba}
    {$loadlib soundlib.dll}

    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      with Players[0] do
      begin
        Name        := '';
        Pass        := '';
        Pin         := '';
        WorldInfo   := [27, 42, 45, 46, 48, 52, 59, 70, 72, 78, 79, 87, 104, 115, 117];
        BoxRewards  := ['XP','xp','lamp'];
        LampSkill   := Skill_Slayer;
        Active      := True;
      end;
    end;

    begin
      {$IFDEF SMART}
        {$IFDEF SIMBAMAJOR980}
          Smart_Server := 72;
          Smart_Members := True;
          Smart_Signed := True;
          Smart_SuperDetail := False;
        {$ELSE}
          SRL_SixHourFix := True;
          Smart_FixSpeed := True;
        {$ENDIF}
      {$ENDIF}

      DeclarePlayers;
      SetupSRL;
      SSL_init(Smart_CurrentClient,400);
      repeat
      begin
      sleep(1000);
      writeln(booltostr(SSL_hasSound));
      end
      until(false);
    end.

    Test run




    Example script:
    http://villavu.com/forum/showthread....05#post1117705
    Last edited by slushpuppy; 10-26-2012 at 02:14 PM.

  2. #2
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    nice, People mention this every now and then but it was never made (that I know of)

  3. #3
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Really cool little utility, definitely going to test this out when I next have a chance to write a script

  4. #4
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

  5. #5
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    433
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    For this to actually kick in on widescale use, you either need:
    1. a SMART function that sets the volume to 1% that scripters may call in their scripts.
    2. a way to pull the sound without it actually reaching the speakers.

    Im pretty sure people are too lazy to manually set the volume to that 1% and no one wishes to hear clicks and clacks, especially if people run multiple bots simultaneously, not to mention it has to be set to 1% again once SMART reloads after 6 hours.

    I like the concept of using the sounds tho, its something that can be very helpful in many cases.

  6. #6
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    If anyone has gotten this working in their scripts could they tell me how? I read the instructions and set it up correctly, but It always reports there to be sound even when there's not

    Here's the code if anyone's curious:
    Simba Code:
    program RatKilla;

    {$Define smart}
    {$i srl/srl.simba}
    {$I SRL/srl/skill/fighting.Simba}
    {$i sps/sps.simba}
    {$loadlib soundlib.dll}

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      with Players[0] do
      begin
        Name       := ''; // Player username
        Pass       := ''; // Player password
        BoxRewards := ['XP', 'ostume', 'mote', 'oins', 'une', 'ssence'];
        LampSkill  := Skill_Attack;
        Active     := True;
      end;
    end;


    Var
     Kills, Bones, Deaths: Integer;

    procedure StartLogin;

    begin
      ClearDebug;
      {$IFDEF SMART}
        {$IFDEF SIMBAMAJOR980}
          Smart_Server := 10;
          Smart_Members := False;
          Smart_Signed := True;
          Smart_SuperDetail := False;
        {$ELSE}
          SRL_SixHourFix := True;
          Smart_FixSpeed := True;
        {$ENDIF}
      {$ENDIF}
      DeclarePlayers;
      LoginPlayer;
      MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
      SetChat('hide', 1);
    end;

    Procedure WalkToRats;
      Var
        WalkToGiantRats:TPointArray;

        begin
          if not LoggedIn then LoginPlayer;
          SPS_Setup(RUNESCAPE_SURFACE,['11_8','11_9']);
          WalkToGiantRats := [Point(4717, 3562), Point(4687, 3620), Point(4659, 3629), Point(4593, 3629), Point(4567, 3605)];
          SPS_WalkPath(WalkToGiantRats)
          MakeCompass('S');
        end;

    procedure Antiban;
      Var
        WalkBack:TPointArray;
    begin
      if not LoggedIn then LoginPlayer;
      FindNormalRandoms;
        case Random(90) of
          0..9: RadialWalkTolerance(63487,0,359,25,5,5,2);
          2: PickUpMouse;
          3: PickUpMouse;
          4: BoredHuman;
          5: HoverSkill(skill_prayer,false);
          6: MakeCompass('N');
          7: SetAngle(SRL_ANGLE_HIGH);
          8: Wait(5000+random(2000));
          9: HoverSkill(skill_attack,false);
        end;
    end;

    Function IsFighting : Boolean;

    begin
      Result := SSL_hasSound;
    end;

    Procedure KillRats;
      Var
        x, y: Integer;
    begin
      if not LoggedIn then LoginPlayer;
      FindNormalRandoms;
      If (not InFight) Then
      begin
        If FindObjCustom(x, y, ['Rat', 'at'], [4605769, 3882302], 5) Then
        begin
          ClickMouse2(false);
          WaitOption('nt', 2000);
          Wait(100);
          If IsFighting then
          begin
            WriteLn('Fighting Rat')
            Kills := Kills + 1
            Wait(randomrange(800,1200));
            Repeat
              Antiban;
              Wait(randomrange(100,200));
            Until(not SRL_infight)
          end;
          Flag;
          Wait(randomrange(800,1200));
        end;
      end;
    end;

    Procedure GetBones;
      Var
        x, y: Integer;
    begin
      if not LoggedIn then LoginPlayer;
      FindNormalRandoms;
      If (not InFight) Then
      begin
        If FindObjCustom(x, y, ['take', 'Raw', 'ones'], [12567240], 3) Then
        Begin
          WriteLn('Bones Located')
          GetMousePos(x, y);
          Mouse(x, y, 1, 1, false);
          Antiban;
          WaitOption('ones', 500);
          Flag;
        end;
      end;
    end;

    Procedure BuryBones;
    var
      l, m, Bone: Integer;
    begin
      if not LoggedIn then LoginPlayer;
      If (not InFight) Then
      Repeat
        Bone := DTMFromString('mbQAAAHicY2VgYIhiYmAIA+JUIA4B4iAgXsbIwLCBEUIvgNJdLS1A1Uwo+D8DJmDEgsEAAD57B7A=');

        If FindDTM(Bone, l, m, MIX1, MIY1, MIX2, MIY2) Then
        begin
          FindNormalRandoms;
          Case Random(20) Of
            0..18: Mouse(l, m, 10, 10, true);
            19: begin
            Mouse(l, m, 10, 10, true);
            HoverSkill(skill_Prayer, False);
            WriteLn('Antiban: Prayer XP Check Performed');
            end;
            20: MissMouse(l+random(400),m+random(400));
          end;
          Bones := Bones + 1
          wait(randomrange(1500,1900));
        end;
        FreeDTM(Bone);
      Until(InvEmpty);
    end;

    Procedure InvCheck;

    begin
      if not LoggedIn then LoginPlayer;
      If(InvFull) and (not InFight) Then
      begin
        BuryBones;
      end else
       exit;
    end;

    Procedure DeathCheck;

    begin
      Reincarnate:=true;
      if not LoggedIn then LoginPlayer;
      If(FindDead) Then
      begin
        Deaths := Deaths + 1
        WriteLn('You died. Returning to rats..');
        MouseItem(2, mouse_left);
        MouseItem(3, mouse_left);
        MouseItem(4, mouse_left);
        MouseItem(6, mouse_left);
        MouseItem(5, mouse_left);
        MouseItem(1, mouse_left);
        WalkToRats;
      end else
       exit;
    end;


    procedure Proggy;
    var
      KillsPH, DeathsPH, CombatXPPH:Integer;

    begin
      if not LoggedIn then LoginPlayer;
      wait(100);
      KillsPH := Round((Kills * 3600) / (GetTimeRunning / 1000));
      DeathsPH := Round((Deaths * 3600) / (GetTimeRunning / 1000));
      CombatXPPH := Round(((Kills * 27) * 3600) / (GetTimeRunning / 1000));
      ClearDebug;
      Writeln('~~~~~Rat Killer V1.0~~~~~');
      Writeln('        ~By BMWxi~               ');
      Writeln(' Rats Killed: ' + IntToStr(Kills) + ' (' + IntToStr(KillsPH) + ' P/H)');
      Writeln(' Deaths: ' + IntToStr(Deaths) + ' (' + IntToStr(DeathsPH) + ' P/H)');
      Writeln(' CombatXP earned: ' + IntToStr(Kills * 20) + ' (' + IntToStr(CombatXPPH) + ' P/H)');
      Writeln(' Total Time: ' + TimeRunning);
      Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~');
    end;

    begin
      SetupSRL;
      DeclarePlayers;
      SSL_init(Smart_CurrentClient,400);
      StartLogin;
      Repeat
        KillRats;
        DeathCheck;
        Proggy
      Until(not LoggedIn);
    end.
    Last edited by Ian; 11-13-2012 at 05:43 AM.

  7. #7
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by DaWu View Post
    For this to actually kick in on widescale use, you either need:
    1. a SMART function that sets the volume to 1% that scripters may call in their scripts.
    2. a way to pull the sound without it actually reaching the speakers.

    Im pretty sure people are too lazy to manually set the volume to that 1% and no one wishes to hear clicks and clacks, especially if people run multiple bots simultaneously, not to mention it has to be set to 1% again once SMART reloads after 6 hours.

    I like the concept of using the sounds tho, its something that can be very helpful in many cases.
    I couldn't agree more, this is great but it has soo much more potential

  8. #8
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

    Default

    Quote Originally Posted by DaWu View Post
    For this to actually kick in on widescale use, you either need:
    1. a SMART function that sets the volume to 1% that scripters may call in their scripts.
    2. a way to pull the sound without it actually reaching the speakers.

    Im pretty sure people are too lazy to manually set the volume to that 1% and no one wishes to hear clicks and clacks, especially if people run multiple bots simultaneously, not to mention it has to be set to 1% again once SMART reloads after 6 hours.

    I like the concept of using the sounds tho, its something that can be very helpful in many cases.
    2. I opted to use existing win32 hooks to retrieve sound data as they are easier than trying to inject into the windows sound layer stack. With that said, I still have that planned in the future.


    By setting your sound to 1%, you will not hear anything unless you are superman. Also those sound settings preserve between runescape and windows sessions

  9. #9
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    433
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by slushpuppy View Post
    2. I opted to use existing win32 hooks to retrieve sound data as they are easier than trying to inject into the windows sound layer stack. With that said, I still have that planned in the future.


    By setting your sound to 1%, you will not hear anything unless you are superman. Also those sound settings preserve between runescape and windows sessions
    Sadly with the sound settings @ original post, I can hear the chopping sounds for example, clear as day.

  10. #10
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by DaWu View Post
    Sadly with the sound settings @ original post, I can hear the chopping sounds for example, clear as day.
    For me I don't hear them, but it always thinks there is sound even if I'm standing still (with the settings correct too)

  11. #11
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    433
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    Actually, it seems like this works perfectly fine with even lower effect sound level set in runescape (in OP its nowhere near minimum)

  12. #12
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by DaWu View Post
    Actually, it seems like this works perfectly fine with even lower effect sound level set in runescape (in OP its nowhere near minimum)
    That could be the problem, thanks!

  13. #13
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    433
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    That could be the problem, thanks!
    The problem with your script is that you are calling the sound check way too early. Make it wait for the sound to show up for like 5 seconds before declaring it nonexistant. You call the soundcheck 100ms after you've clicked the monsters, theres a good chance you haven't even reached the monster yet not to mention sound to be registered by the plugin.

  14. #14
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by DaWu View Post
    The problem with your script is that you are calling the sound check way too early. Make it wait for the sound to show up for like 5 seconds before declaring it nonexistant. You call the soundcheck 100ms after you've clicked the monsters, theres a good chance you haven't even reached the monster yet not to mention sound to be registered by the plugin.
    Oh, whoops

    I'm using putonajonny's hitsplat detection method right now though, it is probably just as accurate.

  15. #15
    Join Date
    Feb 2012
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Will I be able to use this on a non-RS script?
    Non-RS scripter, if you need a hand with scripting let me know. I have a decent amount of experience scripting for non-RS games.

    How to add text messaging to any script: http://villavu.com/forum/showthread....98#post1151998

  16. #16
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Very interesting. I've heard this talked about b4, but never seen it done. I would definitely think this would be a very valuable tool to progress further. I'm surprised to see this hasn't been developed and implemented into srl years ago. And even now, after slushpuppy got it started no one is trying to take it further. I will attempt to test it in the near future.
    Not scripting for RS anymore, sorry. Banned too many times.
    MY SCRIPTS

  17. #17
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    @slushpuppy: Have you updated this recently? I'd like to use it in Simba 1.0. Also, do you have plans in the future to have this plugin return the exact ID of the current sound playing (if any)? As said above, this has potential...

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  18. #18
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    @slushpuppy: Have you updated this recently? I'd like to use it in Simba 1.0. Also, do you have plans in the future to have this plugin return the exact ID of the current sound playing (if any)? As said above, this has potential...
    I will work on this after I finish my opencv plugin for rs3

  19. #19
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by slushpuppy View Post
    I will work on this after I finish my opencv plugin for rs3
    Awesome, then I'll keep a close eye on this thread. Make a post when you've updated it or drop me a line.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


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
  •