Results 1 to 13 of 13

Thread: Pokemon Fisher

  1. #1
    Join Date
    Feb 2008
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Pokemon Fisher

    Hey everyone,

    I'm looking for a bit of help with a script I made for fishing in a pokemon game that runs out of java. I have a version that works 100% with wait timers but that means it's slow because I have had to allow for the slowest possibilities.

    I'm trying to upgrade it so I'm using FindColorSpiralTolerance however for someone reason even though I can use the tool to find the colour once the script is running it just cant see what I'm looking for, unless I start it in the battle.

    I'll quickly run you through the sequence

    F2 casts the line - After this either nothing happens or the battle starts.
    Battle starts - A bunch of red boxes appear and this is where I want simba to find them.
    Battle - I press 'Z' twice, this is fine as it is.
    Battle finishes - The battle window closes and I'm back to needing to fish. This can be done more easily with a wait timer as it's not random like casting a line and I one hit the wild pokemon.

    I would like help trying to fix the part where it's finding the red boxes. The box that is selected by default is the colour '7175130' and the 3 other boxes are colour 5070016. They are found within the box x=262, y=454 x x=745, y=539

    Simba Code:
    program Fish;

    procedure Battle;

    begin
      Writeln('Battle');
      wait(5000)
      SendKeys('z', 100, 100);       // Z Key
      wait(1000)
      SendKeys('z', 100, 100);       // Z Key
      wait(10000)
    end;


    procedure UseRod;

    begin
      wait(100)
      Writeln('Fishing');
      PressKey(113);       // F2 Key
      wait(100)
    End;


    procedure Fish;
    var
      x, y:Integer;


    begin
      wait(100)
      FindColorSpiralTolerance(x, y, 14186568, 0, 0, 100, 100, 100)
      Writeln('Colour');
      if FindColorSpiralTolerance(x, y, 7175130, 262, 454, 745, 539, 20) Or
         FindColorSpiralTolerance(x, y, 5070016, 262, 454, 745, 539, 20) Then
          begin
            Battle;
          End Else UseRod;
    end;


    begin

    wait(2000)

    repeat

    Fish;

    until(false)

    end.

    Any ideas what I've done wrong/how to fix it?

    Thanks,

    Josh

  2. #2
    Join Date
    Feb 2008
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  3. #3
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Simba Code:
    While not (GetColor(x, y) = 7175130) do
      Wait(100);

    Try that. Put the coordinates as x and y. This does what it looks like- While the point isn't color 7175130, it waits.

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

    Default

    I like the idea of using simba for pokemon, but I don't have the game so I can't test. Also my scripting knowledge is not at the level where I can tell the problem by sight.

  5. #5
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    Why not try using Waitfunc....

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  6. #6
    Join Date
    Feb 2008
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by BraK View Post
    Why not try using Waitfunc....
    I currently have a script that uses wait functions and it works perfectly. The problem is that It's random whether you get a pokemon when fishing or not. therefore I have to do a long wait incase I don't get one for a while. Often I catch one on the first time and ~10 seconds is wasted. Just trying to improve my script to make it better and learn a little more

  7. #7
    Join Date
    Feb 2008
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Nebula View Post
    Simba Code:
    While not (GetColor(x, y) = 7175130) do
      Wait(100);

    Try that. Put the coordinates as x and y. This does what it looks like- While the point isn't color 7175130, it waits.
    So could I do

    Simba Code:
    begin
      Writeln('Colour');
    While not (GetColor(281, 467) = 7175130) do
    UseRod;
    Battle;
    end;

    Thanks for taking your time to help,

    Josh

    EDIT: I tried this and it still doesn't work. Perhaps it's an issue where simba can't find the colours properly?
    Last edited by Giant Panda; 09-14-2012 at 08:08 AM.

  8. #8
    Join Date
    Feb 2008
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  9. #9
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    That's not a Waitfunc...

    Code:
    Waitfunc(Func:Function:Boolean; WaitPerLoop, MaxTime : Integer): Boolean;

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  10. #10
    Join Date
    Feb 2008
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by BraK View Post
    That's not a Waitfunc...

    Code:
    Waitfunc(Func:Function:Boolean; WaitPerLoop, MaxTime : Integer): Boolean;
    How will this make it quicker?

    Surely it's just a condensed version of wait(####)?

  11. #11
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    Say that you have a function to see if you caught something. this will repeat that check until a. Something is caught or be max time is reached.

    Code:
    CaughtSomthing:Boolean;
    
    WaitFunc('CaughtSomething',500, 5000);
    The waitfunc shown will check caught something every 500 milliseconds until 5000 milliseconds have passed or it has returned true.

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  12. #12
    Join Date
    Feb 2008
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by BraK View Post
    Say that you have a function to see if you caught something. this will repeat that check until a. Something is caught or be max time is reached.

    Code:
    CaughtSomthing:Boolean;
    
    WaitFunc('CaughtSomething',500, 5000);
    The waitfunc shown will check caught something every 500 milliseconds until 5000 milliseconds have passed or it has returned true.
    Aah i see, thank you very much. I'll definitely include this in my script!


    Does anyone have any ideas about the colour finding problem? The software is all updated and I can find the colour using the the pippet tool thingy.

    thanks,

    Josh

    bump

    Bump
    Last edited by BraK; 09-17-2012 at 07:43 PM.

  13. #13
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    Look up TPAs and Findcolors and use a Tolerance possibly with a countcolor to ensure that you are finding the correct object. Those will be the most help to you with object finding.

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

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
  •