Results 1 to 7 of 7

Thread: Herb cleaner (Doesn't work, need help.)

  1. #1
    Join Date
    Feb 2012
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Herb cleaner (Doesn't work, need help.)

    Hi this is my first script and I've created it by following tutorials.

    Sadly it doesn't seem to do what i want it to, and I'm not sure why.

    Code:
    program DeclarePlayers;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    
    {$IFDEF SMART}
        {$i srl/srl/misc/paintsmart.simba}
    {$ENDIF}
    
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name := ''; // Username
      Players[0].Pass := ''; // Password
      Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
      Players[0].Active := True; // Set to true if you want to use Player 0
      Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
    end;
    
    
    procedure FindAndClean();
    var
      DTM, x, y : Integer;
    begin
      DTM := DTMFromString('mlwAAAHicY2dgYAgB4iAgTgDiaCD2B2IXIPYBYjUglgJiBSDWgWJVIJYFYmsDKQYuLx4gi4nBy0aRgS9RgIEngg8qhhsw4sFQAAB+FwYo');  // Grimy guam
      if(FindDTM(DTM, x, y, MIX1, MIY1, MIX2, MIY2))then
      begin
        Mouse(x, y, 5, 5, mouse_Left);
        Wait(RandomRange(20, 100));
      end;
      FreeDTM(DTM);
    end;
    begin
      {$IFDEF SMART}
        Smart_Server := 0;
        Smart_Members := True;
        Smart_Signed := True;
        Smart_SuperDetail := False;
      {$ENDIF}
      SetupSRL();
      ClearDebug();
      DeclarePlayers();
      LoginPlayer();
    end.
    It loads SMART and logs in fine. But it doesn't do anything after that even though i (think i) told look for the grimy herbs and left click them.

    Can anyone see where i went wrong?

  2. #2
    Join Date
    Nov 2010
    Posts
    305
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    You never called your procedure in your main loop?

    Simba Code:
    begin
      {$IFDEF SMART}
        Smart_Server := 0;
        Smart_Members := True;
        Smart_Signed := True;
        Smart_SuperDetail := False;
      {$ENDIF}
      SetupSRL();
      ClearDebug();
      DeclarePlayers();
      LoginPlayer();
    end.

    Simba Code:
    begin
      {$IFDEF SMART}
        Smart_Server := 0;
        Smart_Members := True;
        Smart_Signed := True;
        Smart_SuperDetail := False;
      {$ENDIF}
      SetupSRL();
      ClearDebug();
      DeclarePlayers();
      LoginPlayer();
      FindAndClean; //This is your cleaning Procedure
    end.

  3. #3
    Join Date
    Jan 2012
    Posts
    522
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What do you mean? You have to call your procedure as 'Failure' said above.

  4. #4
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    In useing functions and procedures you need to call then to the main program bascially. The main program looks like this:

    program cleanthoseherbs;

    this is where you put the procedures and functions that you plan to call below
    It will skip this part until the things inside of here are called


    begin <----- it jumps down to here when you run teh script so you need to call the things ^
    loop and all the functions and procedures in here along with the defining smart etc.
    You need to add the FindAndClean; in here
    end.

    hope that helps clear some things up just add your procedure in here

  5. #5
    Join Date
    Jun 2006
    Location
    N Wales
    Posts
    558
    Mentioned
    2 Post(s)
    Quoted
    56 Post(s)

    Default

    ok if this code is all yours then its not such a bad start well done to you.

    the reason your script doesn't do anything is because in your main loop you haven't told it to do anything.

    your main loop is this section here
    Code:
    begin
      {$IFDEF SMART}
        Smart_Server := 0;
        Smart_Members := True;
        Smart_Signed := True;
        Smart_SuperDetail := False;
      {$ENDIF}
      SetupSRL();
      ClearDebug();
      DeclarePlayers();
      LoginPlayer();
    end.
    what you have done is correct in terms of setting up the script however after this you need to add in a loop of tasks that your script will repeat. to do this you use
    Code:
    repeat
    //stuff here
    until();
    in your case you will want it to look like this:
    Code:
    begin
      {$IFDEF SMART}
        Smart_Server := 0;
        Smart_Members := True;
        Smart_Signed := True;
        Smart_SuperDetail := False;
      {$ENDIF}
      SetupSRL();
      ClearDebug();
      DeclarePlayers();
      LoginPlayer();
      repeat
        FindandClean;
      until(false);
    end.
    the until(false); means it will repeat the FindandClean procedure an infinate amount of times. This is obviously not a recommended practice. Perhaps you should read through this thread it explains basic scripting pretty nicely http://villavu.com/forum/showthread.php?t=58935

  6. #6
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by the flea View Post
    ok if this code is all yours then its not such a bad start well done to you.

    the reason your script doesn't do anything is because in your main loop you haven't told it to do anything.

    your main loop is this section here
    Code:
    begin
      {$IFDEF SMART}
        Smart_Server := 0;
        Smart_Members := True;
        Smart_Signed := True;
        Smart_SuperDetail := False;
      {$ENDIF}
      SetupSRL();
      ClearDebug();
      DeclarePlayers();
      LoginPlayer();
    end.
    what you have done is correct in terms of setting up the script however after this you need to add in a loop of tasks that your script will repeat. to do this you use
    Code:
    repeat
    //stuff here
    until();
    in your case you will want it to look like this:
    Code:
    begin
      {$IFDEF SMART}
        Smart_Server := 0;
        Smart_Members := True;
        Smart_Signed := True;
        Smart_SuperDetail := False;
      {$ENDIF}
      SetupSRL();
      ClearDebug();
      DeclarePlayers();
      LoginPlayer();
      repeat
        FindandClean;
      until(false);
    end.
    the until(false); means it will repeat the FindandClean procedure an infinate amount of times. This is obviously not a recommended practice. Perhaps you should read through this thread it explains basic scripting pretty nicely http://villavu.com/forum/showthread.php?t=58935
    Ya basically what I said he just used more actual code I was just trying to give the the basic concepts hopes these help you I like the effort that you gave in trying to learn code. Best of luck.

  7. #7
    Join Date
    Feb 2012
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by the flea View Post
    ok if this code is all yours then its not such a bad start well done to you.

    the reason your script doesn't do anything is because in your main loop you haven't told it to do anything.

    your main loop is this section here
    Code:
    begin
      {$IFDEF SMART}
        Smart_Server := 0;
        Smart_Members := True;
        Smart_Signed := True;
        Smart_SuperDetail := False;
      {$ENDIF}
      SetupSRL();
      ClearDebug();
      DeclarePlayers();
      LoginPlayer();
    end.
    what you have done is correct in terms of setting up the script however after this you need to add in a loop of tasks that your script will repeat. to do this you use
    Code:
    repeat
    //stuff here
    until();
    in your case you will want it to look like this:
    Code:
    begin
      {$IFDEF SMART}
        Smart_Server := 0;
        Smart_Members := True;
        Smart_Signed := True;
        Smart_SuperDetail := False;
      {$ENDIF}
      SetupSRL();
      ClearDebug();
      DeclarePlayers();
      LoginPlayer();
      repeat
        FindandClean;
      until(false);
    end.
    the until(false); means it will repeat the FindandClean procedure an infinate amount of times. This is obviously not a recommended practice. Perhaps you should read through this thread it explains basic scripting pretty nicely http://villavu.com/forum/showthread.php?t=58935
    Thank you, and everyone else that helped. (Gosh, this forum is a LOT more helpful than other ones I've used in the past. I expected 'GTFO NOOB LOLZ')

    "code is all yours" I actually hi-jacked most of it and re-purposed it from the very thread you linked me! I read it all first of course and thought i had the idea, but i didn't seem to catch the part about calling my procedure into action.

    It's late so I'll be sure to try that tomorrow morning, and then i get onto the banking, other herbs and possibly even buying/selling GE if I'm feeling adventurous. Should be fun.

    While i have your attention, can i ask if creating an intractable paint is possible in Simba? For the user to select their herbs they wish to clean. I know the alternative is to just make them select which they want in the actual code, but I'd like to be flashy.

    Thanks in advance!
    Last edited by Powerfrog; 03-04-2012 at 02:47 AM.

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
  •