Results 1 to 9 of 9

Thread: Sandy Crabs AFK - Very Simple First Script

  1. #1
    Join Date
    Apr 2017
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default Sandy Crabs AFK - Very Simple First Script

    Nothing special. Just a very simple first script that notify s you with a message when Sand Crabs lose their aggression. It will not reset your player for you, this is only for people who like to afk. Let me know if you find any bugs .

    V1
    Code:
    program Sandy_Crabs;
    
    var
      x, y, Counter: Integer
    begin
      if (FindColor(x, y, 65280, 248, 118, 463, 332) and (x > 150)) then
        Counter := 0;
      repeat
        Counter := Counter + 1;
        begin
          WriteLn('Running for ' + IntToStr(GetTimeRunning) + 'Ms');
          Writeln('Sandy Crabs are agressive');
          Writeln(x, '  ', y);
          Writeln('A First script written by Fidget ');
          Writeln('https://villavu.com/forum/showthread.php?t=117952&p=1389707#post1389707');
          sleep(2000);
          ClearDebug;
        end;
        if (not (FindColor(x, y, 65280, 248, 118, 463, 332) and (x > 150))) then
        begin
          ShowMessage('Reset Sandy Crabs');
          sleep(3000);
        end;
      until (Counter < 0);
    end.
    v2 With sound

    Code:
    program Sandy_Crabs;
    
    var
      x, y, Counter: Integer
    begin
      if (FindColor(x, y, 65280, 248, 118, 463, 332) and (x > 150)) then
        Counter := 0;
      repeat
        Counter := Counter + 1;
        begin
          WriteLn('Running for ' + IntToStr(GetTimeRunning) + 'Ms');
          Writeln('Sandy Crabs are agressive');
          Writeln(x, '  ', y);
          Writeln('A First script written by Fidget ');
          Writeln('https://villavu.com/forum/showthread.php?t=117952&p=1389707#post1389707');
          sleep(2000);
          ClearDebug;
        end;
        if (not (FindColor(x, y, 65280, 248, 118, 463, 332) and (x > 150))) then
        begin
          writeln(#7);
          ShowMessage('Reset Sandy Crabs');
          sleep(3000);
          Stopsound;
        end;
      until (Counter < 0);
    end.


    Note: This won't work in full screen.
    Attached Images Attached Images
    Last edited by Fidget; 11-19-2017 at 05:59 AM.

  2. #2
    Join Date
    Apr 2017
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    I'd also like to add a sound that plays when the message box pops up but i'm unsure how too.

  3. #3
    Join Date
    Feb 2012
    Posts
    180
    Mentioned
    2 Post(s)
    Quoted
    84 Post(s)

    Default

    Quote Originally Posted by Fidget View Post
    I'd also like to add a sound that plays when the message box pops up but i'm unsure how too.
    There's this playsound function, not sure if it works. http://docs.villavu.com/simba/script...html#playsound

  4. #4
    Join Date
    Apr 2017
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by Pastah View Post
    There's this playsound function, not sure if it works. http://docs.villavu.com/simba/script...html#playsound
    Will give it a try. Thanks!

    No luck :-( No sound is playing.
    Code:
    program Sandy_Crabs;
    
    var
      x, y, Counter: Integer
    begin
      if (FindColor(x, y, 65280, 248, 118, 463, 332) and (x > 150)) then
        Counter := 0;
      repeat
        Counter := Counter + 1;
        begin
          WriteLn('Running for ' + IntToStr(GetTimeRunning) + 'Ms');
          Writeln('Sandy Crabs are agressive');
          Writeln(x, '  ', y);
          Writeln('A First script written by Fidget ');
          Writeln('https://villavu.com/forum/showthread.php?t=117952&p=1389707#post1389707');
          sleep(2000);
          ClearDebug;
        end;
        if (not (FindColor(x, y, 65280, 248, 118, 463, 332) and (x > 150))) then
        begin
          PlaySound('C:\Baa-Baa-Black-Sheep-.mp3');
          ShowMessage('Reset Sandy Crabs');
          sleep(3000);
          Stopsound;
        end;
      until (Counter < 0);
    end.
    Sound file download http://billysworld.biz/wp-content/up...ack-Sheep-.mp3

    Got a sound to work with this code
    Code:
    writeln(#7);
    Last edited by Fidget; 11-19-2017 at 05:48 AM.

  5. #5
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Neat little script
    PlaySound only accepts wav-files.
    !No priv. messages please

  6. #6
    Join Date
    Apr 2017
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    Neat little script
    PlaySound only accepts wav-files.
    Thanks very much Slacky

  7. #7
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Cool! I remember creating something similar like this for testing purposes. Every time my players invo got full, it would play a sound.

  8. #8
    Join Date
    Dec 2017
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    looks nice

  9. #9
    Join Date
    Apr 2017
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Thanks very much

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
  •